Class ArrayUtil
- java.lang.Object
- 
- org.pepstock.charba.client.commons.ArrayUtil
 
- 
 public class ArrayUtil extends Object Utility to transform arrays and list of objects to primitives.
 The code has been changed in order to be aligned with internal needs, taking the source from ArrayUtils of Apache common lang3..
- 
- 
Field SummaryFields Modifier and Type Field Description static ActionItem[]EMPTY_ACTION_ITEM_ARRAYAn empty immutableActionItemarray.static AnimationPropertyKey[]EMPTY_ANIMATION_PROPERTY_ARRAYAn empty immutableAnimationPropertyKeyarray.static boolean[]EMPTY_BOOLEAN_ARRAYAn empty immutablebooleanarray.static Boolean[]EMPTY_BOOLEAN_OBJECT_ARRAYAn empty immutableBooleanarray.static BorderAlign[]EMPTY_BORDER_ALIGN_ARRAYAn empty immutableBorderAlignarray.static BorderSkipped[]EMPTY_BORDER_SKIPPED_ARRAYAn empty immutableBorderSkippedarray.static IsColor[]EMPTY_COLORS_ARRAYAn empty immutableIsColorarray.static DataPoint[]EMPTY_DATA_POINT_ARRAYAn empty immutableDataPointarray.static Date[]EMPTY_DATE_ARRAYAn empty immutableDatearray.static double[]EMPTY_DOUBLE_ARRAYAn empty immutabledoublearray.static Double[]EMPTY_DOUBLE_OBJECT_ARRAYAn empty immutableDoublearray.static EventButton[]EMPTY_EVENT_BUTTON_ARRAYAn empty immutableEventButtonarray.static int[]EMPTY_INT_ARRAYAn empty immutableintarray.static Integer[]EMPTY_INTEGER_OBJECT_ARRAYAn empty immutableIntegerarray.static Key[]EMPTY_KEY_ARRAYAn empty immutableKeyarray.static MeasureUnit[]EMPTY_MEASURE_UNIT_ARRAYAn empty immutableMeasureUnitarray.static String[]EMPTY_STRING_ARRAYAn empty immutableStringarray.static TimeSeriesItem[]EMPTY_TIME_SERIES_ITEM_ARRAYAn empty immutableTimeSeriesItemarray.
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static intgetLength(Object array)Returns the length of the passed array.
 If argument isnull, 0 is returned.static booleanisEmpty(boolean[] array)Returnstrueif the array is empty.static booleanisEmpty(double[] array)Returnstrueif the array is empty.static booleanisEmpty(int[] array)Returnstrueif the array is empty.static booleanisEmpty(Object[] array)Returnstrueif the array is empty.static booleanisNotEmpty(boolean[] array)Returnstrueif the array is empty.static booleanisNotEmpty(double[] array)Returnstrueif the array is empty.static booleanisNotEmpty(int[] array)Returnstrueif the array is empty.static booleanisNotEmpty(Object[] array)Returnstrueif the array is empty.static ActionItem[]toActionItems(List<ActionItem> list)Returns an array of dates from a list.static AnimationPropertyKey[]toAnimationProperties(List<AnimationPropertyKey> list)Returns an array of dates from a list.static boolean[]toBooleans(List<Boolean> list)Returns an array of primitives from a list.static BorderAlign[]toBorderAlign(List<BorderAlign> list)Returns an array of dates from a list.static BorderSkipped[]toBorderSkipped(List<BorderSkipped> list)Returns an array of dates from a list.static IsColor[]toColors(List<IsColor> list)Returns an array of dates from a list.static DataPoint[]toDataPoints(List<DataPoint> list)Returns an array of dates from a list.static Date[]toDates(List<Date> list)Returns an array of dates from a list.static double[]toDoubles(List<Double> list)Returns an array of primitives from a list.static EventButton[]toEventButtons(List<EventButton> list)Returns an array of dates from a list.static int[]toIntegers(List<Integer> list)Returns an array of primitives from a list.static Key[]toKeys(List<Key> list)Returns an array of dates from a list.static MeasureUnit[]toMeasureUnits(List<MeasureUnit> list)Returns an array of dates from a list.static boolean[]toPrimitive(Boolean[] array)Returns an array of primitives from an array of objects.static double[]toPrimitive(Double[] array)Returns an array of primitives from an array of objects.static int[]toPrimitive(Integer[] array)Returns an array of primitives from an array of objects.static String[]toStrings(List<String> list)Returns an array of strings from a list.static TimeSeriesItem[]toTimeSeriesItems(List<TimeSeriesItem> list)Returns an array of dates from a list.
 
