|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrailo.runtime.type.util.ArrayUtil
public final class ArrayUtil
Util for diffrent methods to manipulate arrays
Field Summary | |
---|---|
static Object[] |
OBJECT_EMPTY
|
Constructor Summary | |
---|---|
ArrayUtil()
|
Method Summary | |
---|---|
static int |
arrayContainsIgnoreEmpty(Array arr,
String value,
boolean ignoreCase)
|
static double |
avg(Array array)
average of all values of the array, only work when all values are numeric |
static Object[] |
clone(Object[] src,
Object[] trg)
|
static int |
find(Array array,
Object object)
find a object in array |
static Object |
get(Object o,
int index)
gets a value of a array at defined index |
static Object |
get(Object o,
int index,
Object defaultValue)
gets a value of a array at defined index |
static int |
indexOf(String[] arr,
String value)
return index of given value in Array or -1 |
static int |
indexOfIgnoreCase(String[] arr,
String value)
return index of given value in Array or -1 |
static boolean |
isEmpty(boolean[] array)
|
static boolean |
isEmpty(byte[] array)
|
static boolean |
isEmpty(char[] array)
|
static boolean |
isEmpty(double[] array)
|
static boolean |
isEmpty(float[] array)
|
static boolean |
isEmpty(int[] array)
|
static boolean |
isEmpty(List list)
|
static boolean |
isEmpty(long[] array)
|
static boolean |
isEmpty(Object[] array)
|
static Object[] |
keys(Map map)
|
static double |
max(Array array)
the greatest value, of all values inside the array, only work when all values are numeric |
static double |
min(Array array)
the smallest value, of all values inside the array, only work when all values are numeric |
static Object |
set(Object o,
int index,
Object value)
sets a value to a array at defined index |
static Object |
setEL(Object o,
int index,
Object value)
sets a value to a array at defined index |
static int |
size(boolean[] array)
|
static int |
size(byte[] array)
|
static int |
size(char[] array)
|
static int |
size(double[] array)
|
static int |
size(float[] array)
|
static int |
size(int[] array)
|
static int |
size(long[] array)
|
static int |
size(Object[] array)
|
static long |
sizeOf(Array array)
|
static long |
sizeOf(List list)
|
static double |
sum(Array array)
sum of all values of a array, only work when all values are numeric |
static void |
swap(Array array,
int left,
int right)
swap to values of the array |
static Object[] |
toArray(List<?> list)
creates a native array out of the input list, if all values are from the same type, this type is used for the array, otherwise object |
static boolean[] |
toBooleanArray(Object obj)
|
static byte[] |
toByteArray(Object obj)
|
static char[] |
toCharArray(Object obj)
|
static double[] |
toDoubleArray(Object obj)
|
static float[] |
toFloatArray(Object obj)
|
static int[] |
toIntArray(Object obj)
|
static long[] |
toLongArray(Object obj)
|
static Object[] |
toNullArray(Object obj)
|
static Boolean[] |
toReferenceType(boolean[] primArr)
convert a primitive array (value type) to Object Array (reference type). |
static Byte[] |
toReferenceType(byte[] primArr)
convert a primitive array (value type) to Object Array (reference type). |
static Character[] |
toReferenceType(char[] primArr)
convert a primitive array (value type) to Object Array (reference type). |
static Double[] |
toReferenceType(double[] primArr)
convert a primitive array (value type) to Object Array (reference type). |
static Float[] |
toReferenceType(float[] primArr)
convert a primitive array (value type) to Object Array (reference type). |
static Integer[] |
toReferenceType(int[] primArr)
convert a primitive array (value type) to Object Array (reference type). |
static Long[] |
toReferenceType(long[] primArr)
convert a primitive array (value type) to Object Array (reference type). |
static Object[] |
toReferenceType(Object obj)
|
static Object[] |
toReferenceType(Object obj,
Object[] defaultValue)
|
static Short[] |
toReferenceType(short[] primArr)
convert a primitive array (value type) to Object Array (reference type). |
static short[] |
toShortArray(Object obj)
|
static SortRegister[] |
toSortRegisterArray(ArrayList list)
|
static SortRegister[] |
toSortRegisterArray(QueryColumn column)
|
static String[] |
trim(String[] arr)
trims all value of a String Array |
static Object[] |
values(Map map)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Object[] OBJECT_EMPTY
Constructor Detail |
---|
public ArrayUtil()
Method Detail |
---|
public static String[] trim(String[] arr)
arr
-
public static SortRegister[] toSortRegisterArray(ArrayList list)
list
-
public static SortRegister[] toSortRegisterArray(QueryColumn column)
column
-
public static void swap(Array array, int left, int right) throws ExpressionException
array
- left
- left value to swapright
- right value to swap
ExpressionException
public static int find(Array array, Object object)
array
- object
- object to find
public static double avg(Array array) throws ExpressionException
array
-
ExpressionException
public static double sum(Array array) throws ExpressionException
array
- Array
ExpressionException
public static double min(Array array) throws PageException
array
-
PageException
public static double max(Array array) throws PageException
array
-
PageException
public static int indexOf(String[] arr, String value)
arr
- value
-
public static int indexOfIgnoreCase(String[] arr, String value)
arr
- value
-
public static Boolean[] toReferenceType(boolean[] primArr)
primArr
- value type Array
public static Byte[] toReferenceType(byte[] primArr)
primArr
- value type Array
public static Character[] toReferenceType(char[] primArr)
primArr
- value type Array
public static Short[] toReferenceType(short[] primArr)
primArr
- value type Array
public static Integer[] toReferenceType(int[] primArr)
primArr
- value type Array
public static Long[] toReferenceType(long[] primArr)
primArr
- value type Array
public static Float[] toReferenceType(float[] primArr)
primArr
- value type Array
public static Double[] toReferenceType(double[] primArr)
primArr
- value type Array
public static Object get(Object o, int index) throws ArrayUtilException
o
- index
-
ArrayUtilException
public static Object get(Object o, int index, Object defaultValue)
o
- index
-
public static Object set(Object o, int index, Object value) throws ArrayUtilException
o
- index
- value
-
ArrayUtilException
public static Object setEL(Object o, int index, Object value)
o
- index
- value
-
public static boolean isEmpty(List list)
public static boolean isEmpty(Object[] array)
public static boolean isEmpty(boolean[] array)
public static boolean isEmpty(char[] array)
public static boolean isEmpty(double[] array)
public static boolean isEmpty(long[] array)
public static boolean isEmpty(int[] array)
public static boolean isEmpty(float[] array)
public static boolean isEmpty(byte[] array)
public static int size(Object[] array)
public static int size(boolean[] array)
public static int size(char[] array)
public static int size(double[] array)
public static int size(long[] array)
public static int size(int[] array)
public static int size(float[] array)
public static int size(byte[] array)
public static boolean[] toBooleanArray(Object obj) throws PageException
PageException
public static byte[] toByteArray(Object obj) throws PageException
PageException
public static short[] toShortArray(Object obj) throws PageException
PageException
public static int[] toIntArray(Object obj) throws PageException
PageException
public static Object[] toNullArray(Object obj) throws PageException
PageException
public static long[] toLongArray(Object obj) throws PageException
PageException
public static float[] toFloatArray(Object obj) throws PageException
PageException
public static double[] toDoubleArray(Object obj) throws PageException
PageException
public static char[] toCharArray(Object obj) throws PageException
PageException
public static int arrayContainsIgnoreEmpty(Array arr, String value, boolean ignoreCase)
public static Object[] toReferenceType(Object obj) throws CasterException
CasterException
public static Object[] toReferenceType(Object obj, Object[] defaultValue)
public static Object[] clone(Object[] src, Object[] trg)
public static Object[] keys(Map map)
public static Object[] values(Map map)
public static long sizeOf(List list)
public static long sizeOf(Array array)
public static Object[] toArray(List<?> list)
list
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |