com.phoenix_int.aserver.types
Class PHXDoubleArray

java.lang.Object
  extended by com.phoenix_int.aserver.types.PHXSimpleType
      extended by com.phoenix_int.aserver.types.PHXSimpleArray
          extended by com.phoenix_int.aserver.types.PHXDoubleArray
All Implemented Interfaces:
IPHXType, IPHXType2

public class PHXDoubleArray
extends PHXSimpleArray

Class wraps an array of PHXDouble variables for the ScriptWrapper utility.

See Also:
PHXSimpleArray

Field Summary
 
Fields inherited from class com.phoenix_int.aserver.types.PHXSimpleArray
_data, _lockDims, _lockResize
 
Constructor Summary
PHXDoubleArray()
           
PHXDoubleArray(java.lang.Object data)
           
 
Method Summary
protected  void _getMetaData(PHXSimpleType v2)
          Worker which takes the meta data from an instance of PHXSimpleType and sets it into our meta data.
protected  void _setMetaData(PHXSimpleType v2)
          Sets a simple type's meta data based on the meta data in this object.
protected  java.lang.Object allocateElement(java.lang.Class elementClass)
          Allocates a single element in a default state.
protected  boolean dataTypeOK(java.lang.Class c)
          Must override this function and return true if the specified class is acceptable as an array element component type.
protected  java.lang.Object elementFromString(java.lang.String val)
          Sub-classes must provide an implementation of this function which converts a string form of a single element to Object form.
 double getDoubleValue(int index)
          Gets an element as a double
 double getDoubleValue(int[] index)
          Gets an element as a double
 java.lang.String[] getEnumAliases()
          An interface function for the enumeration array
 double[] getEnumValues()
          An interface function for the enumeration array
 java.lang.String getFormat()
          retrieves the format of the variable
 boolean getHasLowerBound()
          retrieves the hasLowerBound flag
 boolean getHasUpperBound()
          retrieves the hasUpperBound flag
 double getLowerBound()
          retrieves the current lower bound value
 double getUpperBound()
          retrieves the current upper bound value
 PHXDouble getValue(int index)
          gets an element as a PHXDouble object
 PHXDouble getValue(int[] index)
          gets an element as a PHXDouble object
 void setEnumAliases(java.lang.String values)
          takes a comma seperated string of values and fills the enumeration aliases list with values.
 void setEnumAliases(java.lang.String[] values)
          Sets the enumeration aliases list
 void setEnumValues(double[] values)
          Sets the enumeration list of valid values.
 void setEnumValues(java.lang.String values)
          takes a comma seperated string of values and fills the enumeration List with values.
 void setFormat(java.lang.String format)
          sets the format options
 void setHasLowerBound(boolean value)
          sets the hasLowerBound flag
 void setHasUpperBound(boolean value)
          sets the hasUpperBound flag
 void setLowerBound(double value)
          sets the lower bound.
 void setUpperBound(double value)
          sets the upper bound.
 void setValue(int[] index, double val)
          sets an element as a double
 void setValue(int[] index, PHXDouble val)
          sets an element as a PHXDouble object
 void setValue(int index, double val)
          sets an element as a double
 void setValue(int index, PHXDouble val)
          sets an element as a PHXDouble object
 
Methods inherited from class com.phoenix_int.aserver.types.PHXSimpleArray
_getMetaData, _setMetaData, fromString, fromString, fromString, fromString, fromString2, generateFor, generateFor, getArray, getArrayElement, getArrayElement, getComponentType, getComponentType, getDimensions, getDimensions, getFirst, getLength, getLength, getLockResize, getNumDimensions, getNumDimensions, getSelf, incrementIndex, lockDimensions, newIndex, parseIndex, resize, setArray, setArrayElement, setArrayElement, setDimensions, setFirst, setLength, setLength, setLockResize, toString, toString, toString, toString, toString2, toString2, toString2, validElement
 
Methods inherited from class com.phoenix_int.aserver.types.PHXSimpleType
addPropertyChangeListener, getDescription, getEnumTokens, getHasChanged, getUnits, removePropertyChangeListener, setDescription, setHasChanged, setUnits
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PHXDoubleArray

public PHXDoubleArray()

PHXDoubleArray

public PHXDoubleArray(java.lang.Object data)
Method Detail

dataTypeOK

protected boolean dataTypeOK(java.lang.Class c)
Description copied from class: PHXSimpleArray
Must override this function and return true if the specified class is acceptable as an array element component type.

Specified by:
dataTypeOK in class PHXSimpleArray

allocateElement

protected java.lang.Object allocateElement(java.lang.Class elementClass)
                                    throws java.lang.IllegalAccessException,
                                           java.lang.InstantiationException
