Package org.gvsig.timesupport
Interface RelativeInterval
A RelativeInterval is defined like an interval between two RelativeInstants.
A huge part of the documentation of this class has been retrieved from the joda-time library.
- Version:
- $Id$
- Author:
- gvSIG team
-
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(RelativeInstant instant) Does this time interval contain the specified instantbooleancontains(RelativeInterval interval) Does this time interval contain the specified intervalgetEnd()Gets the end of this time interval, which is exclusive, as an Instant.getStart()Gets the start of this time interval, which is inclusive, as an Instant.booleanisAfter(RelativeInstant instant) Is this time interval after the specified instant.booleanisAfter(RelativeInterval interval) Is this time interval entirely after the specified interval.booleanisBefore(RelativeInstant instant) Is this time interval before the specified instant.booleanisBefore(RelativeInterval interval) Is this time interval entirely before the specified interval.booleanoverlaps(RelativeInterval interval) Does this time interval overlap the specified time interval.Gets the duration of this time interval.longGets the duration of this time interval in milliseconds.Methods inherited from interface org.gvsig.tools.lang.Cloneable
cloneMethods inherited from interface org.gvsig.timesupport.Interval
contains, toStandardDurationMethods inherited from interface org.gvsig.timesupport.Time
getChronology, intersects, isAbsolute, isInstant, isInterval, isRelative
-
Method Details
-
contains
Does this time interval contain the specified instant. *- Parameters:
instant- the instant, null means now- Returns:
trueif this time interval contains the instant
-
contains
Does this time interval contain the specified interval. *- Parameters:
instant- the time interval to compare to, null means a zero duration interval now- Returns:
trueif this time interval contains the interval
-
overlaps
Does this time interval overlap the specified time interval.- Parameters:
interval- the time interval to compare to, null means a zero length interval now- Returns:
trueif the time intervals overlap
-
isAfter
Is this time interval after the specified instant. Intervals are inclusive of the start instant and exclusive of the end.- Parameters:
instant- the instant to compare to, null means now- Returns:
trueif this time interval is after the instant
-
isAfter
Is this time interval entirely after the specified interval. Intervals are inclusive of the start instant and exclusive of the end. Only the end time of the specified interval is used in the comparison.- Parameters:
interval- the interval to compare to, null means now- Returns:
trueif this time interval is after the interval specified
-
isBefore
Is this time interval before the specified instant. Intervals are inclusive of the start instant and exclusive of the end.- Parameters:
instant- the instant to compare to, null means now- Returns:
trueif this time interval is before the instant
-
isBefore
Is this time interval entirely before the specified interval. Intervals are inclusive of the start instant and exclusive of the end. Only the end time of the specified interval is used in the comparison.- Parameters:
interval- the interval to compare to, null means now- Returns:
trueif this time interval is before the interval specified
-
toDuration
Duration toDuration()Gets the duration of this time interval.- Returns:
- the duration of the time interval
-
toDurationMillis
long toDurationMillis()Gets the duration of this time interval in milliseconds. The duration is equal to the end millis minus the start millis.- Returns:
- the duration of the time interval in milliseconds
-
getStart
RelativeInstant getStart()Gets the start of this time interval, which is inclusive, as an Instant. -
getEnd
RelativeInstant getEnd()Gets the end of this time interval, which is exclusive, as an Instant.
-