Constructor and Description |
---|
ManArrayExt() |
Modifier and Type | Method and Description |
---|---|
static int |
binarySearch(Object array,
int from,
int to,
Object key) |
static int |
binarySearch(Object array,
int from,
int to,
Object key,
Comparator<? super Object> comparator) |
static int |
binarySearch(Object array,
Object key) |
static int |
binarySearch(Object array,
Object key,
Comparator<? super Object> comparator) |
static Object |
copy(Object array) |
static Object |
copy(Object array,
int newLength)
Copies this array's elements into a new array of the specified
newLength . |
static Object |
copyRange(Object array,
int from,
int to)
Copies a range of elements from this array to a newly allocated array.
|
static Object |
copyRangeTo(Object array,
int from,
int to,
Object target,
int targetIndex)
Copies a range of elements from this array to the
target array. |
static Object |
copyTo(Object array,
Object to)
Copies the elements of this array to a specified array, truncating or padding with nulls as needed.
|
static boolean |
equals(Object array,
Object that) |
static Object |
first(Object array) |
static void |
forEach(Object array,
IndexedConsumer<? super Object> action) |
static int |
hashCode(Object array) |
static boolean |
isEmpty(Object array) |
static boolean |
isNullOrEmpty(Object array) |
static Object |
last(Object array) |
static Spliterator<Object> |
spliterator(Object array) |
static Stream<Object> |
stream(Object array)
Returns a sequential
Stream with this array as its source. |
static List<Object> |
toList(Object array)
Returns a fixed-size list backed by the specified array.
|
static String |
toString(Object array) |
public static List<Object> toList(Object array)
Collection.toArray()
. The returned list is
serializable and implements RandomAccess
.public static boolean isEmpty(Object array)
public static boolean isNullOrEmpty(Object array)
public static Object copy(Object array, int newLength)
newLength
. If newLength
is < 0, the
new array's size matches this array, otherwise the new array is truncated or padded with null
as newLength
differs from this array's length.newLength
- The length of the new array. If < 0, the resulting array's length matches this array, otherwise the
resulting array is truncated or padded with null
accordingly.public static Object copyTo(Object array, Object to)
public static Object copyRange(Object array, int from, int to)
to
< 0, the range contains
the remainder of this array's elements.from
- The start point of the range, inclusive.to
- The endpoint of the range, exclusive. A negative value may be used as a convenience to use this array's endpoint.public static Object copyRangeTo(Object array, int from, int to, Object target, int targetIndex)
target
array. Note, if to
< 0, the range contains
the remainder of this array's elements.from
- The starting point of the range, inclusive.to
- The endpoint of the range, exclusive. A negative value may be used as a convenience to use this array's endpoint.target
array containing the specified range of elements from this array.public static Stream<Object> stream(Object array)
Stream
with this array as its source. Note, this array is assumed to be unmodified
during useStream
for the arraypublic static void forEach(Object array, IndexedConsumer<? super Object> action)
public static Spliterator<Object> spliterator(Object array)
public static int binarySearch(Object array, Object key, Comparator<? super Object> comparator)
public static int binarySearch(Object array, int from, int to, Object key, Comparator<? super Object> comparator)
public static int hashCode(Object array)
Copyright © 2024. All rights reserved.