-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Affects: io7m-com/.github#2
- Loading branch information
Showing
11 changed files
with
111 additions
and
529 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
|
||
## jranges | ||
|
||
A set of functions and types for dealing with ranges and intervals. | ||
|
||
## Features | ||
|
||
* Immutable range types, for specifying ranges over all the available integral | ||
and floating point types. | ||
* Functions for checking that values fall within given ranges. | ||
* High coverage test suite. | ||
* [OSGi-ready](https://www.osgi.org/) | ||
* [JPMS-ready](https://en.wikipedia.org/wiki/Java_Platform_Module_System) | ||
* ISC license. | ||
|
||
## Usage | ||
|
||
### Range Checks | ||
|
||
Use the `RangeCheck` class to perform range checks: | ||
|
||
``` | ||
RangeCheck.checkIncludedInLong( | ||
23L, | ||
"Number of assignments", | ||
RangeInclusiveL.of(0L, 99), | ||
"Valid number of assignments" | ||
); | ||
|
||
RangeCheck.checkIncludedInLong( | ||
130L, | ||
"Number of assignments", | ||
RangeInclusiveL.of(0L, 99), | ||
"Valid number of assignments" | ||
); | ||
``` | ||
|
||
The second call will throw a `RangeCheckException` with a message similar to | ||
`Range check failed: 0 <= Number of assignments (130) <= 99 (Valid number of assignments) == false`. | ||
|
||
### Range Types | ||
|
||
The package exposes numerous immutable half-open and inclusive range types, | ||
specialized to various Java numeric types: | ||
|
||
* `RangeHalfOpenB` | ||
* `RangeHalfOpenD` | ||
* `RangeHalfOpenI` | ||
* `RangeHalfOpenL` | ||
* `RangeInclusiveB` | ||
* `RangeInclusiveD` | ||
* `RangeInclusiveI` | ||
* `RangeInclusiveL` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
com.io7m.jranges.documentation/src/main/assembly/documentation.xml
This file was deleted.
Oops, something went wrong.
29 changes: 0 additions & 29 deletions
29
...o7m.jranges.documentation/src/main/java/com/io7m/jranges/documentation/Documentation.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.