Description copied from class: PHXSimpleArray
Allocates a single element in a default state. If the class type in question has a default constructor, there is no need to override this.

Overrides:
allocateElement in class PHXSimpleArray
Throws:
java.lang.IllegalAccessException
java.lang.InstantiationException

setUpperBound

public void setUpperBound(double value)
sets the upper bound. The hasUpperBound value is set to true

Parameters:
value - the upper bound

getUpperBound

public double getUpperBound()
retrieves the current upper bound value

Returns:
the upper bound
Throws:
java.lang.IllegalStateException - Thrown if there is no upper bound defined.

setLowerBound

public void setLowerBound(double value)
sets the lower bound. The hasLowerBound value is set to true

Parameters:
value - the lower bound

getLowerBound

public double getLowerBound()
retrieves the current lower bound value

Returns:
the lower bound

setHasUpperBound

public void setHasUpperBound(boolean value)
sets the hasUpperBound flag

Parameters:
value - true or false

getHasUpperBound

public boolean getHasUpperBound()
retrieves the hasUpperBound flag

Returns:
true or false

setHasLowerBound

public void setHasLowerBound(boolean value)
sets the hasLowerBound flag

Parameters:
value - true or false

getHasLowerBound

public boolean getHasLowerBound()
retrieves the hasLowerBound flag

Returns:
true or false

setEnumValues

public void setEnumValues(java.lang.String values)
takes a comma seperated string of values and fills the enumeration List with values.

Parameters:
values - A comma seperrated string of enumeration values

setEnumValues

public void setEnumValues(double[] values)
Sets the enumeration list of valid values.

Parameters:
values - An array of double values

getEnumValues

public double[] getEnumValues()
An interface function for the enumeration array

Returns:
an array of the possible values of the list

setEnumAliases

public void setEnumAliases(java.lang.String values)
takes a comma seperated string of values and fills the enumeration aliases list with values.

Parameters:
values - A comma seperated string of enumeration aliases

setEnumAliases

public void setEnumAliases(java.lang.String[] values)
Sets the enumeration aliases list

Parameters:
values - An array of strings

getEnumAliases

public java.lang.String[] getEnumAliases()
An interface function for the enumeration array

Returns:
an array of the possible values of the list

setFormat

public void setFormat(java.lang.String format)
sets the format options

Parameters:
f - the new format for the variable

getFormat

public java.lang.String getFormat()
retrieves the format of the variable

Returns:
the format of the variable

_setMetaData

protected void _setMetaData(PHXSimpleType v2)
Description copied from class: PHXSimpleArray
Sets a simple type's meta data based on the meta data in this object. Override this to set additional information in sub-classes. Be sure to call super._setMetaData(PHXSimpleType)

Overrides:
_setMetaData in class PHXSimpleArray

_getMetaData

protected void _getMetaData(PHXSimpleType v2)
Description copied from class: PHXSimpleArray
Worker which takes the meta data from an instance of PHXSimpleType and sets it into our meta data. Override this in order to add more custom meta data in sub-classes. Be sure to cal super._getMetaData(PHXSimpleType), though!

Overrides:
_getMetaData in class PHXSimpleArray

getValue

public PHXDouble getValue(int index)
gets an element as a PHXDouble object

Parameters:
index - 1D array index
Returns:
referenced array value
Throws:
java.lang.IllegalArgumentException - thrown if called on non-1D array

getValue

public PHXDouble getValue(int[] index)
gets an element as a PHXDouble object

Parameters:
index - nD array index
Returns:
referenced array value

getDoubleValue

public double getDoubleValue(int index)
Gets an element as a double

Parameters:
index - 1D array index
Returns:
referenced array value
Throws:
java.lang.IllegalArgumentException - thrown if called on non-1D array

getDoubleValue

public double getDoubleValue(int[] index)
Gets an element as a double

Parameters:
index - nD array index
Returns:
referenced array value

setValue

public void setValue(int index,
                     PHXDouble val)
sets an element as a PHXDouble object

Parameters:
index - 1D array index
val - value to set

setValue

public void setValue(int[] index,
                     PHXDouble val)
sets an element as a PHXDouble object

Parameters:
index - nD array index
val - value to set

setValue

public void setValue(int index,
                     double val)
sets an element as a double

Parameters:
index - 1D array index
val - value to set

setValue

public void setValue(int[] index,
                     double val)
sets an element as a double

Parameters:
index - nD array index
val - value to set

elementFromString

protected java.lang.Object elementFromString(java.lang.String val)
Description copied from class: PHXSimpleArray
Sub-classes must provide an implementation of this function which converts a string form of a single element to Object form. This is only used when the element type does not implement IPHXType or IPHXType2. For primitives, return the wrapper objects.

Specified by:
elementFromString in class PHXSimpleArray