# Range

class Range<T : Comparable<*>>(range: Range<T>)

Represents a mathematical range. See wikipedia article of interval.

range

## Constructors

constructor(range: Range<T>)

object Companion

## Properties

Difference between the upper and lower bound of the Range.

Absolute length between upper and lower bound.

## Functions

fun Range<Double>.arrange(step: Double, includeClosedEndPoint: Boolean = false, tolerance: Double): DoubleArray

Arranges an array of Double with step size.

operator fun contains(value: T): Boolean

Returns true, if the value is within this Range bounds.

Returns Either.Right, if the value is contained within this Range.

infix fun encloses(other: Range<T>): Boolean

Returns true, if the bounds of the other range do not extend the bounds of this range.

open operator override fun equals(other: Any?): Boolean
fun Range<Double>.fuzzyContains(value: Double, tolerance: Double): Boolean

Returns true, if the value is fuzzily contained within this Range by the tolerance.

fun Range<Double>.fuzzyEncloses(other: Range<Double>, tolerance: Double): Boolean

Returns true, if the other is fuzzily enclosed with a tolerance.

open override fun hashCode(): Int

Returns true, if this range has a lower endpoint.

Returns true, if this range has an upper endpoint.

fun intersection(connectedRange: Range<T>): Range<T>

Returns the intersecting range of this range with the other connectedRange.

fun isConnected(other: Range<T>): Boolean

Returns true, if there exists a (possibly empty) range which is enclosed by both this range and other.

Returns true, if this range has the form v..v) or (v..v.

fun join(connectedRange: Range<T>): Range<T>

Joins this and a connectedRange by building the span.

Returns the lower BoundType of this range.

Returns the lower endpoint, if this range has one; otherwise null is returned.

Returns the lower endpoint as result.

Shifts the Range by a value.

Shift the Range so that the lower endpoint is represented by the value.

fun span(other: Range<T>): Range<T>

Returns the minimal range that encloses this and the other range. For example, the span of [1, 3) and 5, 7 is 1, 7.

fun toRangeG(): Range<T>

Conversion to Guava range.

Conversion to RangeSet.

open override fun toString(): String

Conversion to String.

Returns the upper BoundType of this range.

Returns the upper endpoint, if this range has one; otherwise null is returned.