Skip to content

//core/io.islandtime.ranges/Interval

Interval

interface Interval<T>

A half-open or closed interval.

Inheritors

DateRange
DateTimeInterval
TimePointInterval

Properties

Name Summary
endExclusive

common


abstract val endExclusive: T

The end of this interval, exclusive.
endInclusive

common


abstract val endInclusive: T

The end of this interval, inclusive.
start

common


abstract val start: T

The start of this interval, inclusive.

Functions

Name Summary
contains

common


abstract operator fun contains(value: T): Boolean

Checks if this interval contains value.
contains

common


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

Checks if this interval contains value.
hasBoundedEnd

common


open fun hasBoundedEnd(): Boolean

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

common


open fun hasBoundedStart(): Boolean

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

common


abstract fun hasUnboundedEnd(): Boolean

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

common


abstract fun hasUnboundedStart(): Boolean

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

common


open fun isBounded(): Boolean

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

common


abstract fun isEmpty(): Boolean

Checks if this interval is empty.
isUnbounded

common


open fun isUnbounded(): Boolean

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