Package org.geotools.util
Class DateRange
-
- All Implemented Interfaces:
Serializable
public class DateRange extends Range<Date>
A range of dates.- Since:
- 2.5
- Author:
- Martin Desruisseaux
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DateRange(Date startTime, boolean isMinIncluded, Date endTime, boolean isMaxIncluded)
Creates a new date range for the given dates.DateRange(Date startTime, Date endTime)
Creates a new date range for the given dates.DateRange(MeasurementRange<?> range, Date origin)
Creates a date range from the specified measurement range.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Date
getMaxValue()
Returns the end time.Date
getMinValue()
Returns the start time.-
Methods inherited from class Range
contains, contains, equals, getElementClass, hashCode, intersect, intersects, isEmpty, isMaxIncluded, isMinIncluded, subtract, toString, union
-
-
-
-
Constructor Detail
-
DateRange
public DateRange(Date startTime, Date endTime)
Creates a new date range for the given dates. Start time and end time are inclusive.- Parameters:
startTime
- The start time (inclusive), ornull
if none.endTime
- The end time (inclusive), ornull
if none.
-
DateRange
public DateRange(Date startTime, boolean isMinIncluded, Date endTime, boolean isMaxIncluded)
Creates a new date range for the given dates.- Parameters:
startTime
- The start time, ornull
if none.isMinIncluded
-true
if the start time is inclusive.endTime
- The end time, ornull
if none.isMaxIncluded
-true
if the end time is inclusive.
-
DateRange
public DateRange(MeasurementRange<?> range, Date origin)
Creates a date range from the specified measurement range. Units are converted as needed.- Parameters:
range
- The range to convert.origin
- The date to use as the origin.- Throws:
UnconvertibleException
- if the given range doesn't have a unit compatible with milliseconds.
-
-
Method Detail
-
getMinValue
public Date getMinValue()
Returns the start time.- Overrides:
getMinValue
in classRange<Date>
- Returns:
- The minimal value.
- See Also:
Range.getMinValue()
-
getMaxValue
public Date getMaxValue()
Returns the end time.- Overrides:
getMaxValue
in classRange<Date>
- Returns:
- The maximal value.
- See Also:
Range.getMaxValue()
-
-