Package xal.tools

Class ArrayValue

java.lang.Object
java.lang.Number
xal.tools.ArrayValue
All Implemented Interfaces:
Serializable

public abstract class ArrayValue extends Number
ArrayStore is the base class of a class cluster which manages the storage of an array of primitive types and String. It includes factory methods to instantiate storage of specific types.
Author:
tap
See Also:
  • Field Details

    • array

      protected transient Object array
      the array of data
  • Constructor Details

    • ArrayValue

      protected ArrayValue()
      Empty constructor
    • ArrayValue

      protected ArrayValue(Object anArray)
      Primary constructor to override
  • Method Details

    • getCount

      public final int getCount()
      get the length of the array
    • getType

      public final Class<?> getType()
      get the native type of the array
    • toString

      public String toString()
      override toString() to return a string value
      Overrides:
      toString in class Object
    • byteValue

      public final byte byteValue()
      get the first element value as a byte
      Overrides:
      byteValue in class Number
    • byteValueAt

      public abstract byte byteValueAt(int index)
    • byteArray

      public abstract byte[] byteArray()
    • shortValue

      public final short shortValue()
      get the first element value as a short
      Overrides:
      shortValue in class Number
    • shortValueAt

      public abstract short shortValueAt(int index)
    • shortArray

      public abstract short[] shortArray()
    • intValue

      public final int intValue()
      get the first element value as an int
      Specified by:
      intValue in class Number
    • intValueAt

      public abstract int intValueAt(int index)
    • intArray

      public abstract int[] intArray()
    • longValue

      public final long longValue()
      get the first element value as a long
      Specified by:
      longValue in class Number
    • longValueAt

      public abstract long longValueAt(int index)
    • longArray

      public abstract long[] longArray()
    • floatValue

      public final float floatValue()
      get the first element value as a float
      Specified by:
      floatValue in class Number
    • floatValueAt

      public abstract float floatValueAt(int index)
    • floatArray

      public abstract float[] floatArray()
    • doubleValue

      public final double doubleValue()
      get the first element value as a double
      Specified by:
      doubleValue in class Number
    • doubleValueAt

      public abstract double doubleValueAt(int index)
    • doubleArray

      public abstract double[] doubleArray()
    • stringValue

      public final String stringValue()
      get the first element value as a String
    • stringValueAt

      public abstract String stringValueAt(int index)
    • stringArray

      public abstract String[] stringArray()
    • byteStore

      public static ArrayValue byteStore(byte[] newArray)
      Factory method to instantiate a new ArrayValue store for the byte array type
    • byteStore

      public static ArrayValue byteStore(byte scalar)
      Factory method to instantiate a new ArrayValue store for the byte scalar type
    • shortStore

      public static ArrayValue shortStore(short[] newArray)
      Factory method to instantiate a new ArrayValue store for the short array type
    • shortStore

      public static ArrayValue shortStore(short scalar)
      Factory method to instantiate a new ArrayValue store for the short scalar type
    • intStore

      public static ArrayValue intStore(int[] newArray)
      Factory method to instantiate a new ArrayValue store for the int array type
    • intStore

      public static ArrayValue intStore(int scalar)
      Factory method to instantiate a new ArrayValue store for the int scalar type
    • longStore

      public static ArrayValue longStore(long[] newArray)
      Factory method to instantiate a new ArrayValue store for the long array type
    • longStore

      public static ArrayValue longStore(long scalar)
      Factory method to instantiate a new ArrayValue store for the long scalar type
    • floatStore

      public static ArrayValue floatStore(float[] newArray)
      Factory method to instantiate a new ArrayValue store for the float array type
    • floatStore

      public static ArrayValue floatStore(float scalar)
      Factory method to instantiate a new ArrayValue store for the float scalar type
    • doubleStore

      public static ArrayValue doubleStore(double[] newArray)
      Factory method to instantiate a new ArrayValue store for the double array type
    • doubleStore

      public static ArrayValue doubleStore(double scalar)
      Factory method to instantiate a new ArrayValue store for the double scalar type
    • numberStore

      public static ArrayValue numberStore(Number number)
      Factory method to instantiate a new ArrayValue store from a Number.
      Parameters:
      number - The number to represent.
      Returns:
      The ArrayValue representation
    • stringStore

      public static ArrayValue stringStore(String[] newArray)
      Factory method to instantiate a new ArrayValue store for the String array type
    • stringStore

      public static ArrayValue stringStore(String scalar)
      Factory method to instantiate a new ArrayValue store for the String scalar type
    • arrayValueFromArray

      public static ArrayValue arrayValueFromArray(Object newArray) throws IllegalArgumentException
      Create a new ArrayValue from an Object array. Inspect the array type to create the proper kind of storage.
      Throws:
      IllegalArgumentException