Class ArrayMethods
java.lang.Object
org.klojang.util.ArrayMethods
Methods for working with arrays.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T[]append(T[] array, T obj) Appends an element to an array.static <T> T[]append(T[] array, T obj0, T obj1, T... moreObjs) Appends multiple elements to an array.asList(boolean[] values) Converts abooleanarray to aList<Boolean>.asList(byte[] values) Converts abytearray to aList<Byte>.asList(char[] values) Converts achararray to aList<Character>.asList(double[] values) Converts adoublearray to aList<Double>.asList(float[] values) Converts afloatarray to aList<Float>.asList(int[] values) Converts anintarray to aList<Integer>.asList(long[] values) Converts alongarray to aList<Long>.asList(short[] values) Converts ashortarray to aList<Short>.static Boolean[]box(boolean[] values) Converts abooleanarray to aBooleanarray.static Byte[]box(byte[] values) Converts abytearray to aBytearray.static Character[]box(char[] values) Converts achararray to aCharacterarray.static Double[]box(double[] values) Converts adoublearray to aDoublearray.static Float[]box(float[] values) Converts afloatarray to aFloatarray.static Integer[]box(int[] values) Converts anintarray to anIntegerarray.static Long[]box(long[] values) Converts alongarray to aLongarray.static Short[]box(short[] values) Converts ashortarray to aShortarray.static char[]chars(char... chars) Simply returns the specified array, but allows for leaner code when statically imported.static <T> T[]concat(T[] arr0, T[] arr1) Concatenates two arrays.static <T> T[]concat(T[] arr0, T[] arr1, T[] arr2, T[]... moreArrays) Concatenates multiple arrays into a single array.static intdeepHashCode(Object array) Returns the deep hash code of an array.static double[]doubles(double... doubles) Simply returns the specified array, but allows for leaner code when statically imported.static OptionalIntfind(int[] array, IntPredicate test) Returns the first array element that passes the specified test, or an emptyOptionalIntif no element passed the test.static <T> org.klojang.check.extra.Result<T> Returns the first array element that passes the specified test, orResult.notAvailable()if no element passed the test.static <T,R> org.klojang.check.extra.Result <R> Returns aResultcontaining a property of the first array element that passes the specified test, orResult.notAvailable()if no element passed the test.static float[]floats(float... floats) Simply returns the specified array, but allows for leaner code when statically imported.static intReturns the hash code of an array.static <T> Stringimplode(T[] array) PHP-style implode method, concatenating the array elements using ", " (comma+space) as separator.static <T> Stringimplode(T[] array, int limit) PHP-style implode method, concatenating at mostlimitarray elements using ", " (comma+space) as separator.static <T> StringPHP-style implode method, concatenating the array elements using the specified separator.static <T> StringPHP-style implode method, concatenating at mostlimitarray elements using the specified separator.static <T> StringPHP-style implode method, concatenating at mostlimitarray elements using ", " (comma+space) as separator.static <T> StringPHP-style implode method, concatenating at mostlimitarray elements using ", " (comma+space) as separator.static <T> StringPHP-style implode method.static StringimplodeAny(Object array) PHP-style implode method, concatenating the array elements using ", " (comma+space) as separator.static StringimplodeAny(Object array, int limit) PHP-style implode method, concatenating at mostlimitarray elements using ", " (comma+space) as separator.static StringimplodeAny(Object array, String separator) PHP-style implode method, concatenating the array elements using the specified separator.static StringimplodeAny(Object array, String separator, int limit) PHP-style implode method, concatenating at mostlimitarray elements using the specified separator.static StringimplodeAny(Object array, Function<Object, String> stringifier) PHP-style implode method, concatenating the array elements using ", " (comma+space) as separator.static StringPHP-style implode method, concatenating the array elements using ", " (comma+space) as separator.static StringPHP-style implode method.static StringimplodeInts(int[] array) PHP-style implode method, concatenating the array elements using ", " (comma+space) as separator.static StringimplodeInts(int[] array, int limit) PHP-style implode method, concatenating at mostlimitarray elements using ", " (comma+space) as separator.static StringimplodeInts(int[] array, String separator) PHP-style implode method, concatenating the array elements using the specified separator.static StringimplodeInts(int[] array, String separator, int limit) PHP-style implode method, concatenating at mostlimitarray elements using the specified separator.static StringimplodeInts(int[] array, IntFunction<String> stringifier) PHP-style implode method, concatenating at mostlimitarray elements using ", " (comma+space) as separator.static StringimplodeInts(int[] array, IntFunction<String> stringifier, String separator) PHP-style implode method, concatenating at mostlimitarray elements using ", " (comma+space) as separator.static StringimplodeInts(int[] array, IntFunction<String> stringifier, String separator, int from, int to) PHP-style implode method, optimized forint[]arrays.static OptionalIntindexOf(int[] array, int value) Returns anOptionalIntcontaining the array index of the first occurrence of the specified value within the specified array.static <T> intindexOf(T[] array, T value) Returns the array index of the first occurrence of the specified value within the specified array.static int[]ints(int... ints) Simply returns the specified array, but allows for leaner code when statically imported.static booleanisElementOf(int value, int[] array) Returnstrueif the specified array contains the specified value.static <T> booleanisElementOf(T value, T[] array) Returnstrueif the specified array contains the specified value.static booleanReturnstrueif the specified array contains the specified reference.static OptionalIntlastIndexOf(int[] array, int value) Returns anOptionalIntcontaining the array index of the last occurrence of the specified value within the specified array.static <T> intlastIndexOf(T[] array, T value) Returns the array index of the last occurrence of the specified value within the specified array.static long[]longs(long... longs) Simply returns the specified array, but allows for leaner code when statically imported.static <T> T[]pack(T... objs) Simply returns the specified array, but allows for leaner code when statically imported.static int[]prefix(int[] array, int i) Prefixes the specifiedintto the specified array.static int[]prefix(int[] array, int i0, int i1, int... moreInts) Prefixes the specifiedintto the specified array.static <T> T[]prefix(T[] array, T obj) Prefixes the specified object to the specified array.static <T> T[]prefix(T[] array, T obj0, T obj1, T... moreObjs) Prefixes the specified object to the specified array.static intrefIndexOf(Object[] array, Object reference) Returns the array index of the first occurrence of the specified object, using reference comparisons to identify the object.static intrefLastIndexOf(Object[] array, Object reference) Returns the array index of the last occurrence of the specified object, using reference comparisons to identify the object.static int[]repeat(int value, int length) Returns an array of the specified length, filled with the specified value.static int[]reverse(int[] array) Reverses the order of the elements in the specified array.static int[]reverse(int[] array, int from, int to) Reverses the order of the elements in the specified array segmentstatic <T> T[]reverse(T[] array) Reverses the order of the elements in the specified array.static <T> T[]reverse(T[] array, int from, int to) Reverses the order of the elements in the specified array segment.static int[]Converts anIntegerarray to anintarray.static int[]Converts anIntegerarray to anintarray.
-
Field Details
-
EMPTY_OBJECT_ARRAY
A zero-length Object array. -
EMPTY_STRING_ARRAY
A zero-length String array. -
EMPTY_INT_ARRAY
public static final int[] EMPTY_INT_ARRAYA zero-lengthintarray. -
EMPTY_LONG_ARRAY
public static final long[] EMPTY_LONG_ARRAYA zero-lengthlongarray.
-
-
Method Details
-
append
public static <T> T[] append(T[] array, T obj) Appends an element to an array.- Type Parameters:
T- the type of the array elements- Parameters:
array- the array to append the object toobj- the object to append- Returns:
- a new array containing the original array plus the extra element
-
append
Appends multiple elements to an array.- Type Parameters:
T- the type of the array elements- Parameters:
array- the array to append the objects toobj0- the 1st object to appendobj1- the 2nd object to appendmoreObjs- more objects to append- Returns:
- a new array containing the original array plus the extra elements
-
concat
public static <T> T[] concat(T[] arr0, T[] arr1) Concatenates two arrays.- Type Parameters:
T- the type of the array elements- Parameters:
arr0- The 1st array to go into the new arrayarr1- The 2nd array to go into the new array- Returns:
- a new array containing all elements of the specified arrays
-
concat
Concatenates multiple arrays into a single array.- Type Parameters:
T- the type of the array elements- Parameters:
arr0- The 1st array to go into the new arrayarr1- The 2nd array to go into the new arrayarr2- The 3rd array to go into the new arraymoreArrays- More arrays to concatenate- Returns:
- a new array containing all elements of the specified arrays
-
isElementOf
public static boolean isElementOf(int value, int[] array) Returnstrueif the specified array contains the specified value.- Parameters:
value- the value to search forarray- the array to search- Returns:
- whether the array contains the value
- See Also:
-
isElementOf
public static <T> boolean isElementOf(T value, T[] array) Returnstrueif the specified array contains the specified value.- Type Parameters:
T- the type of the array elements- Parameters:
value- the value to search forarray- the array to search- Returns:
- whether the array contains the value
- See Also:
-
isOneOf
-
indexOf
Returns anOptionalIntcontaining the array index of the first occurrence of the specified value within the specified array. Returns an emptyOptionalIntif the array does not contain the value.- Parameters:
array- the array to searchvalue- the value to search for- Returns:
- an
OptionalIntcontaining the array index of the value
-
lastIndexOf
Returns anOptionalIntcontaining the array index of the last occurrence of the specified value within the specified array. Returns an emptyOptionalIntif the array does not contain the value.- Parameters:
array- the array to searchvalue- the value to search for- Returns:
- an
OptionalIntcontaining the array index of the value
-
indexOf
public static <T> int indexOf(T[] array, T value) Returns the array index of the first occurrence of the specified value within the specified array. Returns -1 if the array does not contain the value. Searching for null is allowed.- Type Parameters:
T- the type of the elements within the array- Parameters:
array- the array to searchvalue- the value to search for (may be null)- Returns:
- the array index of the value
-
lastIndexOf
public static <T> int lastIndexOf(T[] array, T value) Returns the array index of the last occurrence of the specified value within the specified array. Returns -1 if the array does not contain the value. Searching for null is allowed.- Type Parameters:
T- the type of the elements within the array- Parameters:
array- the array to searchvalue- the value to search for (may be null)- Returns:
- the array index of the value
-
refIndexOf
Returns the array index of the first occurrence of the specified object, using reference comparisons to identify the object. Returns -1 if the array does not contain the specified reference. Searching for null is not allowed.- Parameters:
array- the array to searchreference- The reference to search for (must not be null)- Returns:
- the array index of the reference
-
refLastIndexOf
Returns the array index of the last occurrence of the specified object, using reference comparisons to identify the object. Returns -1 if the array does not contain the specified reference. Searching for null is not allowed.- Parameters:
array- the array to searchreference- The reference to search for (must not be null)- Returns:
- the array index of the reference
-
find
Returns the first array element that passes the specified test, orResult.notAvailable()if no element passed the test.- Type Parameters:
T- the type of the array elements- Parameters:
array- the arraytest- the test- Returns:
- the first array element that passes the specified test, or
Result.notAvailable()if no element passed the test.
-
find
public static <T,R> org.klojang.check.extra.Result<R> find(T[] array, Predicate<T> test, Function<T, R> property) Returns aResultcontaining a property of the first array element that passes the specified test, orResult.notAvailable()if no element passed the test.Person[] persons = getPersons(); find(persons, p -> p.age() < 15, Person::firstName).ifAvailable( name -> System.out.printf("And the winner is ..... %s!!!%n, name); );- Type Parameters:
T- the type of the array elementsR- the type of the value extracted from the array element- Parameters:
array- the arraytest- the testproperty- a function that extracts some value from thr array element- Returns:
- the
Resultcontaining the value extracted from the first array element that passed the specified test, ornullif no element passed the test
-
find
Returns the first array element that passes the specified test, or an emptyOptionalIntif no element passed the test.- Parameters:
array- the arraytest- the test- Returns:
- the first array element that passes the specified test, or an empty
OptionalIntif no element passed the test
-
reverse
public static <T> T[] reverse(T[] array) Reverses the order of the elements in the specified array.- Type Parameters:
T- the type of the array elements- Parameters:
array- the array- Returns:
- the input array
-
reverse
public static <T> T[] reverse(T[] array, int from, int to) Reverses the order of the elements in the specified array segment.- Type Parameters:
T- the type of the array elements- Parameters:
array- the arrayfrom- the start index (inclusive) of the array segmentto- the end index (exclusive) of the array segment- Returns:
- the input array
-
reverse
public static int[] reverse(int[] array) Reverses the order of the elements in the specified array.- Parameters:
array- the array- Returns:
- the input array
-
reverse
public static int[] reverse(int[] array, int from, int to) Reverses the order of the elements in the specified array segment- Parameters:
array- the arrayfrom- the start index (inclusive) of the array segmentto- the end index (exclusive) of the array segment- Returns:
- the input array
-
hashCode
Returns the hash code of an array. Allows you to retrieve the hash code of an array object even if you don't know its exact type. AnIllegalArgumentExceptionis thrown if the argument is not an array.- Parameters:
array- the array- Returns:
- Its hash code
-
deepHashCode
Returns the deep hash code of an array. Allow you to retrieve the deep hash code of an array object even if you don't know its exact type. AnIllegalArgumentExceptionis thrown if the argument is not an array.- Parameters:
array- the array- Returns:
- Its deep hash code
-
implodeInts
PHP-style implode method, concatenating the array elements using ", " (comma+space) as separator. Optimized forint[]arrays.- Parameters:
array- the array to implode- Returns:
- a concatenation of the elements in the array.
-
implodeInts
PHP-style implode method, concatenating the array elements using the specified separator. Optimized forint[]arrays.- Parameters:
array- the array to implodeseparator- the string used to separate the elements- Returns:
- a concatenation of the elements in the array.
-
implodeInts
PHP-style implode method, concatenating at mostlimitarray elements using ", " (comma+space) as separator.- Parameters:
array- the array to implodelimit- The maximum number of elements to collect. The specified number will be clamped toarray.length(i.e. it's OK to specify a number greater thanarray.length). You can specify -1 as a shorthand forarray.length.- Returns:
- a concatenation of the elements in the array.
-
implodeInts
PHP-style implode method, concatenating at mostlimitarray elements using ", " (comma+space) as separator.- Parameters:
array- the array to implodestringifier- AFunctionthat converts the array elements to strings- Returns:
- a concatenation of the elements in the array.
-
implodeInts
PHP-style implode method, concatenating at mostlimitarray elements using ", " (comma+space) as separator.- Parameters:
array- the array to implodestringifier- AFunctionthat converts the array elements to stringsseparator- the string used to separate the elements- Returns:
- a concatenation of the elements in the array.
-
implodeInts
PHP-style implode method, concatenating at mostlimitarray elements using the specified separator.- Parameters:
array- the array to implodeseparator- the string used to separate the elementslimit- The maximum number of elements to collect. The specified number will be clamped toarray.length(i.e. it's OK to specify a number greater thanarray.length). You can specify -1 as a shorthand forarray.length.- Returns:
- a concatenation of the elements in the array.
-
implodeInts
public static String implodeInts(int[] array, IntFunction<String> stringifier, String separator, int from, int to) PHP-style implode method, optimized forint[]arrays.- Parameters:
array- the array to implodestringifier- AFunctionthat converts the array elements to stringsseparator- the string used to separate the elementsfrom- The index of the element to begin the concatenation with (inclusive)to- The index of the element to end the concatenation with (exclusive). The specified number will be clamped toarray.length(i.e. it's OK to specify a number greater thanarray.length). You can specify -1 as a shorthand forarray.length.- Returns:
- a concatenation of the elements in the array.
- See Also:
-
implodeAny
PHP-style implode method, concatenating the array elements using ", " (comma+space) as separator. This method is primarily meant to implode primitive arrays, but you can use it to implode any type of array. AnIllegalArgumentExceptionis thrown ifarrayis not an array.- Parameters:
array- the array to implode- Returns:
- a concatenation of the elements in the array.
- See Also:
-
implodeAny
PHP-style implode method, concatenating the array elements using the specified separator. This method is primarily meant to implode primitive arrays, but you can use it to implode any type of array. AnIllegalArgumentExceptionis thrown ifarrayis not an array.- Parameters:
array- the array to implodeseparator- the string used to separate the elements- Returns:
- a concatenation of the elements in the array.
- See Also:
-
implodeAny
PHP-style implode method, concatenating the array elements using ", " (comma+space) as separator. This method is primarily meant to implode primitive arrays, but you can use it to implode any type of array. AnIllegalArgumentExceptionis thrown ifarrayis not an array.- Parameters:
array- the array to implodestringifier- AFunctionthat converts the array elements to strings- Returns:
- a concatenation of the elements in the array.
- See Also:
-
implodeAny
public static String implodeAny(Object array, Function<Object, String> stringifier, String separator) PHP-style implode method, concatenating the array elements using ", " (comma+space) as separator. This method is primarily meant to implode primitive arrays, but you can use it to implode any type of array. AnIllegalArgumentExceptionis thrown ifarrayis not an array.- Parameters:
array- the array to implodestringifier- AFunctionthat converts the array elements to stringsseparator- the string used to separate the elements- Returns:
- a concatenation of the elements in the array.
- See Also:
-
implodeAny
PHP-style implode method, concatenating at mostlimitarray elements using ", " (comma+space) as separator. This method is primarily meant to implode primitive arrays, but you can use it to implode any type of array. AnIllegalArgumentExceptionis thrown ifarrayis not an array.- Parameters:
array- the array to implodelimit- The maximum number of elements to collect. The specified number will be clamped toarray.length(i.e. it's OK to specify a number greater thanarray.length). You can specify -1 as a shorthand forarray.length.- Returns:
- a concatenation of the elements in the array.
-
implodeAny
PHP-style implode method, concatenating at mostlimitarray elements using the specified separator. This method is primarily meant to implode primitive arrays, but you can use it to implode any type of array. AnIllegalArgumentExceptionis thrown ifarrayis not an array.- Parameters:
array- the array to implodeseparator- the string used to separate the elementslimit- The maximum number of elements to collect. The specified number will be clamped toarray.length(i.e. it's OK to specify a number greater thanarray.length). You can specify -1 as a shorthand forarray.length.- Returns:
- a concatenation of the elements in the array.
-
implodeAny
public static String implodeAny(Object array, Function<Object, String> stringifier, String separator, int from, int to) PHP-style implode method. This method is primarily meant to implode primitive arrays, but you can use it to implode any type of array. AnIllegalArgumentExceptionis thrown ifarrayis not an array.- Parameters:
array- the array to implodestringifier- AFunctionthat converts the array elements to stringsseparator- the string used to separate the elementsfrom- The index of the element to begin the concatenation with (inclusive)to- The index of the element to end the concatenation with (exclusive). The specified number will be clamped toarray.length(i.e. it's OK to specify a number greater thanarray.length). You can specify -1 as a shorthand forarray.length.- Returns:
- a concatenation of the elements in the array.
- See Also:
-
implode
PHP-style implode method, concatenating the array elements using ", " (comma+space) as separator.- Type Parameters:
T- the type of the array elements- Parameters:
array- the collection to implode- Returns:
- a concatenation of the elements in the collection.
- See Also:
-
implode
PHP-style implode method, concatenating the array elements using the specified separator.- Type Parameters:
T- the type of the array elements- Parameters:
array- the array to implodeseparator- the string used to separate the elements- Returns:
- a concatenation of the elements in the array.
- See Also:
-
implode
PHP-style implode method, concatenating at mostlimitarray elements using ", " (comma+space) as separator.- Type Parameters:
T- the type of the array elements- Parameters:
array- the array to implodelimit- The maximum number of elements to collect. The specified number will be clamped toarray.length(i.e. it's OK to specify a number greater thanarray.length). You can specify -1 as a shorthand forarray.length.- Returns:
- a concatenation of the elements in the array.
- See Also:
-
implode
PHP-style implode method, concatenating at mostlimitarray elements using ", " (comma+space) as separator.- Type Parameters:
T- the type of the array elements- Parameters:
array- the array to implodestringifier- AFunctionthat converts the array elements to strings- Returns:
- a concatenation of the elements in the array.
- See Also:
-
implode
PHP-style implode method, concatenating at mostlimitarray elements using ", " (comma+space) as separator.- Type Parameters:
T- the type of the array elements- Parameters:
array- the array to implodestringifier- AFunctionthat converts the array elements to stringsseparator- the string used to separate the elements- Returns:
- a concatenation of the elements in the array.
- See Also:
-
implode
PHP-style implode method, concatenating at mostlimitarray elements using the specified separator.- Type Parameters:
T- the type of the array elements- Parameters:
array- the array to implodeseparator- the string used to separate the elementslimit- The maximum number of elements to collect. The specified number will be clamped toarray.length(i.e. it's OK to specify a number greater thanarray.length). You can specify -1 as a shorthand forarray.length.- Returns:
- a concatenation of the elements in the array.
- See Also:
-
implode
public static <T> String implode(T[] array, Function<T, String> stringifier, String separator, int from, int to) PHP-style implode method.- Type Parameters:
T- the type of the array elements- Parameters:
array- the array to implodestringifier- AFunctionthat converts the array elements to stringsseparator- the string used to separate the elementsfrom- The index of the element to begin the concatenation with (inclusive)to- The index of the element to end the concatenation with (exclusive). The specified number will be clamped toarray.length(i.e. it's OK to specify a number greater thanarray.length). You can specify -1 as a shorthand forarray.length.- Returns:
- a concatenation of the elements in the array.
- See Also:
-
pack
Simply returns the specified array, but allows for leaner code when statically imported.- Type Parameters:
T- the type of the objects to pack- Parameters:
objs- the array- Returns:
- the same array
-
ints
public static int[] ints(int... ints) Simply returns the specified array, but allows for leaner code when statically imported.- Parameters:
ints- the array- Returns:
- the same array
-
chars
public static char[] chars(char... chars) Simply returns the specified array, but allows for leaner code when statically imported.- Parameters:
chars- the array- Returns:
- the same array
-
doubles
public static double[] doubles(double... doubles) Simply returns the specified array, but allows for leaner code when statically imported.- Parameters:
doubles- the array- Returns:
- the same array
-
longs
public static long[] longs(long... longs) Simply returns the specified array, but allows for leaner code when statically imported.- Parameters:
longs- the array- Returns:
- the same array
-
floats
public static float[] floats(float... floats) Simply returns the specified array, but allows for leaner code when statically imported.- Parameters:
floats- The array- Returns:
- the same array
-
prefix
public static <T> T[] prefix(T[] array, T obj) Prefixes the specified object to the specified array.- Type Parameters:
T- the type of the array elements and the object to be prefixed- Parameters:
array- the array to be prefixedobj- the object to prefix- Returns:
- a new array containing the specified object and the elements of the specified array
-
prefix
Prefixes the specified object to the specified array.- Type Parameters:
T- the type of the array elements and the object to be prefixed- Parameters:
array- the array to be prefixedobj0- the 1st object to prefixobj1- the 2nd object to prefixmoreObjs- more objects to prefix- Returns:
- a new array containing the specified objects and the elements of the specified array
-
prefix
public static int[] prefix(int[] array, int i) Prefixes the specifiedintto the specified array.- Parameters:
array- the array to be prefixedi- theintto prefix- Returns:
- a new array containing the specified
intand the elements of the specified array
-
prefix
public static int[] prefix(int[] array, int i0, int i1, int... moreInts) Prefixes the specifiedintto the specified array.- Parameters:
array- the array to be prefixedi0- the 1stintto prefixi1- the 2ndintto prefixmoreInts- moreintvalues to prefix- Returns:
- a new array containing the specified
intvalues and the elements of the specified array
-
repeat
public static int[] repeat(int value, int length) Returns an array of the specified length, filled with the specified value.- Parameters:
value- the value to repeatlength- the number of repetitions- Returns:
- an array of the specified length, filled with the specified value
-
asList
-
asList
-
asList
-
asList
-
asList
-
asList
-
asList
-
asList
-
unbox
Converts anIntegerarray to anintarray.- Parameters:
values- theIntegerarraydfault- Theintvalue to convertnullelements in the source array to- Returns:
- the
intarray
-
unbox
Converts anIntegerarray to anintarray.nullelements in the source array are converted to 0 (zero).- Parameters:
values- theIntegerarray- Returns:
- the
intarray
-
box
Converts anintarray to anIntegerarray.- Parameters:
values- theintarray- Returns:
- the
Integerarray
-
box
Converts adoublearray to aDoublearray.- Parameters:
values- thedoublearray- Returns:
- the
Doublearray
-
box
Converts alongarray to aLongarray.- Parameters:
values- thelongarray- Returns:
- the
Longarray
-
box
Converts afloatarray to aFloatarray.- Parameters:
values- thefloatarray- Returns:
- the
Floatarray
-
box
Converts ashortarray to aShortarray.- Parameters:
values- theshortarray- Returns:
- the
Shortarray
-
box
Converts abytearray to aBytearray.- Parameters:
values- thebytearray- Returns:
- the
Bytearray
-
box
Converts achararray to aCharacterarray.- Parameters:
values- thechararray- Returns:
- the
Characterarray
-
box
Converts abooleanarray to aBooleanarray.- Parameters:
values- thebooleanarray- Returns:
- the
Booleanarray
-