|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.nlp.util.ArrayUtils
public class ArrayUtils
Static utility methods for operating on arrays.
Method Summary | ||
---|---|---|
static List<Integer> |
asList(int[] array)
needed because Arrays.asList() won't to autoboxing, so if you give it a primitive array you get a singleton list back with just that array as an element. |
|
static double[] |
asPrimitiveDoubleArray(Collection<Double> d)
|
|
static int[] |
asPrimitiveIntArray(Collection<Integer> d)
|
|
static
|
asSet(T[] a)
Return a set containing the same elements as the specified array. |
|
static
|
contains(T[] a,
T o)
Returns true iff object o equals (not ==) some element of array a. |
|
static double[] |
copy(double[] d)
|
|
static double[][] |
copy(double[][] d)
|
|
static double[][][] |
copy(double[][][] d)
|
|
static float[] |
copy(float[] d)
|
|
static float[][] |
copy(float[][] d)
|
|
static float[][][] |
copy(float[][][] d)
|
|
static int[] |
copy(int[] i)
|
|
static int[][] |
copy(int[][] i)
|
|
static boolean |
equalContents(int[][] xs,
int[][] ys)
Tests two int[][] arrays for having equal contents. |
|
static boolean |
equalContents(int[] xs,
int[] ys)
tests two int[] arrays for having equal contents |
|
static boolean |
equals(boolean[][] xs,
boolean[][] ys)
Tests two boolean[][] arrays for having equal contents. |
|
static boolean |
equals(double[][] xs,
double[][] ys)
Tests two double[][] arrays for having equal contents. |
|
static void |
fill(boolean[][][][] d,
boolean val)
|
|
static void |
fill(boolean[][][] d,
boolean val)
|
|
static void |
fill(boolean[][] d,
boolean val)
|
|
static void |
fill(double[][][][] d,
double val)
|
|
static void |
fill(double[][][] d,
double val)
|
|
static void |
fill(double[][] d,
double val)
|
|
static double[] |
flatten(double[][] array)
|
|
static double[] |
removeAt(double[] array,
int index)
Removes the element at the specified index from the array, and returns a new array containing the remaining elements. |
|
static Object[] |
removeAt(Object[] array,
int index)
Removes the element at the specified index from the array, and returns a new array containing the remaining elements. |
|
static double[][] |
to2D(double[] array,
int dim1Size)
|
|
static double[][] |
to2D(double[] array,
int dim1Size,
int dim2Size)
|
|
static double[] |
toDouble(float[] a)
Casts to a double array |
|
static double[] |
toDouble(int[] array)
Casts to a double array. |
|
static char[] |
toPrimitive(Character[] in)
|
|
static char[] |
toPrimitive(Character[] in,
char valueForNull)
|
|
static double[] |
toPrimitive(Double[] in)
|
|
static double[] |
toPrimitive(Double[] in,
double valueForNull)
|
|
static int[] |
toPrimitive(Integer[] in)
|
|
static int[] |
toPrimitive(Integer[] in,
int valueForNull)
|
|
static long[] |
toPrimitive(Long[] in)
|
|
static long[] |
toPrimitive(Long[] in,
long valueForNull)
|
|
static short[] |
toPrimitive(Short[] in)
|
|
static short[] |
toPrimitive(Short[] in,
short valueForNull)
|
|
static String |
toString(boolean[][] b)
|
|
static String |
toString(int[][] a)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static double[] flatten(double[][] array)
public static double[][] to2D(double[] array, int dim1Size)
public static double[][] to2D(double[] array, int dim1Size, int dim2Size)
public static double[] removeAt(double[] array, int index)
public static Object[] removeAt(Object[] array, int index)
public static String toString(int[][] a)
public static boolean equalContents(int[][] xs, int[][] ys)
equalContents(xs[i],ys[i])
is truepublic static boolean equals(double[][] xs, double[][] ys)
equals(xs[i],ys[i])
is truepublic static boolean equalContents(int[] xs, int[] ys)
xs[i]==ys[i]
public static boolean equals(boolean[][] xs, boolean[][] ys)
Arrays.equals(xs[i],ys[i])
is truepublic static <T> boolean contains(T[] a, T o)
public static <T> Set<T> asSet(T[] a)
public static void fill(double[][] d, double val)
public static void fill(double[][][] d, double val)
public static void fill(double[][][][] d, double val)
public static void fill(boolean[][] d, boolean val)
public static void fill(boolean[][][] d, boolean val)
public static void fill(boolean[][][][] d, boolean val)
public static double[] toDouble(float[] a)
public static double[] toDouble(int[] array)
public static List<Integer> asList(int[] array)
public static double[] asPrimitiveDoubleArray(Collection<Double> d)
public static int[] asPrimitiveIntArray(Collection<Integer> d)
public static int[] copy(int[] i)
public static int[][] copy(int[][] i)
public static double[] copy(double[] d)
public static double[][] copy(double[][] d)
public static double[][][] copy(double[][][] d)
public static float[] copy(float[] d)
public static float[][] copy(float[][] d)
public static float[][][] copy(float[][][] d)
public static String toString(boolean[][] b)
public static long[] toPrimitive(Long[] in)
public static int[] toPrimitive(Integer[] in)
public static short[] toPrimitive(Short[] in)
public static char[] toPrimitive(Character[] in)
public static double[] toPrimitive(Double[] in)
public static long[] toPrimitive(Long[] in, long valueForNull)
public static int[] toPrimitive(Integer[] in, int valueForNull)
public static short[] toPrimitive(Short[] in, short valueForNull)
public static char[] toPrimitive(Character[] in, char valueForNull)
public static double[] toPrimitive(Double[] in, double valueForNull)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |