Companion

object Companion

Functions

Link copied to clipboard
fun <T : Comparable<*>> all(): Range<T>

Creates a Range that contains every value in T.

Link copied to clipboard
fun <T : Comparable<*>> atLeast(endpoint: T): Range<T>

Creates a Range of the form [endpoint, ∞).

Link copied to clipboard
fun <T : Comparable<*>> atMost(endpoint: T): Range<T>

Creates a Range of the form (-∞, endpoint].

Link copied to clipboard
fun <T : Comparable<*>> closed(lower: T, upper: T): Range<T>

Creates a Range of the form [lower, upper].

Link copied to clipboard
fun <T : Comparable<*>> closedOpen(lower: T, upper: T): Range<T>

Creates a Range of the form [lower, upper).

Link copied to clipboard
fun <T : Comparable<*>> closedX(lower: T, upper: T, upperBoundType: BoundType): Range<T>

Creates a Range of the form [lower, upper] or [lower, upper) depending on the upperBoundType.

Link copied to clipboard
fun <T : Comparable<*>> downTo(endpoint: T, boundType: BoundType): Range<T>

Creates a Range of the form [endpoint, ∞) or (endpoint, ∞) depending on the boundType.

Link copied to clipboard
fun <T : Comparable<*>> greaterThan(endpoint: T): Range<T>

Creates a Range of the form (endpoint, ∞).

Link copied to clipboard
fun <T : Comparable<*>> lessThan(endpoint: T): Range<T>

Creates a Range of the form (-∞, endpoint).

Link copied to clipboard
fun <T : Comparable<*>> open(lower: T, upper: T): Range<T>

Creates a Range of the form (lower, upper).

Link copied to clipboard
fun <T : Comparable<*>> openClosed(lower: T, upper: T): Range<T>

Creates a Range of the form (lower, upper].

Link copied to clipboard
fun <T : Comparable<*>> range(lowerBoundType: BoundType, lowerEndpoint: T, upperBoundType: BoundType, upperEndpoint: T): Range<T>

Creates a Range.

Link copied to clipboard
fun <T : Comparable<*>> rangeOfNullable(lowerBoundType: BoundType, lowerEndpoint: T?, upperBoundType: BoundType, upperEndpoint: T?): Range<T>

Creates a Range based on bound type and endpoint values. If bound type is BoundType.NONE the respective endpoint value must be null for consistency reasons.

Link copied to clipboard
fun <T : Comparable<*>> upTo(endpoint: T, boundType: BoundType): Range<T>

Creates a Range of the form (-∞, endpoint) or (-∞, endpoint] depending on the boundType.