Interval

A half-open or closed interval.

interface Interval<T>

Functions

contains
Link copied to clipboard
common

Checks if this interval contains value.

abstract operator fun contains(value: T): Boolean
equals
Link copied to clipboard
common
open operator override fun equals(other: Any?): Boolean
hasBoundedEnd
Link copied to clipboard
common

Checks if this interval's end is bounded, meaning it has a finite value.

open fun hasBoundedEnd(): Boolean
hasBoundedStart
Link copied to clipboard
common

Checks if this interval's start is bounded, meaning it has a finite value.

open fun hasBoundedStart(): Boolean
hashCode
Link copied to clipboard
common
open override fun hashCode(): Int
hasUnboundedEnd
Link copied to clipboard
common

Checks if this interval's end is unbounded. In ISO-8601 terminology, this is an "open" end.

abstract fun hasUnboundedEnd(): Boolean
hasUnboundedStart
Link copied to clipboard
common

Checks if this interval's start is unbounded. In ISO-8601 terminology, this is an "open" start.

abstract fun hasUnboundedStart(): Boolean
isBounded
Link copied to clipboard
common

Checks if both the start and end of this interval are bounded, meaning it has a finite range.

open fun isBounded(): Boolean
isEmpty
Link copied to clipboard
common

Checks if this interval is empty.

abstract fun isEmpty(): Boolean
isUnbounded
Link copied to clipboard
common

Checks if both the start and end of this interval are unbounded, meaning this is an infinite time period in both directions.

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

Properties

endExclusive
Link copied to clipboard
common

The end of this interval, exclusive.

abstract val endExclusive: T
endInclusive
Link copied to clipboard
common

The end of this interval, inclusive.

abstract val endInclusive: T
start
Link copied to clipboard
common

The start of this interval, inclusive.

abstract val start: T

Inheritors

DateRange
Link copied to clipboard
common
DateTimeInterval
Link copied to clipboard
common
TimePointInterval
Link copied to clipboard
common

Extensions

contains
Link copied to clipboard
common

Checks if this interval contains value.

This will always return false if value is null.

fun <T> Interval<T>.contains(value: T?): Boolean