public final class Array
extends java.lang.Object
Arrays class of Java.| Modifier and Type | Field and Description |
|---|---|
static double |
RESIZE
Default factor for resizing dynamic arrays.
|
| Modifier and Type | Method and Description |
|---|---|
static int[] |
add(int[] ar,
int e)
Adds an entry to the end of an array and returns the new array.
|
static <T> T[] |
add(T[] ar,
T e)
Adds an entry to the end of an array and returns the new array.
|
static byte[][] |
copyOf(byte[][] a,
int s)
Copies the specified array.
|
static int[][] |
copyOf(int[][] a,
int s)
Copies the specified array.
|
static java.lang.String[] |
copyOf(java.lang.String[] a,
int s)
Copies the specified array.
|
static int[] |
createOrder(byte[][] tok,
boolean num,
boolean asc)
Sorts the specified tokens and returns an integer array
with offsets to of the sorted tokens.
|
static int[] |
createOrder(double[] tok,
boolean asc)
Sorts the specified numeric tokens and returns an integer array
with offsets to of the sorted tokens.
|
static int[] |
createOrder(int[] tok,
boolean asc)
Sorts the specified numeric tokens and returns an integer array
with offsets to of the sorted tokens.
|
static <T> T[] |
delete(T[] ar,
int p)
Removes an array entry at the specified position.
|
static void |
move(java.lang.Object ar,
int pos,
int off,
int l)
Moves entries inside an array.
|
static int |
newSize(int old)
Returns a value for a new array size, which will always be larger than
the specified value.
|
static int |
newSize(int old,
double factor)
Returns a value for a new array size, which will always be larger than
the specified value.
|
static void |
reverse(byte[] arr)
Reverses the order of the elements in the given array.
|
static void |
reverse(java.lang.Object[] arr,
int pos,
int len)
Reverses the order of all elements in the given interval.
|
static void |
swap(int[] arr,
int a,
int b)
Swaps two entries of the given int array.
|
static void |
swap(int[] arr,
int a,
int b,
int n)
Swaps arr[a ..
|
public static final double RESIZE
public static byte[][] copyOf(byte[][] a,
int s)
a - array to be copieds - new array sizepublic static int[][] copyOf(int[][] a,
int s)
a - array to be copieds - new array sizepublic static java.lang.String[] copyOf(java.lang.String[] a,
int s)
a - array to be copieds - new array sizepublic static <T> T[] add(T[] ar,
T e)
T - array typear - array to be resizede - entry to be addedpublic static int[] add(int[] ar,
int e)
ar - array to be resizede - entry to be addedpublic static void move(java.lang.Object ar,
int pos,
int off,
int l)
ar - arraypos - positionoff - move offsetl - lengthpublic static <T> T[] delete(T[] ar,
int p)
T - array typear - array to be resizedp - positionpublic static int[] createOrder(byte[][] tok,
boolean num,
boolean asc)
tok - token array to sort bynum - numeric sortasc - ascendingpublic static int[] createOrder(double[] tok,
boolean asc)
tok - token array to sort byasc - ascendingpublic static int[] createOrder(int[] tok,
boolean asc)
tok - token array to sort byasc - ascendingpublic static void reverse(byte[] arr)
arr - arraypublic static void reverse(java.lang.Object[] arr,
int pos,
int len)
arr - arraypos - position of first element of the intervallen - length of the intervalpublic static int newSize(int old)
old - old sizepublic static int newSize(int old,
double factor)
old - old sizefactor - resize factor; must be larger than or equal to 1public static void swap(int[] arr,
int a,
int b)
arr - arraya - first positionb - second positionpublic static void swap(int[] arr,
int a,
int b,
int n)
arr - order arraya - first offsetb - second offsetn - number of values