Packages

c

o1.time

Interval

class Interval extends AnyRef

Each instance of the class Interval represents an interval --- an inclusive range --- on a time scale. An interval has a "start moment" and an "end moment", represented as Moment objects. An interval always contains at least a single moment.

An interval object may be used to represent a range of years, a range of months, etc., as desired

An Interval object is immutable after it has been created. That is, its state can not be changed in any way.

See also

Moment

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Interval
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new Interval(start: Moment, end: Moment)

    start

    the start of the interval (that is, the first moment included in the interval)

    end

    the end of the interval (that is, the last moment included in the interval); equal to or higher than start

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  6. def contains(another: Interval): Boolean

    Determines whether this interval contains the given interval.

    Determines whether this interval contains the given interval. This is the case if and only if all moments within the other interval are contained within this interval.

  7. def contains(moment: Moment): Boolean

    Determines whether the given moment is inside this interval.

    Determines whether the given moment is inside this interval. (An interval also includes its start and end moments.)

  8. val end: Moment
  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  11. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  12. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  13. def intersection(another: Interval): Option[Interval]

    Creates, and returns a reference to, a new Interval object that represents the intersection of this interval with the given interval.

    Creates, and returns a reference to, a new Interval object that represents the intersection of this interval with the given interval. That is, the starting moment of the new interval is the starting moment of one of the two original intervals, whichever is later. Similarly, the end moment of the new interval is the earlier of the two original end moments.

    However, this method only produces a new interval in case the two original intervals overlap. In that case, the new interval is wrapped inside a Some object. If no intersection exists, ̀ the method returns None instead.

    Examples: The intersection of the interval from 1995 to 2003 with the interval from 2000 to 2013 is a new interval from 2000 to 2003. The intersection of the interval from 2000 to 2001 with the interval from 1995 to 1997 does not exist.

    See also

    overlaps

    union

  14. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  15. def isLaterThan(another: Interval): Boolean

    Determines whether this interval is later than the given interval.

    Determines whether this interval is later than the given interval. This is only deemed to be the case if this entire interval comes after the given interval on the time scale. That is, no overlap is allowed.

  16. def isLaterThan(moment: Moment): Boolean

    Determines whether this interval is later than the given moment.

    Determines whether this interval is later than the given moment. This is only deemed to be the case if the entire interval comes after the given moment on the time scale.

  17. def length: Int

    Returns the length of the interval.

    Returns the length of the interval. For instance, if the interval represents the range of years from 2000 to 2013, returns 13. The length of an interval will always be at least 0 (which is the case if start equals end).

  18. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  20. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  21. def overlaps(another: Interval): Boolean

    Determines whether this interval overlaps (intersects) the given interval.

    Determines whether this interval overlaps (intersects) the given interval. This is the case if (and only if) one or more of the moments within the other interval are contained within this interval.

    Note: If one interval is entirely contained within the other, it counts as overlapping, as does the case where one interval ends exactly where the other one begins.

  22. val start: Moment
  23. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  24. def toString: String

    Returns a textual description of the interval.

    Returns a textual description of the interval. This is a string whose length depends on the length of the interval as follows.

    If the length of the interval is 0, returns a string containing just the single moment contained in the interval. E.g., the interval from 2013 to 2013 is represented by the string "2013".

    If the length of the interval is above 0 but no more than 50, returns a string consisting of the start moment and the end moment separated by a number of hyphens equal to the length of the interval. For instance, the interval from 2013 to 2014 is represented by the string "2013-2014" and the interval from 2000 to 2013 is represented by the string "2000-------------2013".

    If the length of the interval is more than 50, uses three dots instead of hyphens. For instance, the interval from 1900 to 2013 is represented by the string "1900...2013".

    Definition Classes
    Interval → AnyRef → Any
  25. def union(another: Interval): Interval

    Creates, and returns a reference to, a new Interval object that represents the union of this interval with the given interval.

    Creates, and returns a reference to, a new Interval object that represents the union of this interval with the given interval. That is, the starting moment of the new interval is the starting moment of one of the two original intervals, whichever is earlier. Similarly, the end moment of the new interval is the later of the two original end moments.

    The two original intervals may overlap, but are not required to do so.

    Examples: The union of the interval from 1995 to 2003 with the interval from 2000 to 2013 is a new interval from 1995 to 2013. The union of the interval from 2000 to 2001 with the interval from 1995 to 1997 is a new interval from 1995 to 2001.

  26. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  27. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  28. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated @deprecated
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from AnyRef

Inherited from Any

Ungrouped