- 
- 
- 
Field Detail- 
EMPTY_BOOLEAN_ARRAYpublic static final boolean[] EMPTY_BOOLEAN_ARRAY An empty immutablebooleanarray.
 - 
EMPTY_BOOLEAN_OBJECT_ARRAYpublic static final Boolean[] EMPTY_BOOLEAN_OBJECT_ARRAY An empty immutableBooleanarray.
 - 
EMPTY_DOUBLE_ARRAYpublic static final double[] EMPTY_DOUBLE_ARRAY An empty immutabledoublearray.
 - 
EMPTY_DOUBLE_OBJECT_ARRAYpublic static final Double[] EMPTY_DOUBLE_OBJECT_ARRAY An empty immutableDoublearray.
 - 
EMPTY_INT_ARRAYpublic static final int[] EMPTY_INT_ARRAY An empty immutableintarray.
 - 
EMPTY_INTEGER_OBJECT_ARRAYpublic static final Integer[] EMPTY_INTEGER_OBJECT_ARRAY An empty immutableIntegerarray.
 - 
EMPTY_DATA_POINT_ARRAYpublic static final DataPoint[] EMPTY_DATA_POINT_ARRAY An empty immutableDataPointarray.
 - 
EMPTY_TIME_SERIES_ITEM_ARRAYpublic static final TimeSeriesItem[] EMPTY_TIME_SERIES_ITEM_ARRAY An empty immutableTimeSeriesItemarray.
 - 
EMPTY_COLORS_ARRAYpublic static final IsColor[] EMPTY_COLORS_ARRAY An empty immutableIsColorarray.
 - 
EMPTY_BORDER_SKIPPED_ARRAYpublic static final BorderSkipped[] EMPTY_BORDER_SKIPPED_ARRAY An empty immutableBorderSkippedarray.
 - 
EMPTY_BORDER_ALIGN_ARRAYpublic static final BorderAlign[] EMPTY_BORDER_ALIGN_ARRAY An empty immutableBorderAlignarray.
 - 
EMPTY_MEASURE_UNIT_ARRAYpublic static final MeasureUnit[] EMPTY_MEASURE_UNIT_ARRAY An empty immutableMeasureUnitarray.
 - 
EMPTY_ANIMATION_PROPERTY_ARRAYpublic static final AnimationPropertyKey[] EMPTY_ANIMATION_PROPERTY_ARRAY An empty immutableAnimationPropertyKeyarray.
 - 
EMPTY_ACTION_ITEM_ARRAYpublic static final ActionItem[] EMPTY_ACTION_ITEM_ARRAY An empty immutableActionItemarray.
 - 
EMPTY_EVENT_BUTTON_ARRAYpublic static final EventButton[] EMPTY_EVENT_BUTTON_ARRAY An empty immutableEventButtonarray.
 
- 
 - 
Method Detail- 
getLengthpublic static int getLength(Object array) Returns the length of the passed array.
 If argument isnull, 0 is returned.- Parameters:
- array- the array to get the length
- Returns:
- the length of the array
 
 - 
isEmptypublic static boolean isEmpty(boolean[] array) Returnstrueif the array is empty.- Parameters:
- array- the array to check
- Returns:
- trueif the array is empty
 
 - 
isEmptypublic static boolean isEmpty(double[] array) Returnstrueif the array is empty.- Parameters:
- array- the array to check
- Returns:
- trueif the array is empty
 
 - 
isEmptypublic static boolean isEmpty(int[] array) Returnstrueif the array is empty.- Parameters:
- array- the array to check
- Returns:
- trueif the array is empty
 
 - 
isEmptypublic static boolean isEmpty(Object[] array) Returnstrueif the array is empty.- Parameters:
- array- the array to check
- Returns:
- trueif the array is empty
 
 - 
isNotEmptypublic static boolean isNotEmpty(boolean[] array) Returnstrueif the array is empty.- Parameters:
- array- the array to check
- Returns:
- trueif the array is empty
 
 - 
isNotEmptypublic static boolean isNotEmpty(double[] array) Returnstrueif the array is empty.- Parameters:
- array- the array to check
- Returns:
- trueif the array is empty
 
 - 
