java.lang.Object | |
↳ | org.joda.time.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.
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Restricted constructor.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Compare two objects against only the range of date time fields as
specified in the constructor.
| |||||||||||
Compares this comparator to another.
| |||||||||||
Returns a comparator that only considers date fields.
| |||||||||||
Returns a DateTimeComparator with a lower limit only.
| |||||||||||
Returns a DateTimeComparator the compares the entire date time value.
| |||||||||||
Returns a DateTimeComparator with a lower and upper limit.
| |||||||||||
Gets the field type that represents the lower limit of comparison.
| |||||||||||
Returns a comparator that only considers time fields.
| |||||||||||
Gets the field type that represents the upper limit of comparison.
| |||||||||||
Gets a suitable hashcode.
| |||||||||||
Gets a debugging string.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
java.util.Comparator
|
Restricted constructor.
lowerLimit | the lower field limit, null means no limit |
---|---|
upperLimit | the upper field limit, null means no limit |
Compare two objects against only the range of date time fields as specified in the constructor.
lhsObj | the first object, logically on the left of a < comparison, null means now |
---|---|
rhsObj | the second object, logically on the right of a < comparison, null means now |
IllegalArgumentException | if either argument is not supported |
---|
Compares this comparator to another.
object | the object to compare to |
---|
Returns a comparator that only considers date fields. Time of day is ignored.
Returns a DateTimeComparator with a lower limit only. Fields of a magnitude less than the lower limit are excluded from comparisons.
lowerLimit | inclusive lower limit for fields to be compared, null means no limit |
---|
Returns a DateTimeComparator the compares the entire date time value.
Returns a DateTimeComparator with a lower and upper limit. Fields of a magnitude less than the lower limit are excluded from comparisons. Fields of a magnitude greater than or equal to the upper limit are also excluded from comparisons. Either limit may be specified as null, which indicates an unbounded limit.
lowerLimit | inclusive lower limit for fields to be compared, null means no limit |
---|---|
upperLimit | exclusive upper limit for fields to be compared, null means no limit |
Gets the field type that represents the lower limit of comparison.
Returns a comparator that only considers time fields. Date is ignored.
Gets the field type that represents the upper limit of comparison.
Gets a suitable hashcode.