Package tilda.utils
Class CollectionUtil
- java.lang.Object
-
- tilda.utils.CollectionUtil
-
public class CollectionUtil extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.Boolean[]EMPTY_BOOLEAN_Oprotected static boolean[]EMPTY_BOOLEAN_Pprotected static java.lang.Character[]EMPTY_CHARACTER_Oprotected static char[]EMPTY_CHARACTER_Pprotected static java.lang.Double[]EMPTY_DOUBLE_Oprotected static double[]EMPTY_DOUBLE_Pprotected static java.lang.Float[]EMPTY_FLOAT_Oprotected static float[]EMPTY_FLOAT_Pprotected static java.lang.Integer[]EMPTY_INTEGER_Oprotected static int[]EMPTY_INTEGER_Pprotected static java.lang.Long[]EMPTY_LONG_Oprotected static long[]EMPTY_LONG_Pprotected static java.lang.Object[]EMPTY_OBJECT_Oprotected static org.apache.logging.log4j.LoggerLOG
-
Constructor Summary
Constructors Constructor Description CollectionUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String[]append(java.lang.String[] A, java.lang.String Str)static java.lang.String[]append(java.lang.String[] A1, java.lang.String[] A2)static voidappend(java.util.List<java.lang.String> L, java.util.Iterator<java.lang.String> I)static <T> java.util.List<T>append(java.util.List<T> L, T[] A)static booleanendsWith(java.lang.String Val, java.lang.String[] A)static <T> booleanequals(java.util.List<T> a, java.util.List<T> b)Checks if both lists are equal, i.e., they are both null, or they are both not null and of equal size, and contain the same elements in the same positions.static <T> booleanequals(java.util.Set<T> a, java.util.Set<T> b)Checks if both sets are equal, i.e., they are both null, or they are both not null and of equal size, and contain the same elements.static intindexOf(java.lang.String[] A, java.lang.String Val)static booleanindexOf(java.lang.String Val, java.lang.String[] A)static intindexOfIgnoreCase(java.lang.String[] A, java.lang.String Val)static booleanisNullOrEmpty(java.util.Collection<?> C)Returns true if the collection is Null, is empty (has no element), or only has NULL elements.static java.lang.String[]prepend(java.lang.String[] A, java.lang.String Str)static booleanstartsWith(java.lang.String Val, java.lang.String[] A)static char[]toCharArray(java.lang.String[] v)static double[]toDoubleArray(java.lang.String[] v)static java.lang.String[][]toDoubleStringArray(java.util.Collection<java.lang.String[]> L)static float[]toFloatArray(java.lang.String[] v)static int[]toIntArray(java.lang.String[] v)static java.util.List<java.lang.Boolean>toList(boolean[] A)static java.util.List<java.lang.Byte>toList(byte[] A)static java.util.List<java.lang.Character>toList(char[] A)static java.util.List<java.lang.Double>toList(double[] A)static java.util.List<java.lang.Float>toList(float[] A)static java.util.List<java.lang.Integer>toList(int[] A)static java.util.List<java.lang.Long>toList(long[] A)static java.util.List<java.lang.Short>toList(short[] A)static java.util.List<?>toList(java.lang.Object A)static <T> java.util.List<T>toList(java.util.Iterator<T> I)static <T> java.util.List<T>toList(T[] A)static long[]toLongArray(java.lang.String[] v)static voidtoLowerCase(java.lang.String[] A)static java.lang.Boolean[]toObjectArray(boolean[] a)static java.lang.Character[]toObjectArray(char[] a)static java.lang.Double[]toObjectArray(double[] a)static java.lang.Float[]toObjectArray(float[] a)static java.lang.Integer[]toObjectArray(int[] a)static java.lang.Long[]toObjectArray(long[] a)static <T> T[]toObjectArray(java.lang.Class<T> c, java.util.List<T> L)static <T> T[]toObjectArray(java.util.Set<T> S)static boolean[]toPrimitiveArray(java.lang.Boolean[] a)static char[]toPrimitiveArray(java.lang.Character[] a)static double[]toPrimitiveArray(java.lang.Double[] a)static float[]toPrimitiveArray(java.lang.Float[] a)static int[]toPrimitiveArray(java.lang.Integer[] a)static long[]toPrimitiveArray(java.lang.Long[] a)static java.util.Set<java.lang.Boolean>toSet(boolean[] A)static java.util.Set<java.lang.Byte>toSet(byte[] A)static java.util.Set<java.lang.Character>toSet(char[] A)static java.util.Set<java.lang.Double>toSet(double[] A)static java.util.Set<java.lang.Float>toSet(float[] A)static java.util.Set<java.lang.Integer>toSet(int[] A)static java.util.Set<java.lang.Long>toSet(long[] A)static java.util.Set<java.lang.Short>toSet(short[] A)static java.util.Set<?>toSet(java.lang.Object A)static <T> java.util.Set<T>toSet(java.util.Iterator<T> I)static <T> java.util.Set<T>toSet(T[] A)static short[]toShortArray(java.lang.String[] v)static java.lang.String[]toStringArray(java.util.Collection<java.lang.String> L)
-
-
-
Field Detail
-
LOG
protected static final org.apache.logging.log4j.Logger LOG
-
EMPTY_BOOLEAN_O
protected static final java.lang.Boolean[] EMPTY_BOOLEAN_O
-
EMPTY_BOOLEAN_P
protected static final boolean[] EMPTY_BOOLEAN_P
-
EMPTY_INTEGER_O
protected static final java.lang.Integer[] EMPTY_INTEGER_O
-
EMPTY_INTEGER_P
protected static final int[] EMPTY_INTEGER_P
-
EMPTY_LONG_O
protected static final java.lang.Long[] EMPTY_LONG_O
-
EMPTY_LONG_P
protected static final long[] EMPTY_LONG_P
-
EMPTY_FLOAT_O
protected static final java.lang.Float[] EMPTY_FLOAT_O
-
EMPTY_FLOAT_P
protected static final float[] EMPTY_FLOAT_P
-
EMPTY_DOUBLE_O
protected static final java.lang.Double[] EMPTY_DOUBLE_O
-
EMPTY_DOUBLE_P
protected static final double[] EMPTY_DOUBLE_P
-
EMPTY_CHARACTER_O
protected static final java.lang.Character[] EMPTY_CHARACTER_O
-
EMPTY_CHARACTER_P
protected static final char[] EMPTY_CHARACTER_P
-
EMPTY_OBJECT_O
protected static final java.lang.Object[] EMPTY_OBJECT_O
-
-
Method Detail
-
toObjectArray
public static java.lang.Boolean[] toObjectArray(boolean[] a)
-
toPrimitiveArray
public static boolean[] toPrimitiveArray(java.lang.Boolean[] a)
-
toObjectArray
public static java.lang.Integer[] toObjectArray(int[] a)
-
toPrimitiveArray
public static int[] toPrimitiveArray(java.lang.Integer[] a)
-
toObjectArray
public static java.lang.Long[] toObjectArray(long[] a)
-
toPrimitiveArray
public static long[] toPrimitiveArray(java.lang.Long[] a)
-
toObjectArray
public static java.lang.Float[] toObjectArray(float[] a)
-
toPrimitiveArray
public static float[] toPrimitiveArray(java.lang.Float[] a)
-
toObjectArray
public static java.lang.Double[] toObjectArray(double[] a)
-
toPrimitiveArray
public static double[] toPrimitiveArray(java.lang.Double[] a)
-
toObjectArray
public static java.lang.Character[] toObjectArray(char[] a)
-
toPrimitiveArray
public static char[] toPrimitiveArray(java.lang.Character[] a)
-
toObjectArray
public static <T> T[] toObjectArray(java.lang.Class<T> c, java.util.List<T> L)
-
toObjectArray
public static <T> T[] toObjectArray(java.util.Set<T> S)
-
toList
public static <T> java.util.List<T> toList(T[] A)
-
toList
public static java.util.List<java.lang.Integer> toList(int[] A)
-
toList
public static java.util.List<java.lang.Long> toList(long[] A)
-
toList
public static java.util.List<java.lang.Float> toList(float[] A)
-
toList
public static java.util.List<java.lang.Double> toList(double[] A)
-
toList
public static java.util.List<java.lang.Character> toList(char[] A)
-
toList
public static java.util.List<java.lang.Byte> toList(byte[] A)
-
toList
public static java.util.List<java.lang.Short> toList(short[] A)
-
toList
public static java.util.List<java.lang.Boolean> toList(boolean[] A)
-
toList
public static <T> java.util.List<T> toList(java.util.Iterator<T> I)
-
toList
public static java.util.List<?> toList(java.lang.Object A) throws java.lang.Exception- Throws:
java.lang.Exception
-
toSet
public static <T> java.util.Set<T> toSet(T[] A)
-
toSet
public static java.util.Set<java.lang.Integer> toSet(int[] A)
-
toSet
public static java.util.Set<java.lang.Long> toSet(long[] A)
-
toSet
public static java.util.Set<java.lang.Float> toSet(float[] A)
-
toSet
public static java.util.Set<java.lang.Double> toSet(double[] A)
-
toSet
public static java.util.Set<java.lang.Character> toSet(char[] A)
-
toSet
public static java.util.Set<java.lang.Boolean> toSet(boolean[] A)
-
toSet
public static java.util.Set<java.lang.Byte> toSet(byte[] A)
-
toSet
public static java.util.Set<java.lang.Short> toSet(short[] A)
-
toSet
public static <T> java.util.Set<T> toSet(java.util.Iterator<T> I)
-
toSet
public static java.util.Set<?> toSet(java.lang.Object A) throws java.lang.Exception- Throws:
java.lang.Exception
-
equals
public static <T> boolean equals(java.util.Set<T> a, java.util.Set<T> b)Checks if both sets are equal, i.e., they are both null, or they are both not null and of equal size, and contain the same elements. The method checks the equals method on each element.- Parameters:
a-b-- Returns:
-
equals
public static <T> boolean equals(java.util.List<T> a, java.util.List<T> b)Checks if both lists are equal, i.e., they are both null, or they are both not null and of equal size, and contain the same elements in the same positions. The method checks the equals method on each element.- Parameters:
a-b-- Returns:
-
prepend
public static java.lang.String[] prepend(java.lang.String[] A, java.lang.String Str)
-
append
public static java.lang.String[] append(java.lang.String[] A, java.lang.String Str)
-
append
public static java.lang.String[] append(java.lang.String[] A1, java.lang.String[] A2)
-
append
public static <T> java.util.List<T> append(java.util.List<T> L, T[] A)
-
toShortArray
public static short[] toShortArray(java.lang.String[] v) throws java.lang.Exception- Throws:
java.lang.Exception
-
toIntArray
public static int[] toIntArray(java.lang.String[] v) throws java.lang.Exception- Throws:
java.lang.Exception
-
toLongArray
public static long[] toLongArray(java.lang.String[] v) throws java.lang.Exception- Throws:
java.lang.Exception
-
toFloatArray
public static float[] toFloatArray(java.lang.String[] v) throws java.lang.Exception- Throws:
java.lang.Exception
-
toDoubleArray
public static double[] toDoubleArray(java.lang.String[] v) throws java.lang.Exception- Throws:
java.lang.Exception
-
toCharArray
public static char[] toCharArray(java.lang.String[] v) throws java.lang.Exception- Throws:
java.lang.Exception
-
toStringArray
public static java.lang.String[] toStringArray(java.util.Collection<java.lang.String> L)
-
toDoubleStringArray
public static java.lang.String[][] toDoubleStringArray(java.util.Collection<java.lang.String[]> L)
-
append
public static void append(java.util.List<java.lang.String> L, java.util.Iterator<java.lang.String> I)
-
indexOf
public static int indexOf(java.lang.String[] A, java.lang.String Val)
-
indexOfIgnoreCase
public static int indexOfIgnoreCase(java.lang.String[] A, java.lang.String Val)
-
toLowerCase
public static void toLowerCase(java.lang.String[] A)
-
startsWith
public static boolean startsWith(java.lang.String Val, java.lang.String[] A)
-
endsWith
public static boolean endsWith(java.lang.String Val, java.lang.String[] A)
-
indexOf
public static boolean indexOf(java.lang.String Val, java.lang.String[] A)
-
isNullOrEmpty
public static boolean isNullOrEmpty(java.util.Collection<?> C)
Returns true if the collection is Null, is empty (has no element), or only has NULL elements. Returns false if the collection has at least one not-null element.- Parameters:
C-- Returns:
-
-