|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.basex.util.Array
public final class Array
This class provides convenience methods for handling arrays.
Field Summary | |
---|---|
static int[] |
NOINTS
Empty integer array. |
static int[][] |
NOINTS2
Empty integer array. |
Method Summary | ||
---|---|---|
static byte[][] |
add(byte[][] ar,
byte[] e)
Resizes an array and adds an entry at the end. |
|
static int[] |
add(int[] ar,
int e)
Resizes an array and adds an entry at the end. |
|
static
|
add(T[] ar,
T e)
Resizes an array and adds an entry at the end. |
|
static
|
check(T[] ar,
int s)
Doubles the array size if necessary. |
|
static void |
copy(byte[] src,
byte[] trg,
int s)
Copies the source token into the target token. |
|
static void |
copy(java.lang.Object[] src,
java.lang.Object[] trg,
int s)
Copies the source array into the target array, starting from the specified offset. |
|
static byte[] |
create(byte[] src,
int pos,
int len)
Creates a new array from the source array and with the specified length. |
|
static boolean[] |
extend(boolean[] ar)
Doubles the array size. |
|
static byte[] |
extend(byte[] ar)
Doubles the array size. |
|
static byte[][] |
extend(byte[][] ar)
Doubles the array size. |
|
static int[] |
extend(int[] ar)
Doubles the array size. |
|
static int[][] |
extend(int[][] ar)
Doubles the array size. |
|
static long[] |
extend(long[] ar)
Doubles the array size. |
|
static java.lang.String[] |
extend(java.lang.String[] ar)
Doubles the array size. |
|
static
|
extend(T[] ar)
Doubles the array size. |
|
static boolean[] |
finish(boolean[] ar,
int size)
Optimizes the array size. |
|
static byte[][] |
finish(byte[][] ar,
int size)
Optimizes the array size. |
|
static byte[] |
finish(byte[] ar,
int size)
Optimizes the array size. |
|
static double[] |
finish(double[] ar,
int size)
Optimizes the array size. |
|
static int[] |
finish(int[] ar,
int size)
Optimizes the array size. |
|
static java.lang.String[] |
finish(java.lang.String[] ar,
int size)
Optimizes the array size. |
|
static
|
finish(T[] ar,
int size)
Optimizes the array size. |
|
static void |
move(java.lang.Object ar,
int pos,
int off,
int l)
Moves entries inside an array. |
|
static boolean[] |
resize(boolean[] ar,
int os,
int ns)
Convenience method for resizing a boolean array. |
|
static byte[][] |
resize(byte[][] ar,
int os,
int ns)
Convenience method for resizing a two-dimensional byte array. |
|
static byte[] |
resize(byte[] ar,
int os,
int ns)
Convenience method for resizing a byte array. |
|
static double[] |
resize(double[] ar,
int os,
int ns)
Convenience method for resizing a double array. |
|
static int[][] |
resize(int[][] ar,
int os,
int ns)
Convenience method for resizing an integer array. |
|
static int[] |
resize(int[] ar,
int os,
int ns)
Convenience method for resizing an integer array. |
|
static long[] |
resize(long[] ar,
int os,
int ns)
Convenience method for resizing an integer array. |
|
static java.lang.String[] |
resize(java.lang.String[] ar,
int os,
int ns)
Convenience method for resizing a String array. |
|
static
|
resize(T[] ar,
int os,
int ns)
Convenience method for resizing a generic array. |
|
static java.lang.String |
toString(byte[] a,
int sp,
int ep)
Converts an byte-array to string. |
|
static java.lang.String |
toString(int[] a,
int sp,
int ep)
Converts an int-array to string. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int[] NOINTS
public static final int[][] NOINTS2
Method Detail |
---|
public static boolean[] extend(boolean[] ar)
ar
- array to be resized
public static int[] extend(int[] ar)
ar
- array to be resized
public static int[][] extend(int[][] ar)
ar
- array to be resized
public static long[] extend(long[] ar)
ar
- array to be resized
public static byte[] extend(byte[] ar)
ar
- array to be resized
public static byte[][] extend(byte[][] ar)
ar
- array to be resized
public static java.lang.String[] extend(java.lang.String[] ar)
ar
- array to be resized
public static <T> T[] extend(T[] ar)
T
- array typear
- array to be resized
public static <T> T[] check(T[] ar, int s)
T
- array typear
- array to be resizeds
- array size
public static byte[][] add(byte[][] ar, byte[] e)
ar
- array to be resizede
- entry to be added
public static int[] add(int[] ar, int e)
ar
- array to be resizede
- entry to be added
public static <T> T[] add(T[] ar, T e)
T
- array typear
- array to be resizede
- entry to be added
public static int[] finish(int[] ar, int size)
ar
- array to be resizedsize
- final size
public static double[] finish(double[] ar, int size)
ar
- array to be resizedsize
- final size
public static java.lang.String[] finish(java.lang.String[] ar, int size)
ar
- array to be resizedsize
- final size
public static boolean[] finish(boolean[] ar, int size)
ar
- array to be resizedsize
- final size
public static byte[] finish(byte[] ar, int size)
ar
- array to be resizedsize
- final size
public static byte[][] finish(byte[][] ar, int size)
ar
- array to be resizedsize
- final size
public static <T> T[] finish(T[] ar, int size)
T
- array typear
- array to be resizedsize
- final size
public static java.lang.String[] resize(java.lang.String[] ar, int os, int ns)
ar
- array to be resizedos
- old sizens
- new size
public static int[] resize(int[] ar, int os, int ns)
ar
- array to be resizedos
- old sizens
- new size
public static double[] resize(double[] ar, int os, int ns)
ar
- array to be resizedos
- old sizens
- new size
public static int[][] resize(int[][] ar, int os, int ns)
ar
- array to be resizedos
- old sizens
- new size
public static long[] resize(long[] ar, int os, int ns)
ar
- array to be resizedos
- old sizens
- new size
public static boolean[] resize(boolean[] ar, int os, int ns)
ar
- array to be resizedos
- old sizens
- new size
public static byte[] resize(byte[] ar, int os, int ns)
ar
- array to be resizedos
- old sizens
- new size
public static byte[][] resize(byte[][] ar, int os, int ns)
ar
- array to be resizedos
- old sizens
- new size
public static <T> T[] resize(T[] ar, int os, int ns)
T
- array typear
- array to be resizedos
- old sizens
- new size
public static void copy(byte[] src, byte[] trg, int s)
src
- source arraytrg
- target arrays
- start positionpublic static void copy(java.lang.Object[] src, java.lang.Object[] trg, int s)
src
- source arraytrg
- target arrays
- start positionpublic static byte[] create(byte[] src, int pos, int len)
src
- source arraypos
- array positionlen
- array length
public static void move(java.lang.Object ar, int pos, int off, int l)
ar
- arraypos
- positionoff
- move offsetl
- lengthpublic static java.lang.String toString(int[] a, int sp, int ep)
sp
- index of first int valuea
- array with valuesep
- index of last int value
public static java.lang.String toString(byte[] a, int sp, int ep)
sp
- index of first int valuea
- array with valuesep
- index of last int value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |