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 String[] |
copyOf(String[] a,
int s)
Copies the specified array.
|
static <T> T[] |
delete(T[] ar,
int p)
Removes an array entry at the specified position.
|
static void |
move(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(byte[] arr,
int pos,
int len)
Reverses the order of all elements in the given interval.
|
static void |
reverse(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 String[] copyOf(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(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 void reverse(byte[] arr)
arr
- arraypublic static void reverse(byte[] arr, int pos, int len)
arr
- arraypos
- position of first element of the intervallen
- length of the intervalpublic static void reverse(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 valuesCopyright © 2013 University of Konstanz, Distributed Systems Group. All Rights Reserved.