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.
- Alphabetic
- By Inheritance
- Interval
- Serializable
- Serializable
- Product
- Equals
- Ordered
- Comparable
- Function1
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
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
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
<(that: Interval[T]): Boolean
- Definition Classes
- Ordered
-
def
<=(that: Interval[T]): Boolean
- Definition Classes
- Ordered
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
>(that: Interval[T]): Boolean
- Definition Classes
- Ordered
-
def
>=(that: Interval[T]): Boolean
- Definition Classes
- Ordered
-
def
andThen[A](g: (Boolean) ⇒ A): (T) ⇒ A
- Definition Classes
- Function1
- Annotations
- @unspecialized()
-
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
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
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
-
def
compareTo(that: Interval[T]): Int
- Definition Classes
- Ordered → Comparable
-
def
compose[A](g: (A) ⇒ T): (A) ⇒ Boolean
- Definition Classes
- Function1
- Annotations
- @unspecialized()
-
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.
-
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.
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
greater: Option[Interval[T]]
Returns an interval which encompasses all values greater than this interval, if such an interval exists.
-
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. -
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
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isPoint: Boolean
Tests if this interval encloses only a single discrete point.
-
def
lesser: Option[Interval[T]]
Returns an interval which encompasses all values less than this interval, if such an interval exists.
- val lower: GreaterRay[T]
-
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.
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
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.
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
point: Option[T]
Returns the discrete value enclosed by this interval, if it is a point.
-
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.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
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.
-
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.
-
def
toString(): String
- Definition Classes
- Interval → Function1 → AnyRef → Any
-
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.
-
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.
- val upper: LesserRay[T]
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )