org.mmbase.util
Class XFileCompare

java.lang.Object
  |
  +--org.mmbase.util.XFileCompare
All Implemented Interfaces:
CompareInterface

public class XFileCompare
extends java.lang.Object
implements CompareInterface

Class to compare XFile object depending on their comparefield.

Version:
16 November 1998
Author:
David V van Zeventer
See Also:
SortedVector, CompareInterface, XFile

Constructor Summary
XFileCompare(java.lang.String compareField)
          Create a XFuileCompare.
 
Method Summary
 int compare(java.lang.Object thisOne, java.lang.Object other)
          Make the comparison.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XFileCompare

public XFileCompare(java.lang.String compareField)
Create a XFuileCompare.
Parameters:
compareField - Attribute to compare on ('filepath' or 'modtime')
Method Detail

compare

public int compare(java.lang.Object thisOne,
                   java.lang.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 2001