public class IntArraysND extends Object
IntArrayND instances| Modifier and Type | Method and Description |
|---|---|
static java.util.function.ToIntFunction<IntTuple> |
asFunction(IntArrayND array)
Returns a view on the given
IntArrayND as a function
that maps coordinates to array entry values. |
static MutableIntArrayND |
create(int... size)
Creates a new
MutableIntArrayND with the specified size |
static MutableIntArrayND |
create(IntTuple size)
Creates a new
MutableIntArrayND with the specified size |
static IntArrayND |
createSubArray(IntArrayND parent,
IntTuple fromIndices,
IntTuple toIndices)
Creates a new array that is a view on the specified portion
of the given parent.
|
static MutableIntArrayND |
createSubArray(MutableIntArrayND parent,
IntTuple fromIndices,
IntTuple toIndices)
Creates a new array that is a view on the specified portion
of the given parent.
|
static int |
max(IntArrayND array)
Returns the maximum value in the given array, or
Integer.MIN_VALUE if the given array
has a size of 0. |
static int |
min(IntArrayND array)
Returns the minimum value in the given array, or
Integer.MAX_VALUE if the given array
has a size of 0. |
static String |
toFormattedString(IntArrayND array)
Creates a formatted representation of the given array.
|
static String |
toFormattedString(IntArrayND array,
String format)
Creates a formatted representation of the given array.
|
static MutableIntArrayND |
wrap(int[][] array)
Creates a view on the given array as a
MutableIntArrayND. |
static IntArrayND |
wrap(IntTuple t,
IntTuple size)
Creates a view on the given tuple as a
IntArrayND. |
static MutableIntArrayND |
wrap(MutableIntTuple t,
IntTuple size)
Creates a view on the given tuple as a
IntArrayND. |
public static MutableIntArrayND create(IntTuple size)
MutableIntArrayND with the specified sizesize - The sizeNullPointerException - If the given size is nullIllegalArgumentException - If the given size is negative
along any dimensionpublic static MutableIntArrayND create(int... size)
MutableIntArrayND with the specified sizesize - The sizeNullPointerException - If the given size is nullIllegalArgumentException - If the given size is negative
along any dimensionpublic static MutableIntArrayND wrap(int[][] array)
MutableIntArrayND. Changes in the given array
will be visible in the returned array, and vice versa.null elements).array - The backing arrayNullPointerException - If the given array is nullpublic static IntArrayND wrap(IntTuple t, IntTuple size)
IntArrayND.
Changes in the given tuple will be visible in the returned array.t - The tuplesize - The size of the arrayNullPointerException - If any argument is nullIllegalArgumentException - If the
size of the tuple does not match the
given array size (that is, the product of all elements of the given
tuple).public static MutableIntArrayND wrap(MutableIntTuple t, IntTuple size)
IntArrayND.
Changes in the given tuple will be visible in the returned array,
and vice versa.t - The tuplesize - The size of the arrayNullPointerException - If any argument is nullIllegalArgumentException - If the
size of the tuple does not match the
given array size (that is, the product of all elements of the given
tuple).public static java.util.function.ToIntFunction<IntTuple> asFunction(IntArrayND array)
IntArrayND as a function
that maps coordinates to array entry values. This function may
throw an IndexOutOfBoundsException when the given indices are not
valid. That is, if fromIndex < 0 or toIndex > size or
fromIndex > toIndex for any dimension. But explicit bounds
checking is not guaranteed.array - The arrayNullPointerException - If the given array is nullpublic static IntArrayND createSubArray(IntArrayND parent, IntTuple fromIndices, IntTuple toIndices)
parent - The parent arrayfromIndices - The start indices in the parent, inclusivetoIndices - The end indices in the parent, exclusiveNullPointerException - If any argument is nullIllegalArgumentException - If the indices are not valid. This
is the case when the size of the start- or
end indices is different than the parent size, or when
fromIndex < 0 or
toIndex > parentSize(i)
or fromIndex > toIndex for any dimension.public static MutableIntArrayND createSubArray(MutableIntArrayND parent, IntTuple fromIndices, IntTuple toIndices)
parent - The parent arrayfromIndices - The start indices in the parent, inclusivetoIndices - The end indices in the parent, exclusiveNullPointerException - If the given parent or any of the
given tuples is nullIllegalArgumentException - If the indices are not valid. This
is the case when the size of the start- or
end indices is different than the parent size, or when
fromIndex < 0 or
toIndex > parentSize(i)
or fromIndex > toIndex for any dimension.public static int min(IntArrayND array)
Integer.MAX_VALUE if the given array
has a size of 0.array - The arraypublic static int max(IntArrayND array)
Integer.MIN_VALUE if the given array
has a size of 0.array - The arraypublic static String toFormattedString(IntArrayND array)
array - The arraypublic static String toFormattedString(IntArrayND array, String format)
array - The arrayformat - The format for the array entriesCopyright © 2015. All Rights Reserved.