-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removes the heavy (19MB) dependency on fastutil by directly including only the used classes directly into chartfx. * shades fastutil classes * removes all unused methods from the classes * removes fastutil dependency * adds stream support
- Loading branch information
Showing
12 changed files
with
1,584 additions
and
13 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
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 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 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 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
26 changes: 26 additions & 0 deletions
26
chartfx-dataset/src/main/java/io/fair_acc/dataset/spi/fastutil/ArrayUtil.java
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,26 @@ | ||
package io.fair_acc.dataset.spi.fastutil; | ||
|
||
/** | ||
* Utilities for shading fastutil lists. | ||
*/ | ||
class ArrayUtil { | ||
|
||
/** Ensures that a range given by its first (inclusive) and last (exclusive) elements fits an array of given length. | ||
* | ||
* <p>This method may be used whenever an array range check is needed. | ||
* | ||
* @param arrayLength an array length. | ||
* @param from a start index (inclusive). | ||
* @param to an end index (inclusive). | ||
* @throws IllegalArgumentException if {@code from} is greater than {@code to}. | ||
* @throws ArrayIndexOutOfBoundsException if {@code from} or {@code to} are greater than {@code arrayLength} or negative. | ||
*/ | ||
public static void ensureFromTo(final int arrayLength, final int from, final int to) { | ||
if (from < 0) throw new ArrayIndexOutOfBoundsException("Start index (" + from + ") is negative"); | ||
if (from > to) throw new IllegalArgumentException("Start index (" + from + ") is greater than end index (" + to + ")"); | ||
if (to > arrayLength) throw new ArrayIndexOutOfBoundsException("End index (" + to + ") is greater than array length (" + arrayLength + ")"); | ||
} | ||
|
||
public static final int MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8; | ||
|
||
} |
Oops, something went wrong.