Releases: Whathecode/kotlinx.interval
2.1.0
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 addedgetValueAt(), this supports quick type safe linear interpolation.
Dependency updates:
- Kotlin 2.1.21
- kotlinx.datetime 0.6.2
2.0.0
Additions to IntervalUnion and Interval:
shift()offsets an interval by a specified amount (also asshlandshroperators).
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()andtoDouble()
Dependency updates:
- Kotlin 2.1.20
- kotlinx.datetime 0.6.1
1.0.1
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
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:
toStringsetEquals
Moved to IntervalUnion (and still supported on Interval):
plus,minuscontainsintersects
Additions to Interval:
canonicalize
Dependency updates:
- Kotlin 2.0.0
- kotlinx-datetime 0.6.0
1.0.0-alpha.5
Additions to Interval:
minusandplusoperations.lowerBound,upperBound,isLowerBoundIncluded, andisUpperBoundIncludedaccessors, preventing you from having to repeatedly checkisReversed.Intervalnow implementsIntervalUnion, as a union with a single interval.
Additions to IntervalUnion:
isEmptygetBoundsto get upper and lower bounds of the set.
Dependency updates:
- Kotlin 1.9.23
- kotlinx-datetime 0.5.0
1.0.0-alpha.4
- Added an initial contract definition for
IntervalUnion(a collection of intervals) and preliminary concreteMutableIntervalUnionwhich lives up to the contract by restricting which intervals can be added. - Added
Interval.reverseandnonReversed. - Added
Interval.intersectsto check whether one interval intersects with another.
1.0.0-alpha.3
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
- Added
Interval.contains(in) operator to check whether values lie in an interval. - Added
intervalconstructor functions so that all interval types can be constructed using the same keyword.
1.0.0-alpha.1
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.