org.norther.tammi.acorn.io
Class FileDateComparator

java.lang.Object
  extended by org.norther.tammi.acorn.io.FileDateComparator
All Implemented Interfaces:
Serializable, Comparator

public class FileDateComparator
extends Object
implements Comparator, Serializable

A comparator for file dates.

Author:
Ilkka Priha
See Also:
Serialized Form

Constructor Summary
FileDateComparator()
          Constructs a new comparator.
 
Method Summary
protected  int compare(File file1, File file2)
          Compares two file dates in ascending order.
 int compare(Object file1, Object file2)
          Compares two file dates.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

FileDateComparator

public FileDateComparator()
Constructs a new comparator.

Method Detail

compare

public int compare(Object file1,
                   Object file2)
Compares two file dates.

Specified by:
compare in interface Comparator
Parameters:
file1 - the first file to be compared.
file2 - the second file to be compared.
Returns:
-1, 0 or 1 based on comparison.
Throws:
NullPointerException - for null files.
ClassCastException - if parameters are not files.

compare

protected int compare(File file1,
                      File file2)
Compares two file dates in ascending order.

Parameters:
file1 - the first file to be compared.
file2 - the second file to be compared.
Returns:
-1, 0 or 1 based on comparison.
Throws:
NullPointerException - for null files.


Copyright © 2004 The Norther Organization. All rights reserved.