Skip to content

Recognized/kotlin-ranges-union

Repository files navigation

kotlin-ranges-union

Kotlin ranges union library

Overview

This library provides IntRangeUnion and LongRangeUnion classes, which represent a mutable set of closed ranges of corresponding type.

Example:

val set = IntRangeUnion()
set.union(0..10)    \\ {[0, 10]}
set.union(20..30)   \\ {[0, 30]}
set.exclude(15..17) \\ {[0, 14], [18, 30]}

Install

Using gradle:

repositories {
    maven { url "https://jitpack.io" }
}

dependencies {
    implementation "com.github.Recognized:kotlin-ranges-union:v1.01"
}