com.phoenix_int.aserver.types
Class PHXReference

java.lang.Object
  extended by com.phoenix_int.aserver.types.PHXReference
All Implemented Interfaces:
IPHXAlwaysWriteable, IPHXType, IPHXType2

public class PHXReference
extends java.lang.Object
implements IPHXAlwaysWriteable, IPHXType2

The Phoenix type for references. This class matches up to references in ModelCenter. Users may define their own properties in addition to the value property.


Constructor Summary
PHXReference()
          constructor
 
Method Summary
 PHXRefProperty _getProperty(java.lang.String name)
          retrieves a named property
 IPHXRefPropInfo createRefProp(java.lang.String name, java.lang.String type)
          adds a property to the variable
 void fromString(java.lang.String s)
          converts from a string
 void fromString2(PHXStringBuffer s)
          converts from a PHXStringBuffer
 java.lang.String getDescription()
          
 PHXRefProperty[] getProperties()
          retrieves the properties of the variable
 java.lang.String getReference()
          retrieves the current reference string.
 boolean getRefPropValueBoolean(java.lang.String name)
           
 double getRefPropValueDouble(java.lang.String name)
          gets a value for a ref prop
 long getRefPropValueLong(java.lang.String name)
           
 java.lang.String getRefPropValueString(java.lang.String name)
           
 double getValue()
          retrieves the current value of the variable
 void setDescription(java.lang.String desc)
          
 void setProperties(PHXRefProperty[] v)
           
 void setReference(java.lang.String ref)
          sets the value for the reference string.
 void setRefPropValue(java.lang.String name, boolean value)
           
 void setRefPropValue(java.lang.String name, double value)
          sets a value for a ref prop
 void setRefPropValue(java.lang.String name, long value)
           
 void setRefPropValue(java.lang.String name, java.lang.String value)
           
 void setValue(double v)
          sets the value for the variable
 java.lang.String toString()
          converts to a string
 PHXStringBuffer toString2()
          converts to a PHXStringBuffer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PHXReference

public PHXReference()
constructor

Method Detail

getValue

public double getValue()
retrieves the current value of the variable

Returns:
the value of the variable

setValue

public void setValue(double v)
sets the value for the variable

Parameters:
v - the value

getReference

public java.lang.String getReference()
retrieves the current reference string. This is a client-supplied value describing what the reference value points to.

Returns:
the reference string

setReference

public void setReference(java.lang.String ref)
sets the value for the reference string. This should only be called by the client application, e.g. ModelCenter.

Parameters:
ref - the reference string

getProperties

public PHXRefProperty[] getProperties()
retrieves the properties of the variable

Returns:
the properties of the variable

setProperties

public void setProperties(PHXRefProperty[] v)

createRefProp

public IPHXRefPropInfo createRefProp(java.lang.String name,
                                     java.lang.String type)
adds a property to the variable

Parameters:
name - the name of the property
type - property type: "long", "double", "boolean", or "string"

getRefPropValueDouble

public double getRefPropValueDouble(java.lang.String name)
                             throws PHXTypeMismatchException
gets a value for a ref prop

Parameters:
name - the name of the property
index - the array element
Returns:
the value of the property
Throws:
PHXTypeMismatchException

getRefPropValueLong

public long getRefPropValueLong(java.lang.String name)
                         throws PHXTypeMismatchException
Throws:
PHXTypeMismatchException

getRefPropValueBoolean

public boolean getRefPropValueBoolean(java.lang.String name)
                               throws PHXTypeMismatchException
Throws:
PHXTypeMismatchException

getRefPropValueString

public java.lang.String getRefPropValueString(java.lang.String name)
                                       throws PHXTypeMismatchException
Throws:
PHXTypeMismatchException

setRefPropValue

public void setRefPropValue(java.lang.String name,
                            double value)
                     throws PHXTypeMismatchException
sets a value for a ref prop

Parameters:
name - the name of the property
index - the array element
value - the value of the property
Throws:
PHXTypeMismatchException

setRefPropValue

public void setRefPropValue(java.lang.String name,
                            long value)
                     throws PHXTypeMismatchException
Throws:
PHXTypeMismatchException

setRefPropValue

public void setRefPropValue(java.lang.String name,
                            boolean value)
                     throws PHXTypeMismatchException
Throws:
PHXTypeMismatchException

setRefPropValue

public void setRefPropValue(java.lang.String name,
                            java.lang.String value)
                     throws PHXTypeMismatchException
Throws:
PHXTypeMismatchException

_getProperty

public PHXRefProperty _getProperty(java.lang.String name)
retrieves a named property

Parameters:
name - the name of the property
Returns:
the property matching the specified name

toString2

public PHXStringBuffer toString2()
converts to a PHXStringBuffer

Specified by:
toString2 in interface IPHXType2
Returns:
a PHXStringBuffer

toString

public java.lang.String toString()
converts to a string

Specified by:
toString in interface IPHXType
Overrides:
toString in class java.lang.Object
Returns:
a string

fromString2

public void fromString2(PHXStringBuffer s)
converts from a PHXStringBuffer

Specified by:
fromString2 in interface IPHXType2
Parameters:
s - the PHXStringBuffer value

fromString

public void fromString(java.lang.String s)
converts from a string

Specified by:
fromString in interface IPHXType
Parameters:
s - the string value

getDescription

public java.lang.String getDescription()


setDescription

public void setDescription(java.lang.String desc)