|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cc.mallet.util.ArrayUtils
public final class ArrayUtils
Static utility methods for arrays (like java.util.Arrays, but more useful).
Method Summary | |
---|---|
static boolean |
any(gnu.trove.TDoubleProcedure proc,
double[] v)
Returns true if the procedure proc returns true for any element of the array v. |
static boolean |
any(gnu.trove.TObjectProcedure proc,
java.lang.Object[][] v)
Returns true if the procedure proc returns true for any element of the array v. |
static boolean[] |
append(boolean[] v,
boolean elem)
Returns a new array with a single element appended at the end. |
static double[] |
append(double[] a1,
double[] a2)
Returns a new array that is the concatenation of a1 and a2. |
static int[] |
append(int[] v,
int elem)
Returns a new array with a single element appended at the end. |
static int[] |
append(int[] a1,
int[] a2)
Returns a new array that is the concatenation of a1 and a2. |
static java.lang.Object[] |
append(java.lang.Object[] v,
java.lang.Object elem)
Returns a new array with a single element appended at the end. |
static int |
argmax(double[] elems)
|
static double |
count(int[] sampled,
int val)
Returns the number of times a value occurs in a given array. |
static boolean |
equals(boolean[][] m1,
boolean[][] m2)
|
static double[] |
extend(double[] a,
int additional)
Returns a new array containing all of a, with additional extra space added (zero initialized). |
static int[] |
extend(int[] a,
int additional)
Returns a new array containing all of a, with additional extra space added (zero initialized). |
static void |
forEach(gnu.trove.TObjectProcedure proc,
java.lang.Object[] v)
|
static void |
forEach(gnu.trove.TObjectProcedure proc,
java.lang.Object[][] v)
|
static int |
indexOf(int[] array,
int obj)
|
static int |
indexOf(java.lang.Object[] array,
java.lang.Object obj)
|
static void |
print(double[] v)
|
static void |
print(int[] v)
|
static java.lang.String |
toString(double[] v)
|
static java.lang.String |
toString(int[] v)
|
static java.lang.String |
toString(java.lang.Object[] v)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static int indexOf(java.lang.Object[] array, java.lang.Object obj)
public static int indexOf(int[] array, int obj)
public static boolean any(gnu.trove.TDoubleProcedure proc, double[] v)
public static boolean any(gnu.trove.TObjectProcedure proc, java.lang.Object[][] v)
public static void forEach(gnu.trove.TObjectProcedure proc, java.lang.Object[] v)
public static void forEach(gnu.trove.TObjectProcedure proc, java.lang.Object[][] v)
public static void print(double[] v)
public static void print(int[] v)
public static java.lang.String toString(int[] v)
public static java.lang.String toString(double[] v)
public static java.lang.String toString(java.lang.Object[] v)
public static int[] extend(int[] a, int additional)
a
- additional
-
public static double[] extend(double[] a, int additional)
a
- additional
-
public static int[] append(int[] a1, int[] a2)
a1
- a2
-
public static double[] append(double[] a1, double[] a2)
a1
- a2
-
public static int[] append(int[] v, int elem)
v
- Original arrayelem
- Element to add to endpublic static boolean[] append(boolean[] v, boolean elem)
v
- Original arrayelem
- Element to add to endpublic static java.lang.Object[] append(java.lang.Object[] v, java.lang.Object elem)
v
- Original arrayelem
- Element to add to end
public static double count(int[] sampled, int val)
public static int argmax(double[] elems)
public static boolean equals(boolean[][] m1, boolean[][] m2)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |