Interface RelativeInterval

All Superinterfaces:
Cloneable, org.gvsig.tools.lang.Cloneable, Interval, Time

public interface RelativeInterval extends Interval, org.gvsig.tools.lang.Cloneable

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 Details

    • contains

      boolean contains(RelativeInstant instant)
      Does this time interval contain the specified instant. *
      Parameters:
      instant - the instant, null means now
      Returns:
      true if this time interval contains the instant
    • contains

      boolean contains(RelativeInterval interval)
      Does this time interval contain the specified interval. *
      Parameters:
      instant - the time interval to compare to, null means a zero duration interval now
      Returns:
      true if this time interval contains the interval
    • overlaps

      boolean overlaps(RelativeInterval interval)
      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:
      true if the time intervals overlap
    • isAfter

      boolean isAfter(RelativeInstant instant)
      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:
      true if this time interval is after the instant
    • isAfter

      boolean isAfter(RelativeInterval interval)
      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:
      true if this time interval is after the interval specified
    • isBefore

      boolean isBefore(RelativeInstant instant)
      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:
      true if this time interval is before the instant
    • isBefore

      boolean isBefore(RelativeInterval interval)
      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:
      true if 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.
      Specified by:
      getStart in interface Interval
      Returns:
      the start of the time interval
    • getEnd

      RelativeInstant getEnd()
      Gets the end of this time interval, which is exclusive, as an Instant.
      Specified by:
      getEnd in interface Interval
      Returns:
      the end of the time interval