gov.sns.tools
Class ArrayValue

java.lang.Object
  |
  +--java.lang.Number
        |
        +--gov.sns.tools.ArrayValue
All Implemented Interfaces:
java.io.Serializable

public abstract class ArrayValue
extends java.lang.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.

See Also:
Serialized Form

Field Summary
protected  java.lang.Object array
           
 
Constructor Summary
  ArrayValue()
          Create a new instatnce of an empty ArrayStore
protected ArrayValue(java.lang.Object anArray)
          Creates a new instance of ArrayStore
 
Method Summary
static ArrayValue arrayValueFromArray(java.lang.Object newArray)
          Create a new ArrayValue from an Object array.
abstract  byte[] byteArray()
           
static ArrayValue byteStore(byte scalar)
          Factory method to instantiate a new ArrayValue store for the byte scalar type
static ArrayValue byteStore(byte[] newArray)
          Factory method to instantiate a new ArrayValue store for the byte array type
 byte byteValue()
          get the first element value as a byte
abstract  byte byteValueAt(int index)
           
abstract  double[] doubleArray()
           
static ArrayValue doubleStore(double scalar)
          Factory method to instantiate a new ArrayValue store for the double scalar type
static ArrayValue doubleStore(double[] newArray)
          Factory method to instantiate a new ArrayValue store for the double array type
 double doubleValue()
          get the first element value as a double
abstract  double doubleValueAt(int index)
           
abstract  float[] floatArray()
           
static ArrayValue floatStore(float scalar)
          Factory method to instantiate a new ArrayValue store for the float scalar type
static ArrayValue floatStore(float[] newArray)
          Factory method to instantiate a new ArrayValue store for the float array type
 float floatValue()
          get the first element value as a float
abstract  float floatValueAt(int index)
           
 int getCount()
          get the length of the array
 java.lang.Class getType()
          get the native type of the array
abstract  int[] intArray()
           
static ArrayValue intStore(int scalar)
          Factory method to instantiate a new ArrayValue store for the int scalar type
static ArrayValue intStore(int[] newArray)
          Factory method to instantiate a new ArrayValue store for the int array type
 int intValue()
          get the first element value as an int
abstract  int intValueAt(int index)
           
abstract  long[] longArray()
           
 long longValue()
          get the first element value as a long
abstract  long longValueAt(int index)
           
static ArrayValue numberStore(java.lang.Number number)
          Factory method to instantiate a new ArrayValue store from a Number.
abstract  short[] shortArray()
           
static ArrayValue shortStore(short scalar)
          Factory method to instantiate a new ArrayValue store for the short scalar type
static ArrayValue shortStore(short[] newArray)
          Factory method to instantiate a new ArrayValue store for the short array type
 short shortValue()
          get the first element value as a short
abstract  short shortValueAt(int index)
           
abstract  java.lang.String[] stringArray()
           
static ArrayValue stringStore(java.lang.String scalar)
          Factory method to instantiate a new ArrayValue store for the String scalar type
static ArrayValue stringStore(java.lang.String[] newArray)
          Factory method to instantiate a new ArrayValue store for the String array type
 java.lang.String stringValue()
          get the first element value as a String
abstract  java.lang.String stringValueAt(int index)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

array

protected java.lang.Object array
Constructor Detail

ArrayValue

public ArrayValue()
Create a new instatnce of an empty ArrayStore


ArrayValue

protected ArrayValue(java.lang.Object anArray)
Creates a new instance of ArrayStore

Method Detail

getCount

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


getType

public final java.lang.Class getType()
get the native type of the array


byteValue

public final byte byteValue()
get the first element value as a byte

Overrides:
byteValue in class java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.Number

doubleValueAt

public abstract double doubleValueAt(int index)

doubleArray

public abstract double[] doubleArray()

stringValue

public final java.lang.String stringValue()
get the first element value as a String


stringValueAt

public abstract java.lang.String stringValueAt(int index)

stringArray

public abstract java.lang.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


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(java.lang.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(java.lang.String[] newArray)
Factory method to instantiate a new ArrayValue store for the String array type


stringStore

public static ArrayValue stringStore(java.lang.String scalar)
Factory method to instantiate a new ArrayValue store for the String scalar type


arrayValueFromArray

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

java.lang.IllegalArgumentException