Skip to content

Commit

Permalink
Eliminate jstructural
Browse files Browse the repository at this point in the history
  • Loading branch information
io7m committed May 4, 2024
1 parent 376e726 commit 967c575
Show file tree
Hide file tree
Showing 11 changed files with 111 additions and 529 deletions.
53 changes: 53 additions & 0 deletions README.in
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`
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,57 @@ jranges
| OpenJDK (Temurin) LTS | Linux | [![Build (OpenJDK (Temurin) LTS, Linux)](https://img.shields.io/github/actions/workflow/status/io7m-com/jranges/main.linux.temurin.lts.yml)](https://www.github.com/io7m-com/jranges/actions?query=workflow%3Amain.linux.temurin.lts)|
| OpenJDK (Temurin) Current | Windows | [![Build (OpenJDK (Temurin) Current, Windows)](https://img.shields.io/github/actions/workflow/status/io7m-com/jranges/main.windows.temurin.current.yml)](https://www.github.com/io7m-com/jranges/actions?query=workflow%3Amain.windows.temurin.current)|
| OpenJDK (Temurin) LTS | Windows | [![Build (OpenJDK (Temurin) LTS, Windows)](https://img.shields.io/github/actions/workflow/status/io7m-com/jranges/main.windows.temurin.lts.yml)](https://www.github.com/io7m-com/jranges/actions?query=workflow%3Amain.windows.temurin.lts)|

## 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`

223 changes: 0 additions & 223 deletions com.io7m.jranges.documentation/pom.xml

This file was deleted.

20 changes: 0 additions & 20 deletions com.io7m.jranges.documentation/src/main/assembly/documentation.xml

This file was deleted.

This file was deleted.

Loading

0 comments on commit 967c575

Please sign in to comment.