public class ArrayUtils
extends java.lang.Object
isEmpty(Object[])
is null or its length is 0getLast(Object[], Object, Object, boolean)
get last element of the target element, before the first one
that match the target element front to backgetNext(Object[], Object, Object, boolean)
get next element of the target element, after the first one
that match the target element front to backgetLast(Object[], Object, boolean)
getLast(int[], int, int, boolean)
getLast(long[], long, long, boolean)
getNext(Object[], Object, boolean)
getNext(int[], int, int, boolean)
getNext(long[], long, long, boolean)
构造器和说明 |
---|
ArrayUtils() |
限定符和类型 | 方法和说明 |
---|---|
static int |
getLast(int[] sourceArray,
int value,
int defaultValue,
boolean isCircle) |
static long |
getLast(long[] sourceArray,
long value,
long defaultValue,
boolean isCircle) |
static <V> V |
getLast(V[] sourceArray,
V value,
boolean isCircle) |
static <V> V |
getLast(V[] sourceArray,
V value,
V defaultValue,
boolean isCircle)
get last element of the target element, before the first one that match the target element front to back
if array is empty, return defaultValue
if target element is not exist in array, return defaultValue
if target element exist in array and its index is not 0, return the last element
if target element exist in array and its index is 0, return the last one in array if isCircle is true, else
return defaultValue
|
static int |
getNext(int[] sourceArray,
int value,
int defaultValue,
boolean isCircle) |
static long |
getNext(long[] sourceArray,
long value,
long defaultValue,
boolean isCircle) |
static <V> V |
getNext(V[] sourceArray,
V value,
boolean isCircle) |
static <V> V |
getNext(V[] sourceArray,
V value,
V defaultValue,
boolean isCircle)
get next element of the target element, after the first one that match the target element front to back
if array is empty, return defaultValue
if target element is not exist in array, return defaultValue
if target element exist in array and not the last one in array, return the next element
if target element exist in array and the last one in array, return the first one in array if isCircle is
true, else return defaultValue
|
static <V> boolean |
isEmpty(V[] sourceArray)
is null or its length is 0
|
static boolean |
isEquals(java.lang.Object actual,
java.lang.Object expected)
compare two object
|
static void |
iteratorArrayList(java.util.ArrayList arrayList) |
static void |
iteratorHashMap(java.util.HashMap<java.lang.String,java.lang.Object> hashMap) |
static void |
iteratorHashMapString(java.util.HashMap<java.lang.String,java.lang.String> map) |
static void |
iteratorList(java.util.List inputList) |
static java.lang.Integer[] |
transformIntArray(int[] source)
convert int array to Integer array
|
static int[] |
transformIntArray(java.lang.Integer[] source)
convert Integer array to int array
|
static java.lang.Long[] |
transformLongArray(long[] source)
convert long array to Long array
|
static long[] |
transformLongArray(java.lang.Long[] source)
convert Long array to long array
|
public static <V> boolean isEmpty(V[] sourceArray)
V
- sourceArray
- public static <V> V getLast(V[] sourceArray, V value, V defaultValue, boolean isCircle)
V
- sourceArray
- value
- value of target elementdefaultValue
- default return valueisCircle
- whether is circlepublic static <V> V getNext(V[] sourceArray, V value, V defaultValue, boolean isCircle)
V
- sourceArray
- value
- value of target elementdefaultValue
- default return valueisCircle
- whether is circlepublic static <V> V getLast(V[] sourceArray, V value, boolean isCircle)
ArrayUtils#getLast(Object[], Object, Object, boolean)} defaultValue is null
public static <V> V getNext(V[] sourceArray, V value, boolean isCircle)
ArrayUtils#getNext(Object[], Object, Object, boolean)} defaultValue is null
public static long getLast(long[] sourceArray, long value, long defaultValue, boolean isCircle)
ArrayUtils#getLast(Object[], Object, Object, boolean)} Object is Long
public static long getNext(long[] sourceArray, long value, long defaultValue, boolean isCircle)
ArrayUtils#getNext(Object[], Object, Object, boolean)} Object is Long
public static int getLast(int[] sourceArray, int value, int defaultValue, boolean isCircle)
ArrayUtils#getLast(Object[], Object, Object, boolean)} Object is Integer
public static int getNext(int[] sourceArray, int value, int defaultValue, boolean isCircle)
ArrayUtils#getNext(Object[], Object, Object, boolean)} Object is Integer
public static void iteratorArrayList(java.util.ArrayList arrayList)
public static void iteratorList(java.util.List inputList)
public static void iteratorHashMap(java.util.HashMap<java.lang.String,java.lang.Object> hashMap)
public static void iteratorHashMapString(java.util.HashMap<java.lang.String,java.lang.String> map)
public static boolean isEquals(java.lang.Object actual, java.lang.Object expected)
actual
- expected
- Object.equals(Object)
public static java.lang.Long[] transformLongArray(long[] source)
source
- public static long[] transformLongArray(java.lang.Long[] source)
source
- public static java.lang.Integer[] transformIntArray(int[] source)
source
- public static int[] transformIntArray(java.lang.Integer[] source)
source
-