isNotEmptypublic static boolean isNotEmpty(int[] array) Returnstrueif the array is empty.- Parameters:
- array- the array to check
- Returns:
- trueif the array is empty
 
 - 
isNotEmptypublic static boolean isNotEmpty(Object[] array) Returnstrueif the array is empty.- Parameters:
- array- the array to check
- Returns:
- trueif the array is empty
 
 - 
toBooleanspublic static boolean[] toBooleans(List<Boolean> list) Returns an array of primitives from a list.- Parameters:
- list- list of objects to transform
- Returns:
- an array of primitives from a list
 
 - 
toPrimitivepublic static boolean[] toPrimitive(Boolean[] array) Returns an array of primitives from an array of objects.- Parameters:
- array- array of objects to transform
- Returns:
- an array of primitives from passed array
 
 - 
toDoublespublic static double[] toDoubles(List<Double> list) Returns an array of primitives from a list.- Parameters:
- list- list of objects to transform
- Returns:
- an array of primitives from a list
 
 - 
toPrimitivepublic static double[] toPrimitive(Double[] array) Returns an array of primitives from an array of objects.- Parameters:
- array- array of objects to transform
- Returns:
- an array of primitives from passed array
 
 - 
toIntegerspublic static int[] toIntegers(List<Integer> list) Returns an array of primitives from a list.- Parameters:
- list- list of objects to transform
- Returns:
- an array of primitives from a list
 
 - 
toPrimitivepublic static int[] toPrimitive(Integer[] array) Returns an array of primitives from an array of objects.- Parameters:
- array- array of objects to transform
- Returns:
- an array of primitives from passed array
 
 - 
toStringspublic static String[] toStrings(List<String> list) Returns an array of strings from a list.- Parameters:
- list- list of objects to transform
- Returns:
- an array of strings from a list
 
 - 
toDatespublic static Date[] toDates(List<Date> list) Returns an array of dates from a list.- Parameters:
- list- list of objects to transform
- Returns:
- an array of dates from a list
 
 - 
toDataPointspublic static DataPoint[] toDataPoints(List<DataPoint> list) Returns an array of dates from a list.- Parameters:
- list- list of objects to transform
- Returns:
- an array of dates from a list
 
 - 
toTimeSeriesItemspublic static TimeSeriesItem[] toTimeSeriesItems(List<TimeSeriesItem> list) Returns an array of dates from a list.- Parameters:
- list- list of objects to transform
- Returns:
- an array of dates from a list
 
 - 
toColorspublic static IsColor[] toColors(List<IsColor> list) Returns an array of dates from a list.- Parameters:
- list- list of objects to transform
- Returns:
- an array of dates from a list
 
 - 
toBorderSkippedpublic static BorderSkipped[] toBorderSkipped(List<BorderSkipped> list) Returns an array of dates from a list.- Parameters:
- list- list of objects to transform
- Returns:
- an array of dates from a list
 
 - 
toBorderAlignpublic static BorderAlign[] toBorderAlign(List<BorderAlign> list) Returns an array of dates from a list.- Parameters:
- list- list of objects to transform
- Returns:
- an array of dates from a list
 
 - 
toKeyspublic static Key[] toKeys(List<Key> list) Returns an array of dates from a list.- Parameters:
- list- list of objects to transform
- Returns:
- an array of dates from a list
 
 - 
toMeasureUnitspublic static MeasureUnit[] toMeasureUnits(List<MeasureUnit> list) Returns an array of dates from a list.- Parameters:
- list- list of objects to transform
- Returns:
- an array of dates from a list
 
 - 
toAnimationPropertiespublic static AnimationPropertyKey[] toAnimationProperties(List<AnimationPropertyKey> list) Returns an array of dates from a list.- Parameters:
- list- list of objects to transform
- Returns:
- an array of dates from a list
 
 - 
toActionItemspublic static ActionItem[] toActionItems(List<ActionItem> list) Returns an array of dates from a list.- Parameters:
- list- list of objects to transform
- Returns:
- an array of dates from a list
 
 - 
toEventButtonspublic static EventButton[] toEventButtons(List<EventButton> list) Returns an array of dates from a list.- Parameters:
- list- list of objects to transform
- Returns:
- an array of dates from a list
 
 
- 
 
-