@Immutable public class TimeCoverage extends Object
A DateRange can be specified in any of the following ways:
| Modifier and Type | Class and Description |
|---|---|
static class |
TimeCoverage.Builder |
| Modifier and Type | Method and Description |
|---|---|
static TimeCoverage.Builder |
builder(DateType start,
DateType end,
TimeDuration duration,
TimeDuration resolution) |
boolean |
contains(CalendarDate date)
Determine if the given date is contained in this date range.
|
static TimeCoverage |
create(DateType start,
DateType end,
TimeDuration duration,
TimeDuration resolution)
Encapsulates a range of dates, using DateType start/end, and/or a TimeDuration.
|
boolean |
equals(Object o) |
TimeCoverage |
extend(CalendarDate date)
Extend this TimeCoverage by the given date.
|
TimeCoverage |
extend(TimeCoverage dr)
Extend this TimeCoverage by the given one.
|
boolean |
fixedDuration()
Get if the duration is fixed.
|
boolean |
fixedEnd()
Get if the end is fixed.
|
boolean |
fixedResolution()
Get if the resolution is set.
|
boolean |
fixedStart()
Get if the start is fixed.
|
TimeDuration |
getDuration()
Get the duration of the interval
|
DateType |
getEnd()
Get the ending Date.
|
TimeDuration |
getResolution()
Get the time resolution.
|
DateType |
getStart()
Get the starting Date.
|
int |
hashCode() |
TimeCoverage |
intersect(TimeCoverage clip)
Intersect with another TimeCoverage
|
boolean |
intersects(CalendarDate start_want,
CalendarDate end_want)
Determine if the given range intersects this TimeCoverage.
|
boolean |
intersects(TimeCoverage other)
Determine if the given range intersects this TimeCoverage.
|
boolean |
isEmpty()
If the range is empty
|
boolean |
isPoint()
Return true if start date equals end date, so date range is a point.
|
String |
toString() |
public boolean contains(CalendarDate date)
date - the gicen datepublic boolean intersects(CalendarDate start_want, CalendarDate end_want)
start_want - range starts hereend_want - range ends herepublic boolean intersects(TimeCoverage other)
other - date rangepublic TimeCoverage intersect(TimeCoverage clip)
clip - intersect with this date rangepublic TimeCoverage extend(TimeCoverage dr)
public TimeCoverage extend(CalendarDate date)
public DateType getStart()
public DateType getEnd()
public TimeDuration getDuration()
public TimeDuration getResolution()
public boolean fixedStart()
public boolean fixedEnd()
public boolean fixedDuration()
public boolean fixedResolution()
public boolean isPoint()
public boolean isEmpty()
public static TimeCoverage create(@Nullable DateType start, @Nullable DateType end, @Nullable TimeDuration duration, @Nullable TimeDuration resolution)
start - starting date; may be nullend - ending date; may be nullduration - time duration; may be nullresolution - time resolution; may be nullpublic static TimeCoverage.Builder builder(@Nullable DateType start, @Nullable DateType end, @Nullable TimeDuration duration, @Nullable TimeDuration resolution)