org.geotools.util
Class DateRange

java.lang.Object
  extended by org.geotools.util.Range<java.util.Date>
      extended by org.geotools.util.DateRange
All Implemented Interfaces:
java.io.Serializable

public class DateRange
extends Range<java.util.Date>

A range of dates.

Since:
2.5
Version:
$Id: DateRange.java 30760 2008-06-18 14:28:24Z desruisseaux $
Author:
Martin Desruisseaux
See Also:
Serialized Form

Constructor Summary
DateRange(java.util.Date startTime, boolean isMinIncluded, java.util.Date endTime, boolean isMaxIncluded)
          Creates a new date range for the given dates.
DateRange(java.util.Date startTime, java.util.Date endTime)
          Creates a new date range for the given dates.
DateRange(MeasurementRange<?> range, java.util.Date origin)
          Creates a date range from the specified measurement range.
 
Method Summary
 java.util.Date getMaxValue()
          Returns the end time.
 java.util.Date getMinValue()
          Returns the start time.
 
Methods inherited from class org.geotools.util.Range
contains, contains, equals, getElementClass, hashCode, intersect, intersects, isEmpty, isMaxIncluded, isMinIncluded, subtract, toString, union
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DateRange

public DateRange(java.util.Date startTime,
                 java.util.Date endTime)
Creates a new date range for the given dates. Start time and end time are inclusive.

Parameters:
startTime - The start time (inclusive), or null if none.
endTime - The end time (inclusive), or null if none.

DateRange

public DateRange(java.util.Date startTime,
                 boolean isMinIncluded,
                 java.util.Date endTime,
                 boolean isMaxIncluded)
Creates a new date range for the given dates.

Parameters:
startTime - The start time, or null if none.
isMinIncluded - true if the start time is inclusive.
endTime - The end time, or null if none.
isMaxIncluded - true if the end time is inclusive.

DateRange

public DateRange(MeasurementRange<?> range,
                 java.util.Date origin)
          throws javax.measure.converter.ConversionException
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:
javax.measure.converter.ConversionException - if the given range doesn't have a unit compatible with milliseconds.
Method Detail

getMinValue

public java.util.Date getMinValue()
Returns the start time.

Overrides:
getMinValue in class Range<java.util.Date>
Returns:
The minimal value.
See Also:
Range.getMinValue()

getMaxValue

public java.util.Date getMaxValue()
Returns the end time.

Overrides:
getMaxValue in class Range<java.util.Date>
Returns:
The maximal value.
See Also:
Range.getMaxValue()


Copyright © 1996-2010 Geotools. All Rights Reserved.