Range

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

Represents a mathematical range. See wikipedia article of interval.

Parameters

range

adapted guava range class

Constructors

Link copied to clipboard
constructor(range: Range<T>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Difference between the upper and lower bound of the Range.

Link copied to clipboard

Absolute length between upper and lower bound.

Functions

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

Arranges an array of Double with step size.

Link copied to clipboard
operator fun contains(value: T): Boolean

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

Link copied to clipboard

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

Link copied to clipboard
infix fun encloses(other: Range<T>): Boolean

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

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

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

Link copied to clipboard
fun Range<Double>.fuzzyEncloses(other: Range<Double>, tolerance: Double): Boolean

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

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

Returns true, if this range has a lower endpoint.

Link copied to clipboard

Returns true, if this range has an upper endpoint.

Link copied to clipboard
fun intersection(connectedRange: Range<T>): Range<T>

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

Link copied to clipboard
fun isConnected(other: Range<T>): Boolean

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

Link copied to clipboard

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

Link copied to clipboard
Link copied to clipboard
fun join(connectedRange: Range<T>): Range<T>

Joins this and a connectedRange by building the span.

Link copied to clipboard

Returns the lower BoundType of this range.

Link copied to clipboard

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

Link copied to clipboard

Returns the lower endpoint as result.

Link copied to clipboard

Shifts the Range by a value.

Link copied to clipboard

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

Link copied to clipboard
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.

Link copied to clipboard
fun toRangeG(): Range<T>

Conversion to Guava range.

Link copied to clipboard

Conversion to RangeSet.

Link copied to clipboard
open override fun toString(): String

Conversion to String.

Link copied to clipboard

Returns the upper BoundType of this range.

Link copied to clipboard

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

Link copied to clipboard

Returns the upper endpoint as result.

Link copied to clipboard
fun Range<Double>.widened(wideningValue: Double): Range<Double>

Widens the Range by wideningValue on the lower and upper bound.

fun Range<Double>.widened(lowerWideningValue: Double, upperWideningValue: Double): Range<Double>

Widens the lower bound of the Range by lowerWideningValue and the upper bound of the Range by upperWideningValue.