DocumentComparator Class
DEPRECATED
- public class DocumentComparator
extends Object
implements Comparator
A comparator which can sort DocumentMetadataDefs according to a list of
SortCriteria.
This will not be a fast comparator due to the nature of the objects it
supports. It is recommended to try to get the database to do as much
sorting as possible.
-
Hierarchy
-
Object
DocumentComparator
-
All Implemented Interfaces
-
Comparator
public int |
-
compare (Object obj1, Object obj2)
- Compare two DocumentMetadataDef objects according to the sort
criteria.
|
public String |
-
toString ()
- Get a string representation.
|
criteria
protected com.bea.p13n.content.expression.SortCriteria
criteria
- The SortCriteria this uses.
DocumentComparator
public DocumentComparator(SortCriteria
[] criteria)
- Constructor.
DocumentComparator
public DocumentComparator(String
sortBy)
- Constructor.
Related Topics
SortCriteria.getSortCriteria(String)
compare(Object, Object) Method
public int compare(Object
obj1,
Object
obj2)
throws ClassCastException
Compare two DocumentMetadataDef objects according to the sort
criteria.
Parameters
-
obj1
- the first object.
-
obj2
- the second object.
Returns
- -1 if obj1 less than obj2, 0 if equals, 1 if greater than.
Exceptions
-
ClassCastException
- thrown if either obj1 or obj2 is not a
DocumentMetadataDef.
toString() Method
public String
toString()
Get a string representation.
-
Overrides
-
Object.toString()