public class LongArraysND extends Object
LongArrayND instances| Modifier and Type | Method and Description |
|---|---|
static java.util.function.ToLongFunction<IntTuple> |
asFunction(LongArrayND array)
Returns a view on the given
LongArrayND as a function
that maps coordinates to array entry values. |
static MutableLongArrayND |
create(int... size)
Creates a new
MutableLongArrayND with the specified size |
static MutableLongArrayND |
create(IntTuple size)
Creates a new
MutableLongArrayND with the specified size |
static LongArrayND |
createSubArray(LongArrayND parent,
IntTuple fromIndices,
IntTuple toIndices)
Creates a new array that is a view on the specified portion
of the given parent.
|
static MutableLongArrayND |
createSubArray(MutableLongArrayND parent,
IntTuple fromIndices,
IntTuple toIndices)
Creates a new array that is a view on the specified portion
of the given parent.
|
static long |
max(LongArrayND array)
Returns the maximum value in the given array, or
Long.MIN_VALUE if the given array
has a size of 0. |
static long |
min(LongArrayND array)
Returns the minimum value in the given array, or
Long.MAX_VALUE if the given array
has a size of 0. |
static String |
toFormattedString(LongArrayND array)
Creates a formatted representation of the given array.
|
static String |
toFormattedString(LongArrayND array,
String format)
Creates a formatted representation of the given array.
|
static MutableLongArrayND |
wrap(long[][] array)
Creates a view on the given array as a
MutableLongArrayND. |
static LongArrayND |
wrap(LongTuple t,
IntTuple size)
Creates a view on the given tuple as a
LongArrayND. |
static MutableLongArrayND |
wrap(MutableLongTuple t,
IntTuple size)
Creates a view on the given tuple as a
LongArrayND. |
public static MutableLongArrayND create(IntTuple size)
MutableLongArrayND with the specified sizesize - The sizeNullPointerException - If the given size is nullIllegalArgumentException - If the given size is negative
along any dimensionpublic static MutableLongArrayND create(int... size)
MutableLongArrayND with the specified sizesize - The sizeNullPointerException - If the given size is nullIllegalArgumentException - If the given size is negative
along any dimensionpublic static MutableLongArrayND wrap(long[][] array)
MutableLongArrayND. 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 LongArrayND wrap(LongTuple t, IntTuple size)
LongArrayND.
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 MutableLongArrayND wrap(MutableLongTuple t, IntTuple size)
LongArrayND.
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.ToLongFunction<IntTuple> asFunction(LongArrayND array)
LongArrayND 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 LongArrayND createSubArray(LongArrayND 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 MutableLongArrayND createSubArray(MutableLongArrayND 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 long min(LongArrayND array)
Long.MAX_VALUE if the given array
has a size of 0.array - The arraypublic static long max(LongArrayND array)
Long.MIN_VALUE if the given array
has a size of 0.array - The arraypublic static String toFormattedString(LongArrayND array)
array - The arraypublic static String toFormattedString(LongArrayND array, String format)
array - The arrayformat - The format for the array entriesCopyright © 2015. All Rights Reserved.