RangeSet

class RangeSet<T : Comparable<*>>(rangeSet: ImmutableRangeSet<T>)

An immutable set of ranges.

Parameters

rangeSet

adapted Guava class

Constructors

Link copied to clipboard
constructor(ranges: Set<Range<T>>)
constructor(rangeSet: ImmutableRangeSet<T>)

Types

Link copied to clipboard
object Companion

Functions

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

Returns all ranges individually.

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

Returns true, if the value is within the RangeSet.

Link copied to clipboard
fun difference(other: RangeSet<T>): RangeSet<T>

Returns a new RangeSet consisting of the difference of this range set and the other.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

Returns the intersecting RangeSet of this range with the other.

Link copied to clipboard
fun intersects(otherRangeSet: RangeSet<T>): Boolean

Returns true, if this RangeSet intersects with the otherRangeSet.

fun intersects(otherRange: Range<T>): Boolean

Returns true, if this RangeSet intersects with the otherRange.

Link copied to clipboard

Returns the number of disconnected intervals of this RangeSet.

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

Returns the minimal range that encloses the range set.

Link copied to clipboard
fun toRangeSetG(): ImmutableRangeSet<T>

Conversion to Guava range set class.

Link copied to clipboard
fun union(other: RangeSet<T>): RangeSet<T>

Union operation of this RangeSet and the other.