Skip to content

Releases: Whathecode/kotlinx.interval

2.2.0

19 Feb 23:24
4184d1e

Choose a tag to compare

InstantInterval has been added to the main library, and removed from kotlinx-interval-datetime. This is in line with Instant which was moved over from kotlinx.datetime to the standard library since Kotlin 2.1.20.

This makes this release a breaking change for kotlinx-interval-datetime, but not for kotlinx-interval. For simplicity, I kept the versions aligned.

If you were using kotlinx-interval-datetime before, the only change is the namespace: InstantInterval now lives side-by-side with all the other intervals, i.e., io.github.whathecode.kotlinx.interval. But, I did add a type alias which should provide compile time backwards compatibility in Kotlin.

Dependency updates:

  • Kotlin 2.3.10
  • kotlinx.datetime 0.7.1

2.1.0

30 May 15:45

Choose a tag to compare

Additions to Interval:

  • getPercentageFor() retrieves the percentage how far within (0.0-1.0) or outside (< 0.0, > 1.0) of the interval a value lies. In combination with the previously added getValueAt(), this supports quick type safe linear interpolation.

Dependency updates:

  • Kotlin 2.1.21
  • kotlinx.datetime 0.6.2

2.0.0

27 May 19:31

Choose a tag to compare

Additions to IntervalUnion and Interval:

  • shift() offsets an interval by a specified amount (also as shl and shr operators).

Additions to Interval:

  • getValueAt() retrieves a value at a given percentage within (0.0–1.0) or outside (< 0.0, > 1.0) of the interval.

Bugfixes:

Additions to type operations used by interval, and thus a breaking change for extending libraries:

  • IntervalTypeOperations.unsafeValueAt()
  • IntervalTypeOperations.unsafeShift()
  • TypeOperations.fromDouble() and toDouble()

Dependency updates:

  • Kotlin 2.1.20
  • kotlinx.datetime 0.6.1

1.0.1

02 Sep 22:28
fb0522a

Choose a tag to compare

Bugfix:

  • Subtracting a reversed interval which lies at the end of an interval with a shared endpoint, but differing endpoint inclusion, would be incorrect.

1.0.0

07 Aug 10:05

Choose a tag to compare

This marks the first release with a consistent API to perform operations on intervals, and chain such operations. All Interval operations which were also relevant for IntervalUnion have been moved to this base interface.

New to both IntervalUnion and Interval:

  • toString
  • setEquals

Moved to IntervalUnion (and still supported on Interval):

  • plus, minus
  • contains
  • intersects

Additions to Interval:

  • canonicalize

Dependency updates:

  • Kotlin 2.0.0
  • kotlinx-datetime 0.6.0

1.0.0-alpha.5

21 Apr 18:29
98b4a18

Choose a tag to compare

1.0.0-alpha.5 Pre-release
Pre-release

Additions to Interval:

  • minus and plus operations.
  • lowerBound, upperBound, isLowerBoundIncluded, and isUpperBoundIncluded accessors, preventing you from having to repeatedly check isReversed.
  • Interval now implements IntervalUnion, as a union with a single interval.

Additions to IntervalUnion:

  • isEmpty
  • getBounds to get upper and lower bounds of the set.

Dependency updates:

  • Kotlin 1.9.23
  • kotlinx-datetime 0.5.0

1.0.0-alpha.4

09 Oct 18:41
43c2b3d

Choose a tag to compare

1.0.0-alpha.4 Pre-release
Pre-release
  • Added an initial contract definition for IntervalUnion (a collection of intervals) and preliminary concrete MutableIntervalUnion which lives up to the contract by restricting which intervals can be added.
  • Added Interval.reverse and nonReversed.
  • Added Interval.intersects to check whether one interval intersects with another.

1.0.0-alpha.3

02 Aug 10:56
59c50b2

Choose a tag to compare

1.0.0-alpha.3 Pre-release
Pre-release

Introduced date/time intervals as InstantInterval using the kotlinx datetime library, published as a separate artifact under the same namespace: kotlinx-interval-datetime.

1.0.0-alpha.2

24 May 22:06
52f99d9

Choose a tag to compare

1.0.0-alpha.2 Pre-release
Pre-release
  • Added Interval.contains (in) operator to check whether values lie in an interval.
  • Added interval constructor functions so that all interval types can be constructed using the same keyword.

1.0.0-alpha.1

22 May 22:17
8c7139d

Choose a tag to compare

1.0.0-alpha.1 Pre-release
Pre-release

A first functional, but still unstable, release.

The base type representing open/closed intervals with generic T and TSize has been introduced. The only operations at the moment is a size property. Default intervals are included for all basic Kotlin types, e.g. IntInterval, DoubleInterval, etc.