Package com.jidesoft.comparator
Class CalendarComparator
java.lang.Object
com.jidesoft.comparator.CalendarComparator
- All Implemented Interfaces:
Comparator<Object>
Comparator for Calendar type. This is a singleton class. Call getInstance() to
get the comparator.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintCompares two Calendars.static CalendarComparatorReturns CalendarComparator singleton.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
CalendarComparator
protected CalendarComparator()Constructor. Has protected access to prevent other clients creating instances of the class ... it is stateless so we need only one instance.
-
-
Method Details
-
getInstance
Returns CalendarComparator singleton.- Returns:
- an instance of CalendarComparator.
-
compare
Compares two Calendars.- Specified by:
comparein interfaceComparator<Object>- Parameters:
o1- the first object to be comparedo2- the second object to be compared- Returns:
- 0 if a and b are equal, -1 if a is before b, 1 if a is after b.
-