ContentComparator Class
DEPRECATED
- public class ContentComparator
extends Object
implements Comparator
A comparator which can sort Content objects.
This will not be very fast since the comparision is done in Java. Try to
do sorting in the database.
-
Hierarchy
-
Object
ContentComparator
-
All Implemented Interfaces
-
Comparator
criteria
protected com.bea.p13n.content.expression.SortCriteria
criteria
- The SortCriteria this uses.
ContentComparator
public ContentComparator(SortCriteria
[] criteria)
- Constructor.
ContentComparator
public ContentComparator(String
sortBy)
- Constructor.
Related Topics
SortCriteria.getSortCriteria(String)
compare(Object, Object) Method
public int compare(Object
obj1,
Object
obj2)
throws ClassCastException
Compare two Content objects based upon the sorting 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
Content.
toString() Method
public String
toString()
Get a string representation.
-
Overrides
-
Object.toString()