Packages

final case class Interval[T](lower: GreaterRay[T], upper: LesserRay[T])(implicit conv: (T) ⇒ Ordered[T]) extends (T) ⇒ Boolean with Ordered[Interval[T]] with Product with Serializable

A non-empty bounded interval over a continuous, infinite, total-ordered set of values. An interval contains all values between its lower and upper bound. The lower and/or upper bound may be unbounded. Any operation which could potentially return an empty interval returns an Option type instead.

T

type of values contained in the continuous, infinite, total-ordered set which the interval operates on.

lower

bounding ray of interval. Must point in the Greater direction.

upper

bounding ray of interval. Must point in the Lesser direction.

Linear Supertypes
Serializable, Serializable, Product, Equals, Ordered[Interval[T]], Comparable[Interval[T]], (T) ⇒ Boolean, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Interval
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. Ordered
  7. Comparable
  8. Function1
  9. AnyRef
  10. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Interval(lower: GreaterRay[T], upper: LesserRay[T])(implicit conv: (T) ⇒ Ordered[T])

    lower

    bounding ray of interval. Must point in the Greater direction.

    upper

    bounding ray of interval. Must point in the Lesser direction.

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def <(that: Interval[T]): Boolean
    Definition Classes
    Ordered
  4. def <=(that: Interval[T]): Boolean
    Definition Classes
    Ordered
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. def >(that: Interval[T]): Boolean
    Definition Classes
    Ordered
  7. def >=(that: Interval[T]): Boolean
    Definition Classes
    Ordered
  8. def andThen[A](g: (Boolean) ⇒ A): (T) ⇒ A
    Definition Classes
    Function1
    Annotations
    @unspecialized()
  9. def apply(point: T): Boolean

    Tests if this interval contains the specified point.

    Tests if this interval contains the specified point.

    Definition Classes
    Interval → Function1
  10. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  11. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  12. def compare(other: Interval[T]): Int

    Intervals are compared first by their upper rays, and then by their lower rays.

    Intervals are compared first by their upper rays, and then by their lower rays.

    Definition Classes
    Interval → Ordered
  13. def compareTo(that: Interval[T]): Int
    Definition Classes
    Ordered → Comparable
  14. def compose[A](g: (A) ⇒ T): (A) ⇒ Boolean
    Definition Classes
    Function1
    Annotations
    @unspecialized()
  15. def difference(other: Interval[T]): Set[Interval[T]]

    Returns the difference between this interval and the other.

    Returns the difference between this interval and the other. The set may contain 0, 1, or 2 resulting intervals.

  16. def encloses(other: Interval[T]): Boolean

    Tests if this interval encloses the other.

    Tests if this interval encloses the other. An interval encloses another if it contains all points contained by the other. The union of an interval with an enclosed interval is the enclosing interval. The intersection of an interval with an enclosed interval is the enclosed interval. No interval encloses the empty interval.

  17. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  20. def greater: Option[Interval[T]]

    Returns an interval which encompasses all values greater than this interval, if such an interval exists.

  21. def intersect(other: Interval[T]): Option[Interval[T]]

    Returns the intersection of this interval and the other, or None if the intersection does not exist.

  22. def intersects(other: Interval[T]): Boolean

    Tests if this interval intersects the other.

    Tests if this interval intersects the other. Intervals intersect if they share any points in common. Said another way, intervals intersect if they overlap.

    a0 <= b1 && b0 <= a1

  23. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  24. def isPoint: Boolean

    Tests if this interval encloses only a single discrete point.

  25. def lesser: Option[Interval[T]]

    Returns an interval which encompasses all values less than this interval, if such an interval exists.

  26. val lower: GreaterRay[T]
  27. def map[U](f: (T) ⇒ U)(implicit conv: (U) ⇒ Ordered[U]): Interval[U]

    Transform the bounds of this interval to create a new Interval.

    Transform the bounds of this interval to create a new Interval. The resulting interval must be valid, i.e., the transformation must keep the relative order of the bounds.

  28. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  29. def normalize(implicit discrete: Discrete[T]): (Option[T], Option[T])

    Returns a normalized form of this Interval, if possible.

    Returns a normalized form of this Interval, if possible. The lower bound of a normalized interval is Closed and the upper bound of a normalized interval is Open. If this interval is unbounded in some direction, then the corresponding normalized bound will be None.

  30. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  31. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  32. def point: Option[T]

    Returns the discrete value enclosed by this interval, if it is a point.

  33. def span(other: Interval[T]): Interval[T]

    Returns the minimum spanning interval of this interval and the other interval.

    Returns the minimum spanning interval of this interval and the other interval. An interval spans a pair of intervals if it encloses both. The span of an interval with the empty interval is the empty interval.

  34. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  35. def tangents(other: Interval[T]): Boolean

    Tests if this interval is tangent to the other.

    Tests if this interval is tangent to the other. Intervals are tangent if they do not contain any points in common, but the span of the intervals does not contain any points not in one of the intersections.

  36. def toRange(implicit num: Numeric[T]): Range

    Converts this interval to a scala.collection.immutable.Range, if possible.

    Converts this interval to a scala.collection.immutable.Range, if possible.

    Exceptions thrown

    IllegalArgumentException if the resulting range would contain more than scala.Int.MaxValue elements.

  37. def toString(): String
    Definition Classes
    Interval → Function1 → AnyRef → Any
  38. def union(other: Interval[T]): Option[Interval[T]]

    Returns the union of this interval and the other.

    Returns the union of this interval and the other. If the intervals do not union, the empty interval is returned. The union of an interval with the empty interval is the empty interval.

  39. def unions(other: Interval[T]): Boolean

    Tests if this interval unions the other.

    Tests if this interval unions the other. Intervals union if all the points contained by their span are contained by one of the intervals. Said another way, intervals union if they overlap or are tangent.

  40. val upper: LesserRay[T]
  41. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  42. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  43. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Ordered[Interval[T]]

Inherited from Comparable[Interval[T]]

Inherited from (T) ⇒ Boolean

Inherited from AnyRef

Inherited from Any

Ungrouped