|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectit.unimi.dsi.fastutil.Arrays
public class Arrays
A class providing static methods and objects that do useful things with arrays.
Arrays
Method Summary | |
---|---|
static void |
ensureFromTo(int arrayLength,
int from,
int to)
Ensures that a range given by its first (inclusive) and last (exclusive) elements fits an array of given length. |
static void |
ensureOffsetLength(int arrayLength,
int offset,
int length)
Ensures that a range given by an offset and a length fits an array of given length. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void ensureFromTo(int arrayLength, int from, int to)
This method may be used whenever an array range check is needed.
arrayLength
- an array length.from
- a start index (inclusive).to
- an end index (inclusive).
java.lang.IllegalArgumentException
- if from
is greater than to
.
java.lang.ArrayIndexOutOfBoundsException
- if from
or to
are greater than arrayLength
or negative.public static void ensureOffsetLength(int arrayLength, int offset, int length)
This method may be used whenever an array range check is needed.
arrayLength
- an array length.offset
- a start index for the fragmentlength
- a length (the number of elements in the fragment).
java.lang.IllegalArgumentException
- if length
is negative.
java.lang.ArrayIndexOutOfBoundsException
- if offset
is negative or offset
+length
is greater than arrayLength
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |