Package javajs.util
Class AU
java.lang.Object
javajs.util.AU
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean[]
arrayCopyBool
(boolean[] array, int newLength) static byte[]
arrayCopyByte
(byte[] array, int newLength) static float[]
arrayCopyF
(float[] array, int newLength) static int[]
arrayCopyI
(int[] array, int newLength) static int[][]
arrayCopyII
(int[][] array, int newLength) static Object
arrayCopyObject
(Object array, int newLength) note -- cannot copy if array is null! does not copy if length is unchangedstatic T3[]
arrayCopyPt
(T3[] array, int newLength) static int[]
arrayCopyRangeI
(int[] array, int i0, int n) a specialized method that allows copying from a starting point either to the end or to the middle (color schemes, especially)static int[]
arrayCopyRangeRevI
(int[] array, int i0, int n) static String[]
arrayCopyS
(String[] array, int newLength) static short[]
arrayCopyShort
(short[] array, int newLength) static <type> Lst<type>[]
createArrayOfArrayList
(int size) Helper method for creating a List[] without warnings. static <K,
V> Map<K, V>[] createArrayOfHashtable
(int size) Helper method for creating a Mapinvalid input: '<'K, V>[] without warnings.static Object
deleteElements
(Object array, int firstElement, int nElements) static Object
doubleLength
(Object array) Very important that this not be used with Int32Array or Float32Array, because it is not initialized to all zeros in MSIE 9.static boolean[]
doubleLengthBool
(boolean[] array) static byte[]
doubleLengthByte
(byte[] array) static float[]
doubleLengthF
(float[] array) static int[]
doubleLengthI
(int[] array) static String[]
doubleLengthS
(String[] array) static short[]
doubleLengthShort
(short[] array) static String
static String
dumpIntArray
(int[] A, int n) static Object
ensureLength
(Object array, int minimumLength) Very important that this not be used with Int32Array or Float32Array, because it is not initialized to all zeros in MSIE 9.static float[]
ensureLengthA
(float[] array, int minimumLength) static byte[]
ensureLengthByte
(byte[] array, int minimumLength) static int[]
ensureLengthI
(int[] array, int minimumLength) static String[]
ensureLengthS
(String[] array, int minimumLength) static short[]
ensureLengthShort
(short[] array, int minimumLength) static byte[]
ensureSignedBytes
(byte[] b) Ensure that we have signed and not unsigned bytes coming out of any process, but particularly out of file reading.static int
static boolean
static boolean
static boolean
static boolean
static boolean
static boolean
static boolean
static boolean
static boolean
static boolean
static boolean
static boolean
static boolean
static byte[][]
newByte2
(int n) static double[][]
newDouble2
(int n) static double[][][]
newDouble3n
(int n) static float[][]
newFloat2
(int n) static float[][][]
newFloat3
(int nx, int ny) static int[][]
newInt2
(int n) static int[][][]
newInt3
(int nx, int ny) static int[][][][]
newInt4
(int n) static short[][]
newShort2
(int n) static int
removeMapKeys
(Map<String, ?> map, String root) remove all keys from a map that start with given rootstatic String
sortedItem
(Lst<String> v, int n) static void
static void
swapInt
(int[] array, int indexA, int indexB)
-
Constructor Details
-
AU
public AU()
-
-
Method Details
-
ensureLength
Very important that this not be used with Int32Array or Float32Array, because it is not initialized to all zeros in MSIE 9.- Parameters:
array
-minimumLength
-- Returns:
- array
-
ensureLengthS
-
ensureLengthA
public static float[] ensureLengthA(float[] array, int minimumLength) -
ensureLengthI
public static int[] ensureLengthI(int[] array, int minimumLength) -
ensureLengthShort
public static short[] ensureLengthShort(short[] array, int minimumLength) -
ensureLengthByte
public static byte[] ensureLengthByte(byte[] array, int minimumLength) -
doubleLength
Very important that this not be used with Int32Array or Float32Array, because it is not initialized to all zeros in MSIE 9.- Parameters:
array
-- Returns:
- array
-
doubleLengthS
-
doubleLengthF
public static float[] doubleLengthF(float[] array) -
doubleLengthI
public static int[] doubleLengthI(int[] array) -
doubleLengthShort
public static short[] doubleLengthShort(short[] array) -
doubleLengthByte
public static byte[] doubleLengthByte(byte[] array) -
doubleLengthBool
public static boolean[] doubleLengthBool(boolean[] array) -
deleteElements
-
arrayCopyObject
note -- cannot copy if array is null! does not copy if length is unchanged- Parameters:
array
-newLength
-- Returns:
- array
-
getLength
-
arrayCopyS
-
arrayCopyII
public static int[][] arrayCopyII(int[][] array, int newLength) -
arrayCopyPt
-
arrayCopyF
public static float[] arrayCopyF(float[] array, int newLength) -
arrayCopyI
public static int[] arrayCopyI(int[] array, int newLength) -
arrayCopyRangeI
public static int[] arrayCopyRangeI(int[] array, int i0, int n) a specialized method that allows copying from a starting point either to the end or to the middle (color schemes, especially)- Parameters:
array
-i0
-n
-- Returns:
- array or null
-
arrayCopyRangeRevI
public static int[] arrayCopyRangeRevI(int[] array, int i0, int n) -
arrayCopyShort
public static short[] arrayCopyShort(short[] array, int newLength) -
arrayCopyByte
public static byte[] arrayCopyByte(byte[] array, int newLength) -
arrayCopyBool
public static boolean[] arrayCopyBool(boolean[] array, int newLength) -
swapInt
public static void swapInt(int[] array, int indexA, int indexB) -
dumpArray
-
dumpIntArray
-
sortedItem
-
createArrayOfArrayList
Helper method for creating a List[] without warnings. - Type Parameters:
type
- Type of objects in the list.- Parameters:
size
- Array size.- Returns:
- Array of List
-
createArrayOfHashtable
Helper method for creating a Mapinvalid input: '<'K, V>[] without warnings.- Type Parameters:
K
- Type of object for the keys in the map.V
- Type of object for the values in the map.- Parameters:
size
- Array size.- Returns:
- Array of Mapinvalid input: '<'K, V>
-
swap
-
newFloat2
public static float[][] newFloat2(int n) -
newInt2
public static int[][] newInt2(int n) -
newInt3
public static int[][][] newInt3(int nx, int ny) -
newFloat3
public static float[][][] newFloat3(int nx, int ny) -
newInt4
public static int[][][][] newInt4(int n) -
newShort2
public static short[][] newShort2(int n) -
newByte2
public static byte[][] newByte2(int n) -
newDouble2
public static double[][] newDouble2(int n) -
newDouble3n
public static double[][][] newDouble3n(int n) -
removeMapKeys
remove all keys from a map that start with given root- Parameters:
map
-root
-- Returns:
- number removed
-
isAS
-
isASS
-
isAP
-
isAF
-
isAFloat
-
isAD
-
isADD
-
isADDD
-
isAB
-
isAI
-
isAII
-
isAFF
-
isAFFF
-
ensureSignedBytes
public static byte[] ensureSignedBytes(byte[] b) Ensure that we have signed and not unsigned bytes coming out of any process, but particularly out of file reading.- Parameters:
b
-- Returns:
- b
-