Package javajs.util

Class AU

java.lang.Object
javajs.util.AU

public final class AU extends Object
  • Constructor Details

    • AU

      public AU()
  • Method Details

    • ensureLength

      public 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.
      Parameters:
      array -
      minimumLength -
      Returns:
      array
    • ensureLengthS

      public static String[] ensureLengthS(String[] array, int minimumLength)
    • 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

      public 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.
      Parameters:
      array -
      Returns:
      array
    • doubleLengthS

      public static String[] doubleLengthS(String[] array)
    • 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

      public static Object deleteElements(Object array, int firstElement, int nElements)
    • arrayCopyObject

      public static Object arrayCopyObject(Object array, int newLength)
      note -- cannot copy if array is null! does not copy if length is unchanged
      Parameters:
      array -
      newLength -
      Returns:
      array
    • getLength

      public static int getLength(Object array)
    • arrayCopyS

      public static String[] arrayCopyS(String[] array, int newLength)
    • arrayCopyII

      public static int[][] arrayCopyII(int[][] array, int newLength)
    • arrayCopyPt

      public static T3[] arrayCopyPt(T3[] array, int newLength)
    • 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

      public static String dumpArray(String msg, float[][] A, int x1, int x2, int y1, int y2)
    • dumpIntArray

      public static String dumpIntArray(int[] A, int n)
    • sortedItem

      public static String sortedItem(Lst<String> v, int n)
    • createArrayOfArrayList

      public static <type> Lst<type>[] createArrayOfArrayList(int size)
      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

      public static <K, V> Map<K,V>[] createArrayOfHashtable(int size)
      Helper method for creating a Map<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 Map<K, V>
    • swap

      public static void swap(Object[] o, int i, int j)
    • 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

      public static int removeMapKeys(Map<String,?> map, String root)
      remove all keys from a map that start with given root
      Parameters:
      map -
      root -
      Returns:
      number removed
    • isAS

      public static boolean isAS(Object x)
    • isASS

      public static boolean isASS(Object x)
    • isAP

      public static boolean isAP(Object x)
    • isAF

      public static boolean isAF(Object x)
    • isAFloat

      public static boolean isAFloat(Object x)
    • isAD

      public static boolean isAD(Object x)
    • isADD

      public static boolean isADD(Object x)
    • isADDD

      public static boolean isADDD(Object x)
    • isAB

      public static boolean isAB(Object x)
    • isAI

      public static boolean isAI(Object x)
    • isAII

      public static boolean isAII(Object x)
    • isAFF

      public static boolean isAFF(Object x)
    • isAFFF

      public static boolean isAFFF(Object x)
    • 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