org.mmbase.util
Class XFileCompare

java.lang.Object
  extended by org.mmbase.util.XFileCompare
All Implemented Interfaces:
CompareInterface

public class XFileCompare
extends Object
implements CompareInterface

Class to compare XFile object depending on their comparefield.

Version:
$Id: XFileCompare.java 35335 2009-05-21 08:14:41Z michiel $
Author:
David V van Zeventer
See Also:
SortedVector, CompareInterface, XFile
To Do:
Should implement java.util.Comparator, perhaps be named 'FileComparator'.
Application:
SCAN or Devices

Field Summary
(package private)  String compareField
          Attribute to compare on ('filepath' or 'modtime')
 
Constructor Summary
XFileCompare(String compareField)
          Create a XFuileCompare.
 
Method Summary
 int compare(Object thisOne, Object other)
          Make the comparison.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

compareField

String compareField
Attribute to compare on ('filepath' or 'modtime')

Constructor Detail

XFileCompare

public XFileCompare(String compareField)
Create a XFuileCompare.

Parameters:
compareField - Attribute to compare on ('filepath' or 'modtime')
Method Detail

compare

public int compare(Object thisOne,
                   Object other)
Make the comparison. The result is a negative value if the comparefield of the first file is 'smaller' than the second, a positive value if it is 'larger', and 0 if they are 'equal'.

Specified by:
compare in interface CompareInterface
Parameters:
thisOne - the first object to compare. should be a XFile.
other - the second object to compare. should be a XFile.
Returns:
the result of the comparison


MMBase 2.0-SNAPSHOT - null