public class ArraySupport
extends java.lang.Object
Constructor and Description |
---|
ArraySupport() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String[] |
concat(java.lang.String[] a1,
java.lang.String[] a2) |
static boolean[] |
copy(boolean[] a1) |
static byte[] |
copy(byte[] a1) |
static char[] |
copy(char[] a1) |
static double[] |
copy(double[] a1) |
static float[] |
copy(float[] a1) |
static int[] |
copy(int[] a1) |
static long[] |
copy(long[] a1) |
static short[] |
copy(short[] a1) |
static java.lang.Object[] |
copyByReference(java.lang.Object[] a1) |
static java.lang.String[] |
copyByReference(java.lang.String[] a1) |
static java.lang.String[] |
copyByValue(java.lang.String[] a1) |
static boolean |
equals(boolean[] a1,
boolean[] a2) |
static boolean |
equals(boolean[] a1,
boolean[] a2,
int size) |
static boolean |
equals(byte[] a1,
byte[] a2) |
static boolean |
equals(byte[] a1,
byte[] a2,
int size) |
static boolean |
equals(char[] a1,
char[] a2) |
static boolean |
equals(char[] a1,
char[] a2,
int size) |
static boolean |
equals(double[] a1,
double[] a2) |
static boolean |
equals(double[] a1,
double[] a2,
int size) |
static boolean |
equals(float[] a1,
float[] a2) |
static boolean |
equals(float[] a1,
float[] a2,
int size) |
static boolean |
equals(int[] a1,
int[] a2) |
static boolean |
equals(int[] a1,
int[] a2,
int size) |
static boolean |
equals(long[] a1,
long[] a2) |
static boolean |
equals(long[] a1,
long[] a2,
int size) |
static boolean |
equals(java.lang.Object[] a1,
java.lang.Object[] a2) |
static boolean |
equals(java.lang.Object[] a1,
java.lang.Object[] a2,
int size) |
static boolean |
equals(short[] a1,
short[] a2) |
static boolean |
equals(short[] a1,
short[] a2,
int size) |
static boolean |
equals(java.lang.String[] a1,
java.lang.String[] a2) |
static boolean |
equals(java.lang.String[] a1,
java.lang.String[] a2,
int size) |
static void |
print(java.lang.String name,
boolean[] a1) |
static void |
print(java.lang.String name,
int[] a1) |
static <T> void |
removeListItems(java.util.ArrayList<T> list,
int[] idxs)
Removes a set of items from an ArrayList in a way that tries to minimize
the amount of data that is moved around within the list.
|
static int[] |
sortIndexList(int[] idxs,
int maxi)
Checks that the elements of a list of indices are all
< maxi and
are in strictly ascending order. |
static double[] |
toDoubleArray(java.util.Collection<? extends java.lang.Number> col) |
static float[] |
toFloatArray(java.util.Collection<? extends java.lang.Number> col) |
static int[] |
toIntArray(java.util.Collection<? extends java.lang.Number> col) |
static java.lang.String |
toString(double[] a1) |
static java.lang.String |
toString(float[] a1) |
static java.lang.String |
toString(int[] a1) |
static java.lang.String |
toString(long[] a1) |
static java.lang.String |
toString(NumberFormat fmt,
double[] a1) |
static java.lang.String |
toString(NumberFormat fmt,
float[] a1) |
public static java.lang.String[] concat(java.lang.String[] a1, java.lang.String[] a2)
public static boolean equals(double[] a1, double[] a2)
public static boolean equals(double[] a1, double[] a2, int size)
public static boolean equals(float[] a1, float[] a2)
public static boolean equals(float[] a1, float[] a2, int size)
public static boolean equals(char[] a1, char[] a2)
public static boolean equals(char[] a1, char[] a2, int size)
public static boolean equals(byte[] a1, byte[] a2)
public static boolean equals(byte[] a1, byte[] a2, int size)
public static boolean equals(short[] a1, short[] a2)
public static boolean equals(short[] a1, short[] a2, int size)
public static boolean equals(int[] a1, int[] a2)
public static boolean equals(int[] a1, int[] a2, int size)
public static boolean equals(long[] a1, long[] a2)
public static boolean equals(long[] a1, long[] a2, int size)
public static boolean equals(boolean[] a1, boolean[] a2)
public static boolean equals(boolean[] a1, boolean[] a2, int size)
public static boolean equals(java.lang.String[] a1, java.lang.String[] a2)
public static boolean equals(java.lang.String[] a1, java.lang.String[] a2, int size)
public static boolean equals(java.lang.Object[] a1, java.lang.Object[] a2)
public static boolean equals(java.lang.Object[] a1, java.lang.Object[] a2, int size)
public static double[] copy(double[] a1)
public static float[] copy(float[] a1)
public static char[] copy(char[] a1)
public static byte[] copy(byte[] a1)
public static short[] copy(short[] a1)
public static int[] copy(int[] a1)
public static long[] copy(long[] a1)
public static boolean[] copy(boolean[] a1)
public static java.lang.String[] copyByReference(java.lang.String[] a1)
public static java.lang.String[] copyByValue(java.lang.String[] a1)
public static java.lang.Object[] copyByReference(java.lang.Object[] a1)
public static double[] toDoubleArray(java.util.Collection<? extends java.lang.Number> col)
public static float[] toFloatArray(java.util.Collection<? extends java.lang.Number> col)
public static int[] toIntArray(java.util.Collection<? extends java.lang.Number> col)
public static void print(java.lang.String name, int[] a1)
public static void print(java.lang.String name, boolean[] a1)
public static java.lang.String toString(int[] a1)
public static java.lang.String toString(long[] a1)
public static java.lang.String toString(NumberFormat fmt, double[] a1)
public static java.lang.String toString(double[] a1)
public static java.lang.String toString(NumberFormat fmt, float[] a1)
public static java.lang.String toString(float[] a1)
public static int[] sortIndexList(int[] idxs, int maxi)
< maxi
and
are in strictly ascending order. If they are not in ascending order, a
new list is created and sorted to ensure that they are.idxs
- original index listidxs
if sorting was not required.public static <T> void removeListItems(java.util.ArrayList<T> list, int[] idxs)
idxs
. Indices can be in any
order, but better performance is achieved if they are arranged in
ascending order.list
- ArrayList from which items are to be removedidxs
- indices of the items which should be removed