public class ArraysX extends Object
| Constructor and Description |
|---|
ArraysX() |
| Modifier and Type | Method and Description |
|---|---|
static <T> List<T> |
asList(T[] ary)
Returns a mutable list.
|
static <T> List<List<T>> |
asList(T[][] ary)
Returns a two dimensional mutable list.
|
static Object |
clone(Object ary)
Deprecated.
As of release 6.0.0, replaced with
duplicate(Object). |
static Object |
concat(Object ary,
Object ary1)
Concatenates the two specified array.
|
static <T> T[] |
concat(T[] ary,
T[] ary1)
Concatenates the two specified generic array.
|
static Object |
duplicate(Object ary)
Duplicates the specified array.
|
static Object |
duplicate(Object ary,
int jb,
int je)
Duplicates the specified array.
|
static <T> T[] |
duplicate(T[] ary)
Duplicates the specified generic array.
|
static <T> T[] |
duplicate(T[] ary,
int jb,
int je)
Duplicates the specified generic array.
|
static Object |
resize(Object ary,
int size)
Resizes the specified array.
|
static <T> T[] |
resize(T[] ary,
int size)
Resizes the specified generic array.
|
static Object |
shrink(Object ary,
int jb,
int je)
Shrink the specified array.
|
static <T> T[] |
shrink(T[] ary,
int jb,
int je)
Shrink the specified array.
|
static String |
toHexString(byte[] array)
Returns the hex String representation of a byte array without prefix 0x.
|
static String |
toOctalString(byte[] array,
String prefix)
Returns the octal String representation of a byte array with optional
prefix.
|
static String |
toString(boolean[] array)
Converts an array of boolean to a readable string (for debugging purpose).
|
static String |
toString(byte[] array)
Converts an array of byte to a readable string (for debugging purpose).
|
static String |
toString(char[] array)
Converts an array of char to a readable string (for debugging purpose).
|
static String |
toString(double[] array)
Converts an array of char to a readable string (for debugging purpose).
|
static String |
toString(float[] array)
Converts an array of float to a readable string (for debugging purpose).
|
static String |
toString(int[] array)
Converts an array of int to a readable string (for debugging purpose).
|
static String |
toString(long[] array)
Converts an array of long to a readable string (for debugging purpose).
|
static String |
toString(Object[] array)
Converts an array to a readable string (for debugging purpose).
|
static String |
toString(short[] array)
Converts an array of short to a readable string (for debugging purpose).
|
public static final String toString(Object[] array)
public static final String toString(int[] array)
public static final String toString(long[] array)
public static final String toString(short[] array)
public static final String toString(byte[] array)
public static final String toString(char[] array)
public static final String toString(boolean[] array)
public static final String toString(float[] array)
public static final String toString(double[] array)
public static final String toHexString(byte[] array)
array - the byte arraypublic static final String toOctalString(byte[] array, String prefix)
array - the byte arraypublic static final Object duplicate(Object ary, int jb, int je)
The array could be an array of objects or primitives.
ary - the arrayjb - the beginning index (included)je - the ending index (excluded)IllegalArgumentException - if ary is not any arrayIndexOutOfBoundsException - if out of boundspublic static final <T> T[] duplicate(T[] ary,
int jb,
int je)
The array could be an array of objects or primitives.
ary - the arrayjb - the beginning index (included)je - the ending index (excluded)IllegalArgumentException - if ary is not any arrayIndexOutOfBoundsException - if out of boundspublic static final Object duplicate(Object ary)
ary - the arrayIllegalArgumentException - if ary is not any arrayIndexOutOfBoundsException - if out of boundspublic static final <T> T[] duplicate(T[] ary)
ary - the arrayIllegalArgumentException - if ary is not any arrayIndexOutOfBoundsException - if out of boundspublic static final Object concat(Object ary, Object ary1)
The array could be an array of objects or primitives.
ary - the arrayary1 - the arrayIllegalArgumentException - if ary and ary1 component types are not compatiblepublic static final <T> T[] concat(T[] ary,
T[] ary1)
The array could be an array of objects or primitives.
ary - the arrayary1 - the arrayIllegalArgumentException - if ary and ary1 component types are not compatiblepublic static final Object shrink(Object ary, int jb, int je)
ary - the arrayjb - the beginning index (included)je - the ending index (excluded)IllegalArgumentException - if ary is not any arrayIndexOutOfBoundsException - if out of boundspublic static final <T> T[] shrink(T[] ary,
int jb,
int je)
ary - the arrayjb - the beginning index (included)je - the ending index (excluded)IllegalArgumentException - if ary is not any arrayIndexOutOfBoundsException - if out of boundspublic static final <T> List<T> asList(T[] ary)
Never be null.
ary - the data arraypublic static final <T> List<List<T>> asList(T[][] ary)
Never be null.
ary - the two dimensional data arrayasList(Object[])public static final Object resize(Object ary, int size)
shrink(java.lang.Object, int, int), but
it can enlarge and it keeps elements from the first.public static final <T> T[] resize(T[] ary,
int size)
public static final Object clone(Object ary)
duplicate(Object).Copyright © 2018. All rights reserved.