public class ManArrayExt
extends java.lang.Object
Self to enforce type-safety with both the array type and
the array component type.| Constructor and Description |
|---|
ManArrayExt() |
| Modifier and Type | Method and Description |
|---|---|
static int |
binarySearch(java.lang.Object array,
int from,
int to,
java.lang.Object key) |
static int |
binarySearch(java.lang.Object array,
int from,
int to,
java.lang.Object key,
java.util.Comparator<? super java.lang.Object> comparator) |
static int |
binarySearch(java.lang.Object array,
java.lang.Object key) |
static int |
binarySearch(java.lang.Object array,
java.lang.Object key,
java.util.Comparator<? super java.lang.Object> comparator) |
static java.lang.Object |
copy(java.lang.Object array) |
static java.lang.Object |
copy(java.lang.Object array,
int newLength)
Copies this array's elements into a new array of the specified
newLength. |
static java.lang.Object |
copyRange(java.lang.Object array,
int from,
int to)
Copies a range of elements from this array to a newly allocated array.
|
static java.lang.Object |
copyRangeTo(java.lang.Object array,
int from,
int to,
java.lang.Object target,
int targetIndex)
Copies a range of elements from this array to the
target array. |
static java.lang.Object |
copyTo(java.lang.Object array,
java.lang.Object to)
Copies the elements of this array to a specified array, truncating or padding with nulls as needed.
|
static boolean |
equals(java.lang.Object array,
java.lang.Object that) |
static java.lang.Object |
first(java.lang.Object array) |
static void |
forEach(java.lang.Object array,
IndexedConsumer<? super java.lang.Object> action) |
static int |
hashCode(java.lang.Object array) |
static boolean |
isEmpty(java.lang.Object array) |
static boolean |
isNullOrEmpty(java.lang.Object array) |
static java.lang.Object |
last(java.lang.Object array) |
static java.util.Spliterator<java.lang.Object> |
spliterator(java.lang.Object array) |
static java.util.stream.Stream<java.lang.Object> |
stream(java.lang.Object array)
Returns a sequential
Stream with this array as its source. |
static java.util.List<java.lang.Object> |
toList(java.lang.Object array)
Returns a fixed-size list backed by the specified array.
|
static java.lang.String |
toString(java.lang.Object array) |
public static java.util.List<java.lang.Object> toList(java.lang.Object array)
Collection.toArray(). The returned list is
serializable and implements RandomAccess.public static boolean isEmpty(java.lang.Object array)
public static boolean isNullOrEmpty(java.lang.Object array)
public static java.lang.Object first(java.lang.Object array)
public static java.lang.Object last(java.lang.Object array)
public static java.lang.Object copy(java.lang.Object array)
public static java.lang.Object copy(java.lang.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 java.lang.Object copyTo(java.lang.Object array,
java.lang.Object to)
public static java.lang.Object copyRange(java.lang.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 java.lang.Object copyRangeTo(java.lang.Object array,
int from,
int to,
java.lang.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 java.util.stream.Stream<java.lang.Object> stream(java.lang.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(java.lang.Object array,
IndexedConsumer<? super java.lang.Object> action)
public static java.util.Spliterator<java.lang.Object> spliterator(java.lang.Object array)
public static int binarySearch(java.lang.Object array,
java.lang.Object key)
public static int binarySearch(java.lang.Object array,
int from,
int to,
java.lang.Object key)
public static int binarySearch(java.lang.Object array,
java.lang.Object key,
java.util.Comparator<? super java.lang.Object> comparator)
public static int binarySearch(java.lang.Object array,
int from,
int to,
java.lang.Object key,
java.util.Comparator<? super java.lang.Object> comparator)
public static java.lang.String toString(java.lang.Object array)
public static int hashCode(java.lang.Object array)
public static boolean equals(java.lang.Object array,
java.lang.Object that)
Copyright © 2024. All rights reserved.