public class ArrayTool
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
protected |
ArrayTool()
Creates a new instance of ArrayUtil
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
asString(byte[] array)
convenience method for getting a string description of an integer array
|
static java.lang.String |
asString(double[] array)
convenience method for getting a string description of a double array
|
static java.lang.String |
asString(double[][] array)
convenience method for getting a string description of a double two dimensional array
|
static java.lang.String |
asString(float[] array)
convenience method for getting a string description of an integer array
|
static java.lang.String |
asString(int[] array)
convenience method for getting a string description of an integer array
|
static java.lang.String |
asString(long[] array)
convenience method for getting a string description of an integer array
|
static java.lang.String |
asString(java.lang.Object[] array)
convenience method for getting a string description of an Object array by joining each element with a comma character
|
static java.lang.String |
asString(short[] array)
convenience method for getting a string description of an integer array
|
protected static java.lang.Object |
getBaseArray(java.lang.Object array,
int[] indices,
int indexPtr)
Return the array at the base of the the specified array.
|
static double |
getDouble(java.lang.Object array,
int[] indices)
Given a multi-dimensional array, return the double value at
the specified index.
|
static java.lang.Object |
getObject(java.lang.Object array,
int[] indices)
Given a multi-dimensional array, return the Object at
the specified index.
|
static boolean |
increment(int[] indices,
int[] dimensions)
Increment the indices in place.
|
static void |
setDouble(java.lang.Object array,
int[] indices,
double value)
Given a multi-dimensional array, set the double value at
the specified index.
|
static void |
setObject(java.lang.Object array,
int[] indices,
java.lang.Object value)
Given a multi-dimensional array, set the Object at
the specified index.
|
public static double getDouble(java.lang.Object array, int[] indices)
public static void setDouble(java.lang.Object array, int[] indices, double value)
public static java.lang.Object getObject(java.lang.Object array, int[] indices)
public static void setObject(java.lang.Object array, int[] indices, java.lang.Object value)
protected static java.lang.Object getBaseArray(java.lang.Object array, int[] indices, int indexPtr)
public static boolean increment(int[] indices, int[] dimensions)
indices
- the indices are the set of indices to incrementdimensions
- each element is the size of each dimensiontrue
if the indices were incremented, or
false
if the indices were not incremented thus
indicating that it has exhausted all possible indices.public static java.lang.String asString(byte[] array)
public static java.lang.String asString(int[] array)
public static java.lang.String asString(short[] array)
public static java.lang.String asString(long[] array)
public static java.lang.String asString(float[] array)
public static java.lang.String asString(double[] array)
public static java.lang.String asString(java.lang.Object[] array)
array
- The array of objectspublic static java.lang.String asString(double[][] array)