java.lang.Object
ushiosan.jvm_utilities.internal.collection.ArrsGeneric
ushiosan.jvm_utilities.internal.collection.ArrsPrimitive
ushiosan.jvm_utilities.lang.collection.Arrs
- All Implemented Interfaces:
IArrsConstants
Utility class for handling arrays
-
Field Summary
Fields inherited from class ushiosan.jvm_utilities.internal.collection.ArrsPrimitive
CONVERSION_MAPFields inherited from interface ushiosan.jvm_utilities.internal.collection.IArrsConstants
BYTE_EMPTY, CHAR_EMPTY, DOUBLE_EMPTY, EMPTY_SIZE, FLOAT_EMPTY, INDEX_NOT_FOUND, INT_EMPTY, LONG_EMPTY, OBJ_EMPTY, SHORT_EMPTY -
Method Summary
Modifier and TypeMethodDescriptiontoObjectArray(boolean[] array) Convert any array to object array.toObjectArray(byte[] array) Convert any array to object array.toObjectArray(char[] array) Convert any array to object array.toObjectArray(double[] array) Convert any array to object array.toObjectArray(float[] array) Convert any array to object array.toObjectArray(int[] array) Convert any array to object array.toObjectArray(long[] array) Convert any array to object array.toObjectArray(short[] array) Convert any array to object array.toObjectArray(T @NotNull [] array) Convert any array to object array.toUnsafeObjectArray(@NotNull Object array) Convert any array to object array.Methods inherited from class ushiosan.jvm_utilities.internal.collection.ArrsPrimitive
booleanOf, byteOf, charOf, contains, contains, contains, contains, contains, contains, contains, contentEquals, contentEquals, contentEquals, contentEquals, contentEquals, contentEquals, contentEquals, doubleOf, floatOf, indexOf, indexOf, indexOf, indexOf, indexOf, indexOf, indexOf, intOf, lastElement, lastElement, lastElement, lastElement, lastElement, lastElement, lastElement, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, longOf, numberOf, shortOf, toNumberArray, toNumberArray, toNumberArray, toNumberArray, toNumberArray, toNumberArray, transformByte, transformByte, transformChar, transformChar, transformDouble, transformDouble, transformFloat, transformFloat, transformInt, transformInt, transformLong, transformLong, transformShort, transformShort, unsafeLastElement, unsafeLastElement, unsafeLastElement, unsafeLastElement, unsafeLastElement, unsafeLastElement, unsafeLastElementMethods inherited from class ushiosan.jvm_utilities.internal.collection.ArrsGeneric
contains, contentEquals, indexOf, join, join, joinAll, joinAll, lastElement, lastIndexOf, of, of, transform, transform, unsafeLastElement
-
Method Details
-
toUnsafeObjectArray
Convert any array to object array. This also applies to primitive types.Examples
// For numeric primitives always use Number class Integer[] intArr = (Integer[]) ArraysImpl.toObjectArray(new int[] {2, 4, 6, 8}); Short[] shortArr = (Short[]) ArraysImpl.toObjectArray(new short[] {12, 21, 42, 120, 0xFF}); Float[] floatArr = (Float[]) ArraysImpl.toObjectArray(new float[] {1f, 2f, 3f, 120.2234f}); // Wrapped clases Boolean[] boolArr = (Boolean[]) ArraysImpl.toObjectArray(new boolean[] {true, false, false, true}); Character[] intArr = (Character[]) ArraysImpl.toObjectArray(new char[] {'H', 'e', 'l', 'l', 'o'});- Parameters:
array- the array to convert- Returns:
- a converted array object
- Throws:
IllegalArgumentException- Error if the object is not valid array
-
toObjectArray
Convert any array to object array. This also applies to primitive types.Examples
// For numeric primitives always use Number class Integer[] intArr = (Integer[]) ArraysImpl.toObjectArray(new int[] {2, 4, 6, 8}); Short[] shortArr = (Short[]) ArraysImpl.toObjectArray(new short[] {12, 21, 42, 120, 0xFF}); Float[] floatArr = (Float[]) ArraysImpl.toObjectArray(new float[] {1f, 2f, 3f, 120.2234f}); // Wrapped clases Boolean[] boolArr = (Boolean[]) ArraysImpl.toObjectArray(new boolean[] {true, false, false, true}); Character[] intArr = (Character[]) ArraysImpl.toObjectArray(new char[] {'H', 'e', 'l', 'l', 'o'});- Type Parameters:
T- the data type of the array- Parameters:
array- the array to convert- Returns:
- a converted array object
-
toObjectArray
Convert any array to object array. This also applies to primitive types.Examples
// For numeric primitives always use Number class Integer[] intArr = (Integer[]) ArraysImpl.toObjectArray(new int[] {2, 4, 6, 8}); Short[] shortArr = (Short[]) ArraysImpl.toObjectArray(new short[] {12, 21, 42, 120, 0xFF}); Float[] floatArr = (Float[]) ArraysImpl.toObjectArray(new float[] {1f, 2f, 3f, 120.2234f}); // Wrapped clases Boolean[] boolArr = (Boolean[]) ArraysImpl.toObjectArray(new boolean[] {true, false, false, true}); Character[] intArr = (Character[]) ArraysImpl.toObjectArray(new char[] {'H', 'e', 'l', 'l', 'o'});- Parameters:
array- the array to convert- Returns:
- a converted array object
-
toObjectArray
Convert any array to object array. This also applies to primitive types.Examples
// For numeric primitives always use Number class Integer[] intArr = (Integer[]) ArraysImpl.toObjectArray(new int[] {2, 4, 6, 8}); Short[] shortArr = (Short[]) ArraysImpl.toObjectArray(new short[] {12, 21, 42, 120, 0xFF}); Float[] floatArr = (Float[]) ArraysImpl.toObjectArray(new float[] {1f, 2f, 3f, 120.2234f}); // Wrapped clases Boolean[] boolArr = (Boolean[]) ArraysImpl.toObjectArray(new boolean[] {true, false, false, true}); Character[] intArr = (Character[]) ArraysImpl.toObjectArray(new char[] {'H', 'e', 'l', 'l', 'o'});- Parameters:
array- the array to convert- Returns:
- a converted array object
-
toObjectArray
Convert any array to object array. This also applies to primitive types.Examples
// For numeric primitives always use Number class Integer[] intArr = (Integer[]) ArraysImpl.toObjectArray(new int[] {2, 4, 6, 8}); Short[] shortArr = (Short[]) ArraysImpl.toObjectArray(new short[] {12, 21, 42, 120, 0xFF}); Float[] floatArr = (Float[]) ArraysImpl.toObjectArray(new float[] {1f, 2f, 3f, 120.2234f}); // Wrapped clases Boolean[] boolArr = (Boolean[]) ArraysImpl.toObjectArray(new boolean[] {true, false, false, true}); Character[] intArr = (Character[]) ArraysImpl.toObjectArray(new char[] {'H', 'e', 'l', 'l', 'o'});- Parameters:
array- the array to convert- Returns:
- a converted array object
-
toObjectArray
Convert any array to object array. This also applies to primitive types.Examples
// For numeric primitives always use Number class Integer[] intArr = (Integer[]) ArraysImpl.toObjectArray(new int[] {2, 4, 6, 8}); Short[] shortArr = (Short[]) ArraysImpl.toObjectArray(new short[] {12, 21, 42, 120, 0xFF}); Float[] floatArr = (Float[]) ArraysImpl.toObjectArray(new float[] {1f, 2f, 3f, 120.2234f}); // Wrapped clases Boolean[] boolArr = (Boolean[]) ArraysImpl.toObjectArray(new boolean[] {true, false, false, true}); Character[] intArr = (Character[]) ArraysImpl.toObjectArray(new char[] {'H', 'e', 'l', 'l', 'o'});- Parameters:
array- the array to convert- Returns:
- a converted array object
-
toObjectArray
Convert any array to object array. This also applies to primitive types.Examples
// For numeric primitives always use Number class Integer[] intArr = (Integer[]) ArraysImpl.toObjectArray(new int[] {2, 4, 6, 8}); Short[] shortArr = (Short[]) ArraysImpl.toObjectArray(new short[] {12, 21, 42, 120, 0xFF}); Float[] floatArr = (Float[]) ArraysImpl.toObjectArray(new float[] {1f, 2f, 3f, 120.2234f}); // Wrapped clases Boolean[] boolArr = (Boolean[]) ArraysImpl.toObjectArray(new boolean[] {true, false, false, true}); Character[] intArr = (Character[]) ArraysImpl.toObjectArray(new char[] {'H', 'e', 'l', 'l', 'o'});- Parameters:
array- the array to convert- Returns:
- a converted array object
-
toObjectArray
Convert any array to object array. This also applies to primitive types.Examples
// For numeric primitives always use Number class Integer[] intArr = (Integer[]) ArraysImpl.toObjectArray(new int[] {2, 4, 6, 8}); Short[] shortArr = (Short[]) ArraysImpl.toObjectArray(new short[] {12, 21, 42, 120, 0xFF}); Float[] floatArr = (Float[]) ArraysImpl.toObjectArray(new float[] {1f, 2f, 3f, 120.2234f}); // Wrapped clases Boolean[] boolArr = (Boolean[]) ArraysImpl.toObjectArray(new boolean[] {true, false, false, true}); Character[] intArr = (Character[]) ArraysImpl.toObjectArray(new char[] {'H', 'e', 'l', 'l', 'o'});- Parameters:
array- the array to convert- Returns:
- a converted array object
-
toObjectArray
Convert any array to object array. This also applies to primitive types.Examples
// For numeric primitives always use Number class Integer[] intArr = (Integer[]) ArraysImpl.toObjectArray(new int[] {2, 4, 6, 8}); Short[] shortArr = (Short[]) ArraysImpl.toObjectArray(new short[] {12, 21, 42, 120, 0xFF}); Float[] floatArr = (Float[]) ArraysImpl.toObjectArray(new float[] {1f, 2f, 3f, 120.2234f}); // Wrapped clases Boolean[] boolArr = (Boolean[]) ArraysImpl.toObjectArray(new boolean[] {true, false, false, true}); Character[] intArr = (Character[]) ArraysImpl.toObjectArray(new char[] {'H', 'e', 'l', 'l', 'o'});- Parameters:
array- the array to convert- Returns:
- a converted array object
-
toObjectArray
Convert any array to object array. This also applies to primitive types.Examples
// For numeric primitives always use Number class Integer[] intArr = (Integer[]) ArraysImpl.toObjectArray(new int[] {2, 4, 6, 8}); Short[] shortArr = (Short[]) ArraysImpl.toObjectArray(new short[] {12, 21, 42, 120, 0xFF}); Float[] floatArr = (Float[]) ArraysImpl.toObjectArray(new float[] {1f, 2f, 3f, 120.2234f}); // Wrapped clases Boolean[] boolArr = (Boolean[]) ArraysImpl.toObjectArray(new boolean[] {true, false, false, true}); Character[] intArr = (Character[]) ArraysImpl.toObjectArray(new char[] {'H', 'e', 'l', 'l', 'o'});- Parameters:
array- the array to convert- Returns:
- a converted array object
-