Package xal.tools
Class ArrayValue
java.lang.Object
java.lang.Number
xal.tools.ArrayValue
- All Implemented Interfaces:
Serializable
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 Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEmpty constructorprotectedArrayValue(Object anArray) Primary constructor to override -
Method Summary
Modifier and TypeMethodDescriptionstatic ArrayValuearrayValueFromArray(Object newArray) Create a new ArrayValue from an Object array.abstract byte[]static ArrayValuebyteStore(byte scalar) Factory method to instantiate a new ArrayValue store for the byte scalar typestatic ArrayValuebyteStore(byte[] newArray) Factory method to instantiate a new ArrayValue store for the byte array typefinal byteget the first element value as a byteabstract bytebyteValueAt(int index) abstract double[]static ArrayValuedoubleStore(double scalar) Factory method to instantiate a new ArrayValue store for the double scalar typestatic ArrayValuedoubleStore(double[] newArray) Factory method to instantiate a new ArrayValue store for the double array typefinal doubleget the first element value as a doubleabstract doubledoubleValueAt(int index) abstract float[]static ArrayValuefloatStore(float scalar) Factory method to instantiate a new ArrayValue store for the float scalar typestatic ArrayValuefloatStore(float[] newArray) Factory method to instantiate a new ArrayValue store for the float array typefinal floatget the first element value as a floatabstract floatfloatValueAt(int index) final intgetCount()get the length of the arrayfinal Class<?>getType()get the native type of the arrayabstract int[]intArray()static ArrayValueintStore(int scalar) Factory method to instantiate a new ArrayValue store for the int scalar typestatic ArrayValueintStore(int[] newArray) Factory method to instantiate a new ArrayValue store for the int array typefinal intintValue()get the first element value as an intabstract intintValueAt(int index) abstract long[]static ArrayValuelongStore(long scalar) Factory method to instantiate a new ArrayValue store for the long scalar typestatic ArrayValuelongStore(long[] newArray) Factory method to instantiate a new ArrayValue store for the long array typefinal longget the first element value as a longabstract longlongValueAt(int index) static ArrayValuenumberStore(Number number) Factory method to instantiate a new ArrayValue store from a Number.abstract short[]static ArrayValueshortStore(short scalar) Factory method to instantiate a new ArrayValue store for the short scalar typestatic ArrayValueshortStore(short[] newArray) Factory method to instantiate a new ArrayValue store for the short array typefinal shortget the first element value as a shortabstract shortshortValueAt(int index) abstract String[]static ArrayValuestringStore(String scalar) Factory method to instantiate a new ArrayValue store for the String scalar typestatic ArrayValuestringStore(String[] newArray) Factory method to instantiate a new ArrayValue store for the String array typefinal Stringget the first element value as a Stringabstract StringstringValueAt(int index) toString()override toString() to return a string value
-
Field Details
-
array
the array of data
-
-
Constructor Details
-
ArrayValue
protected ArrayValue()Empty constructor -
ArrayValue
Primary constructor to override
-
-
Method Details
-
getCount
public final int getCount()get the length of the array -
getType
get the native type of the array -
toString
override toString() to return a string value -
byteValue
public final byte byteValue()get the first element value as a byte -
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:
shortValuein classNumber
-
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 -
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 -
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:
floatValuein classNumber
-
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:
doubleValuein classNumber
-
doubleValueAt
public abstract double doubleValueAt(int index) -
doubleArray
public abstract double[] doubleArray() -
stringValue
get the first element value as a String -
stringValueAt
-
stringArray
-
byteStore
Factory method to instantiate a new ArrayValue store for the byte array type -
byteStore
Factory method to instantiate a new ArrayValue store for the byte scalar type -
shortStore
Factory method to instantiate a new ArrayValue store for the short array type -
shortStore
Factory method to instantiate a new ArrayValue store for the short scalar type -
intStore
Factory method to instantiate a new ArrayValue store for the int array type -
intStore
Factory method to instantiate a new ArrayValue store for the int scalar type -
longStore
Factory method to instantiate a new ArrayValue store for the long array type -
longStore
Factory method to instantiate a new ArrayValue store for the long scalar type -
floatStore
Factory method to instantiate a new ArrayValue store for the float array type -
floatStore
Factory method to instantiate a new ArrayValue store for the float scalar type -
doubleStore
Factory method to instantiate a new ArrayValue store for the double array type -
doubleStore
Factory method to instantiate a new ArrayValue store for the double scalar type -
numberStore
Factory method to instantiate a new ArrayValue store from a Number.- Parameters:
number- The number to represent.- Returns:
- The ArrayValue representation
-
stringStore
Factory method to instantiate a new ArrayValue store for the String array type -
stringStore
Factory method to instantiate a new ArrayValue store for the String scalar type -
arrayValueFromArray
Create a new ArrayValue from an Object array. Inspect the array type to create the proper kind of storage.- Throws:
IllegalArgumentException
-