Package thredds.client.catalog
Class TimeCoverage
- java.lang.Object
-
- thredds.client.catalog.TimeCoverage
-
@Immutable public class TimeCoverage extends Object
A range of dates, using DateType start/end, and/or a TimeDuration. You can use a DateType = "present" and a time duration to specify "real time" intervals, eg "last 3 days" uses endDate = "present" and duration = "3 days".- a start date and end date
- a start date and duration
- an end date and duration
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TimeCoverage.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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(TimeCoverage dr)
Extend this TimeCoverage by the given one.TimeCoverage
extend(CalendarDate date)
Extend this TimeCoverage by the given date.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 intervalDateType
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 TimeCoverageboolean
intersects(TimeCoverage other)
Determine if the given range intersects this TimeCoverage.boolean
intersects(CalendarDate start_want, CalendarDate end_want)
Determine if the given range intersects this TimeCoverage.boolean
isEmpty()
If the range is emptyboolean
isPoint()
Return true if start date equals end date, so date range is a point.TimeCoverage.Builder
toBuilder()
String
toString()
-
-
-
Method Detail
-
contains
public boolean contains(CalendarDate date)
Determine if the given date is contained in this date range. The date range includes the start and end dates.- Parameters:
date
- the gicen date- Returns:
- true if date in inside this range
-
intersects
public boolean intersects(CalendarDate start_want, CalendarDate end_want)
Determine if the given range intersects this TimeCoverage.- Parameters:
start_want
- range starts hereend_want
- range ends here- Returns:
- true if ranges intersect
-
intersects
public boolean intersects(TimeCoverage other)
Determine if the given range intersects this TimeCoverage.- Parameters:
other
- date range- Returns:
- true if ranges intersect
-
intersect
public TimeCoverage intersect(TimeCoverage clip)
Intersect with another TimeCoverage- Parameters:
clip
- intersect with this date range- Returns:
- new TimeCoverage that is the intersection
-
extend
public TimeCoverage extend(TimeCoverage dr)
Extend this TimeCoverage by the given one.- Returns:
- new TimeCoverage that is extended if needed.
-
extend
public TimeCoverage extend(CalendarDate date)
Extend this TimeCoverage by the given date.- Returns:
- new TimeCoverage that is extended if needed.
-
getStart
public DateType getStart()
Get the starting Date.
-
getEnd
public DateType getEnd()
Get the ending Date.
-
getDuration
public TimeDuration getDuration()
Get the duration of the interval
-
getResolution
public TimeDuration getResolution()
Get the time resolution.
-
fixedStart
public boolean fixedStart()
Get if the start is fixed.
-
fixedEnd
public boolean fixedEnd()
Get if the end is fixed.
-
fixedDuration
public boolean fixedDuration()
Get if the duration is fixed.
-
fixedResolution
public boolean fixedResolution()
Get if the resolution is set.
-
isPoint
public boolean isPoint()
Return true if start date equals end date, so date range is a point.
-
isEmpty
public boolean isEmpty()
If the range is empty
-
create
public static TimeCoverage create(@Nullable DateType start, @Nullable DateType end, @Nullable TimeDuration duration, @Nullable TimeDuration resolution)
Encapsulates a range of dates, using DateType start/end, and/or a TimeDuration. A DateRange can be specified in any of the following ways:- a start date and end date
- a start date and duration
- an end date and duration
- Parameters:
start
- starting date; may be nullend
- ending date; may be nullduration
- time duration; may be nullresolution
- time resolution; may be null
-
builder
public static TimeCoverage.Builder builder(@Nullable DateType start, @Nullable DateType end, @Nullable TimeDuration duration, @Nullable TimeDuration resolution)
-
toBuilder
public TimeCoverage.Builder toBuilder()
-
-