org.mmbase.util
Class XFileCompare
java.lang.Object
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') |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
compareField
String compareField
- Attribute to compare on ('filepath' or 'modtime')
XFileCompare
public XFileCompare(String compareField)
- Create a XFuileCompare.
- Parameters:
compareField - Attribute to compare on ('filepath' or 'modtime')
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