Interval.Bounded, Interval.Builder, Interval.UnboundedsweepLeftToRight, sweepRightToLeft| Constructor and Description |
|---|
DateInterval()
Instantiates an interval extending from positive infinity to negative
infinity and thus containing all Dates.
|
DateInterval(Date start,
Date end,
Interval.Bounded type)
Instantiates a new bounded interval.
|
DateInterval(Date value,
Interval.Unbounded type)
Instantiates a new unbounded interval - an interval that extends to positive or
negative infinity.
|
| Modifier and Type | Method and Description |
|---|---|
protected Interval<Date> |
create()
Used to create new instances of a specific
Interval subclass. |
Date |
getMidpoint()
Determines the center of the interval.
|
builder, compareSpecialization, contains, contains, create, equals, getEnd, getIntersection, getStart, hashCode, intersects, isEmpty, isEndInclusive, isLeftOf, isLeftOf, isLeftOf, isPoint, isRightOf, isRightOf, isRightOf, isStartInclusivepublic DateInterval()
public DateInterval(Date start, Date end, Interval.Bounded type)
start - The start date of the intervalend - The end date of the interval.type - Description of whether the interval is open/closed at one or both
of its ends. See the documentation of the Bounded enum
for more information on the different possibilities.public DateInterval(Date value, Interval.Unbounded type)
value - The bounding date for either the start or the end point.type - Describes whether the interval extends to positive or negative infinity,
as well as if it is open or closed at the bounding point. See the Unbounded enum for description of the different possibilities.protected Interval<Date> create()
IntervalInterval subclass.
The Interval class aims to avoid reflexion. On several occasions, however, the class
needs to create new instances of the Interval class. To be able to guarantee that they
will have the desired runtime type, the Interval.create() method of a specific reference object
is called.
Generally, the only thing you need to do in your implementation of this abstract method is to call the default constructor of your subclass and return the new interval.
public Date getMidpoint()
Similarly to the class IntegerInterval, it assumes that unbounded intervals
are bounded by Dates with timestamps Long.MIN_VALUE and/or Long.MAX_VALUE. The center
of an unbounded interval is computed accordingly.
getMidpoint in class Interval<Date>Copyright © 2016. All rights reserved.