Modifier and Type | Field and Description |
---|---|
static int |
INITIAL_CAPACITY
Initial default size for new arrays.
|
static int |
MAX_CAPACITY
Maximum capacity for new arrays.
|
static int |
MAX_SIZE
Maximum array size (see
MAX_ARRAY_SIZE variable in ArrayList ). |
static double |
RESIZE_CAPACITY
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 int |
checkCapacity(long size)
Raises an exception if the specified size exceeds the maximum array size.
|
static void |
copy(Object array,
int index,
int length,
Object target,
int trgIndex)
Copies first entries from one array to another array.
|
static void |
copy(Object source,
int length,
Object target)
Copies first entries from one array to another array.
|
static <T> T[] |
copy(T[] source,
T[] target)
Copies entries from one array to another array.
|
static void |
copyFromStart(Object source,
int length,
Object target,
int index)
Copies first entries from one array to another array.
|
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 void |
copyToStart(Object source,
int index,
int length,
Object target)
Copies first entries from one array to beginning of another array.
|
static int[] |
createOrder(byte[][] values,
boolean numeric,
boolean ascending)
Sorts the specified tokens and returns an array with offsets to the sorted array.
|
static int[] |
createOrder(double[] values,
boolean ascending)
Sorts the specified double values and returns an array with offsets to the sorted array.
|
static int[] |
createOrder(int[] values,
boolean ascending)
Sorts the specified int values and returns an array with offsets to the sorted array.
|
static int[] |
createOrder(long[] values,
boolean ascending)
Sorts the specified long values and returns an array with offsets to the sorted array.
|
static boolean |
equals(byte[][] tokens1,
byte[][] tokens2)
Compares two token arrays for equality.
|
static boolean |
equals(Object[] arr1,
Object[] arr2)
Compares two arrays for equality.
|
static int |
initialCapacity(long size)
Returns an initial array capacity, which will not exceed
MAX_CAPACITY . |
static void |
insert(Object array,
int index,
int add,
int length,
Object entries)
Inserts entries into an array.
|
static int |
newCapacity(int size)
Returns a value for a new array size, which will always be larger than the old size.
|
static int |
newCapacity(int size,
double factor)
Returns a value for a new array size, which will always be larger than the old size.
|
static IntList |
number(int size)
Returns an enumerated integer list.
|
static void |
remove(Object array,
int index,
int del,
int length)
Removes entries inside an array.
|
static <T> T[] |
remove(T[] array,
int index)
Removes an array entry at the specified position.
|
public static final int MAX_SIZE
MAX_ARRAY_SIZE
variable in ArrayList
).public static final int INITIAL_CAPACITY
public static final int MAX_CAPACITY
public static final double RESIZE_CAPACITY
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 int[] add(int[] array, int entry)
array
- array to be resizedentry
- entry to be addedpublic static void insert(Object array, int index, int add, int length, Object entries)
array
- arrayindex
- insertion indexadd
- number of entries to addlength
- number of valid array entriesentries
- entries to be inserted (can be null
)public static void remove(Object array, int index, int del, int length)
array
- arrayindex
- index of first entry to be removeddel
- number of entries to removelength
- number of valid array entriespublic static void copy(Object array, int index, int length, Object target, int trgIndex)
array
- source arrayindex
- index of source arraylength
- number of array entries to be copiedtarget
- target arraytrgIndex
- index of target arraypublic static void copy(Object source, int length, Object target)
source
- source arraylength
- number of array entries to be copiedtarget
- target arraypublic static void copyFromStart(Object source, int length, Object target, int index)
source
- source arraylength
- number of array entries to be copiedtarget
- target arrayindex
- target indexpublic static void copyToStart(Object source, int index, int length, Object target)
source
- source arrayindex
- index of first entry to copylength
- number of array entries to be copiedtarget
- target arraypublic static <T> T[] copy(T[] source, T[] target)
T
- object typesource
- source arraytarget
- target arraypublic static <T> T[] remove(T[] array, int index)
T
- array typearray
- array to be resizedindex
- index of entrypublic static int[] createOrder(byte[][] values, boolean numeric, boolean ascending)
values
- values to sort by (will be sorted as well)numeric
- numeric sortascending
- ascendingpublic static int[] createOrder(double[] values, boolean ascending)
values
- values to sort by (will be sorted as well)ascending
- ascendingpublic static int[] createOrder(int[] values, boolean ascending)
values
- values to sort by (will be sorted as well)ascending
- ascendingpublic static int[] createOrder(long[] values, boolean ascending)
values
- values to sort by (will be sorted as well)ascending
- ascendingpublic static IntList number(int size)
size
- array sizepublic static int initialCapacity(long size)
MAX_CAPACITY
.size
- size expected result size (ignored if negative)public static int newCapacity(int size)
size
- old array capacitypublic static int newCapacity(int size, double factor)
size
- old array capacityfactor
- resize factor; must be larger than or equal to 1public static int checkCapacity(long size)
size
- array capacity0
if the argument is negativepublic static boolean equals(byte[][] tokens1, byte[][] tokens2)
tokens1
- first tokens (can be null
)tokens2
- second tokens (can be null
)Copyright © 2005–2023 BaseX Team. All rights reserved.