com.nurelm.nucontent.model
Class RepeatItem.RepeatItemComparator
java.lang.Object
com.nurelm.nucontent.model.RepeatItem.RepeatItemComparator
- All Implemented Interfaces:
- java.util.Comparator, java.io.Serializable
- Enclosing class:
- RepeatItem
- public static class RepeatItem.RepeatItemComparator
- extends java.lang.Object
- implements java.util.Comparator, java.io.Serializable
This inner class, implementing the java.util.Comparator
class, is used by RepeatList to sort RepeatItem
objects.
Since sorting such objects is based on the sort's list of sort fields,
sort directions, and sort priorities (which field gets sorted first), a
custom Comparator was needed.
- See Also:
- Serialized Form
|
Constructor Summary |
RepeatItem.RepeatItemComparator(java.lang.String sortByIds,
java.lang.String sortByDirections)
Creates a new RepeatItemComparator with the specified sort
fields and sort directions. |
|
Method Summary |
int |
compare(java.lang.Object o1,
java.lang.Object o2)
Overrides Object's compare method. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.Comparator |
equals |
RepeatItem.RepeatItemComparator
public RepeatItem.RepeatItemComparator(java.lang.String sortByIds,
java.lang.String sortByDirections)
- Creates a new
RepeatItemComparator with the specified sort
fields and sort directions.
- Parameters:
sortByIds - A comma-separated list of Content object
contentIds by which to sort: contentId1,
contentId2, ... , contentIdn sortByDirections - A comma-separated list of directions specifiying
which way each corresponding item in the sortByIds
should be sorted. Each direction must be either "ascending" or
"descending".
compare
public int compare(java.lang.Object o1,
java.lang.Object o2)
- Overrides
Object's compare method.
- Specified by:
compare in interface java.util.Comparator
- Parameters:
o1 - First Content object to compare.o2 - Second Content object to compare.
- Returns:
- Integer representing comparison result. Works just like
java.lang.String's compare result.