Modifier and Type | Field and Description |
---|---|
static int |
CAPACITY
Initial default size for new arrays.
|
static double |
RESIZE
Default factor for resizing dynamic arrays.
|
Modifier and Type | Method and Description |
---|---|
static int[] |
add(int[] array,
int entry)
Adds an entry to the end of an array and returns the new array.
|
static <T> T[] |
add(T[] array,
T entry)
Adds an entry to the end of an array and returns the new array.
|
static <T> T[] |
add(T[] array,
T[] target,
T entry)
Adds an entry to the end of an array and returns the specified new array.
|
static <T> T[] |
copy(T[] source,
T[] target)
Copies entries from one array to another.
|
static byte[][] |
copyOf(byte[][] array,
int size)
Copies the specified array.
|
static int[][] |
copyOf(int[][] array,
int size)
Copies the specified array.
|
static String[] |
copyOf(String[] array,
int size)
Copies the specified array.
|
static int[] |
createOrder(byte[][] values,
boolean numeric,
boolean ascending)
Sorts the specified tokens and returns an integer array with offsets to the sorted tokens.
|
static int[] |
createOrder(double[] values,
boolean ascending)
Sorts the specified doubles and returns an integer array with offsets to the sorted doubles.
|
static int[] |
createOrder(int[] values,
boolean ascending)
Sorts the specified integers and returns an integer array with offsets to the sorted integers.
|
static <T> T[] |
delete(T[] array,
int pos)
Removes an array entry at the specified position.
|
static void |
move(Object array,
int pos,
int off,
int size)
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[] array)
Reverses the order of the elements in the given array.
|
static void |
reverse(Object[] array,
int pos,
int len)
Reverses the order of all elements in the given interval.
|
public static final int CAPACITY
public static final double RESIZE
public static byte[][] copyOf(byte[][] array, int size)
array
- array to be copiedsize
- new array sizepublic static int[][] copyOf(int[][] array, int size)
array
- array to be copiedsize
- new array sizepublic static String[] copyOf(String[] array, int size)
array
- array to be copiedsize
- new array sizepublic static <T> T[] add(T[] array, T entry)
T
- array typearray
- array to be resizedentry
- entry to be addedpublic static <T> T[] add(T[] array, T[] target, T entry)
T
- array typearray
- array to be resizedtarget
- target array (must have one more entry than the source array)entry
- entry to be addedpublic static int[] add(int[] array, int entry)
array
- array to be resizedentry
- entry to be addedpublic static void move(Object array, int pos, int off, int size)
array
- arraypos
- positionoff
- move offsetsize
- number of entries to movepublic static <T> T[] copy(T[] source, T[] target)
T
- object typesource
- source arraytarget
- target arraypublic static <T> T[] delete(T[] array, int pos)
T
- array typearray
- array to be resizedpos
- positionpublic static int[] createOrder(byte[][] values, boolean numeric, boolean ascending)
values
- values to sort bynumeric
- numeric sortascending
- ascendingpublic static int[] createOrder(double[] values, boolean ascending)
values
- values to sort byascending
- ascendingpublic static int[] createOrder(int[] values, boolean ascending)
values
- values to sort byascending
- ascendingpublic static void reverse(byte[] array)
array
- arraypublic static void reverse(Object[] array, int pos, int len)
array
- 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 1Copyright © 2005–2015 BaseX Team. All rights reserved.