|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.joda.time.DateTimeComparator
public class DateTimeComparator
DateTimeComparator provides comparators to compare one date with another.
Dates may be specified using any object recognised by the
ConverterManager
class.
The default objects recognised by the comparator are:
DateTimeComparator is thread-safe and immutable.
Constructor Summary | |
---|---|
protected |
DateTimeComparator(DateTimeFieldType lowerLimit,
DateTimeFieldType upperLimit)
Restricted constructor. |
Method Summary | |
---|---|
int |
compare(Object lhsObj,
Object rhsObj)
Compare two objects against only the range of date time fields as specified in the constructor. |
boolean |
equals(Object object)
Compares this comparator to another. |
static DateTimeComparator |
getDateOnlyInstance()
Returns a comparator that only considers date fields. |
static DateTimeComparator |
getInstance()
Returns a DateTimeComparator the compares the entire date time value. |
static DateTimeComparator |
getInstance(DateTimeFieldType lowerLimit)
Returns a DateTimeComparator with a lower limit only. |
static DateTimeComparator |
getInstance(DateTimeFieldType lowerLimit,
DateTimeFieldType upperLimit)
Returns a DateTimeComparator with a lower and upper limit. |
DateTimeFieldType |
getLowerLimit()
Gets the field type that represents the lower limit of comparison. |
static DateTimeComparator |
getTimeOnlyInstance()
Returns a comparator that only considers time fields. |
DateTimeFieldType |
getUpperLimit()
Gets the field type that represents the upper limit of comparison. |
int |
hashCode()
Gets a suitable hashcode. |
String |
toString()
Gets a debugging string. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected DateTimeComparator(DateTimeFieldType lowerLimit, DateTimeFieldType upperLimit)
lowerLimit
- the lower field limit, null means no limitupperLimit
- the upper field limit, null means no limitMethod Detail |
---|
public static DateTimeComparator getInstance()
public static DateTimeComparator getInstance(DateTimeFieldType lowerLimit)
lowerLimit
- inclusive lower limit for fields to be compared, null means no limit
public static DateTimeComparator getInstance(DateTimeFieldType lowerLimit, DateTimeFieldType upperLimit)
lowerLimit
- inclusive lower limit for fields to be compared, null means no limitupperLimit
- exclusive upper limit for fields to be compared, null means no limit
public static DateTimeComparator getDateOnlyInstance()
public static DateTimeComparator getTimeOnlyInstance()
public DateTimeFieldType getLowerLimit()
public DateTimeFieldType getUpperLimit()
public int compare(Object lhsObj, Object rhsObj)
compare
in interface Comparator<Object>
lhsObj
- the first object,
logically on the left of a < comparison, null means nowrhsObj
- the second object,
logically on the right of a < comparison, null means now
IllegalArgumentException
- if either argument is not supportedpublic boolean equals(Object object)
equals
in interface Comparator<Object>
equals
in class Object
object
- the object to compare to
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |