public class Utils extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
checkForEqualSize(Tuple t0,
Tuple t1)
|
static void |
checkForValidIndex(int index,
int size)
Checks whether the given index is valid for accessing a tuple with
the given size, and throws an
IndexOutOfBoundsException
if not. |
static void |
checkForValidSubTupleIndices(int parentSize,
int fromIndex,
int toIndex)
Checks whether the given indices are valid indices for a sub-tuple
of a parent tuple with the given size, and throws an
IllegalArgumentException if not. |
public static void checkForEqualSize(Tuple t0, Tuple t1)
t0 - The first tuplet1 - The second tupleIllegalArgumentException - If the given tuples
do not have the same sizepublic static void checkForValidSubTupleIndices(int parentSize,
int fromIndex,
int toIndex)
IllegalArgumentException if not.parentSize - The size of the parentfromIndex - The start index of the sub-tuple, inclusivetoIndex - The end index of the sub-tuple, exclusiveIllegalArgumentException - If the given indices are invalid.
This is the case when fromIndex < 0,
fromIndex > toIndex, or
toIndex > parentSize,public static void checkForValidIndex(int index,
int size)
IndexOutOfBoundsException
if not.index - The indexsize - The sizeIndexOutOfBoundsException - If the given index is negative
or not smaller than then given sizeCopyright © 2015. All Rights Reserved.