|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.planx.util.Array
public final class Array
| Method Summary | ||
|---|---|---|
static
|
asUnmodifiableList(E[] arr)
|
|
static int |
compareTo(byte[] b1,
byte[] b2)
Compare to arrays (according to the Comparable.compareTo comparison convention) lexicographically. |
|
static byte[] |
ensureCapacity(byte[] arr,
int size,
int minCapacity)
See ensureCapacity(int[],int,int). |
|
static CharSequence[][] |
ensureCapacity(CharSequence[][] arr,
int size,
int minCapacity)
See ensureCapacity(int[],int,int). |
|
static CharSequence[] |
ensureCapacity(CharSequence[] arr,
int size,
int minCapacity)
See ensureCapacity(int[],int,int). |
|
static int[][] |
ensureCapacity(int[][] arr,
int size,
int minCapacity)
See ensureCapacity(int[],int,int). |
|
static int[] |
ensureCapacity(int[] arr,
int size,
int minCapacity)
Takes an array as argument and returns an array containing the same elements, but where it is ensured that the array can contain the specified minimum number of elements. |
|
static List[] |
ensureCapacity(List[] arr,
int size,
int minCapacity)
See ensureCapacity(int[],int,int). |
|
static Object[] |
ensureCapacity(Object[] arr,
int size,
int minCapacity)
See ensureCapacity(int[],int,int). |
|
static int |
indexOf(byte[] array,
byte value,
int off,
int len)
Find the first occurrence of a value in an array starting from the offset and looking no further than offset plus the length. |
|
static byte[] |
setLength(byte[] arr,
int length)
See setLength(int[], int). |
|
static int[] |
setLength(int[] arr,
int length)
Sets the length of the array to the specified length. |
|
static
|
unmodifiableCopy(E[] arr)
|
|
static
|
unmodifiableCopy(List<E> list)
Returns a shallow, immutable copy of the specified List. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static int indexOf(byte[] array,
byte value,
int off,
int len)
array - the array to search invalue - the value to look foroff - the offset to start atlen - the maximal length to search through
public static int compareTo(byte[] b1,
byte[] b2)
b1 - first array to compareb2 - second array to compare
public static int[] ensureCapacity(int[] arr,
int size,
int minCapacity)
size is the current number of
used slots in the array, and minCapacity is the minimum number
of slots required. If the length of the array is lower or equal to
minCapacity, the same array arr is returned.
Otherwise, a new array is allocated and the size first
elements of arr is copied to the new array. The length of the
new array is not specified, other than it is larger than
minCapacity.
Typical use, given an Iterator variable it:
int size = 0;
int[] arr = new int[10];
while (it.hasNext()) {
arr = Array.ensureCapacity(arr, size, size+1);
arr[size++] = it.next().hashCode();
}
public static int[][] ensureCapacity(int[][] arr,
int size,
int minCapacity)
ensureCapacity(int[],int,int).
public static byte[] ensureCapacity(byte[] arr,
int size,
int minCapacity)
ensureCapacity(int[],int,int).
public static CharSequence[] ensureCapacity(CharSequence[] arr,
int size,
int minCapacity)
ensureCapacity(int[],int,int).
public static CharSequence[][] ensureCapacity(CharSequence[][] arr,
int size,
int minCapacity)
ensureCapacity(int[],int,int).
public static List[] ensureCapacity(List[] arr,
int size,
int minCapacity)
ensureCapacity(int[],int,int).
public static Object[] ensureCapacity(Object[] arr,
int size,
int minCapacity)
ensureCapacity(int[],int,int).
public static int[] setLength(int[] arr,
int length)
length elements is copied into a new array
with the specified length. If the array is smaller than this length,
all elements are copied into the beginning of a new array with the specified
length.
public static byte[] setLength(byte[] arr,
int length)
setLength(int[], int).
public static <E> List<E> unmodifiableCopy(List<E> list)
List.
public static <E> List<E> unmodifiableCopy(E[] arr)
public static <E> List<E> asUnmodifiableList(E[] arr)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||