ABLE 2.3.0 07/13/2005 14:21:00

com.ibm.able.data
Class AbleGenericVariable

java.lang.Object
  extended bycom.ibm.able.data.AbleLhs
      extended bycom.ibm.able.data.AbleVariable
          extended bycom.ibm.able.data.AbleTypedVariable
              extended bycom.ibm.able.data.AbleGenericVariable
All Implemented Interfaces:
AbleClearable, AbleRd, AbleWr, java.io.Serializable
Direct Known Subclasses:
AbleGenericField

public class AbleGenericVariable
extends AbleTypedVariable
implements java.io.Serializable

This class defines the Able data generic variable. The value of a generic variable can be any Java object.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.ibm.able.data.AbleTypedVariable
myDataTypeClass, myDataTypeClassName, myDataTypeName, myInitialParms, myValue
 
Fields inherited from class com.ibm.able.data.AbleVariable
myBoundFlag, myChgSupport, myComment, myContext, myDataType, myGlobalFlag, myId, myName, myPrompt, myReferences, myStaticFlag, myTemplateFlag, myValueInitial
 
Constructor Summary
protected AbleGenericVariable(int theDataType, java.lang.String theName, boolean theStaticFlag, boolean theGlobalFlag, java.lang.Object theInitialValue)
          Create a new variable of the specified type and with the specified name.
  AbleGenericVariable(java.lang.String theName)
          Create a new generic variable.
  AbleGenericVariable(java.lang.String theName, boolean theStaticFlag, boolean theGlobalFlag)
          Create a new generic variable.
  AbleGenericVariable(java.lang.String theName, boolean theStaticFlag, boolean theGlobalFlag, java.lang.Object theInitialValue)
          Create a new generic variable.
  AbleGenericVariable(java.lang.String theName, java.lang.Object theInitialValue)
          Create a new generic variable.
 
Method Summary
 java.lang.String arlDclString()
          Return a formal ARL "declaration" string that describes this data object.
 java.lang.String armlDclString()
          Return a formal XML "declaration" string that describes this data object.
 java.lang.Class getDataTypeClass()
          Retrieve the actual class of this object's underlying data type.
 java.lang.String getDataTypeClassName()
          Retrieve the name of the class of this object's underlying data type.
 java.lang.String getDataTypeName()
          Retrieve the data type name.
 java.lang.Class getLiteralClass()
          Retrieve the class of this variable's related AbleLiteral data type.
 java.lang.String getStringValue()
          Retrieve the value of this data object as a string value.
 void init()
          Init the variable to its intial state.
 void reset()
          Reset the variable to its intial state.
protected  void setRawValue(java.lang.Object theNewValue)
          Set the variable's current value.
 java.lang.String toString()
          Retrieve a string describing (the contents of) the object.
 java.lang.String traceString(int theTraceStringFlavor)
          Retrieve a string describing (the contents of) the object.
 java.lang.String xmlDclString()
          Return a formal XML "declaration" string that describes this data object.
 
Methods inherited from class com.ibm.able.data.AbleTypedVariable
asgnEq, clear, cmpEq, cmpGt, cmpGtEq, cmpIs, cmpLt, cmpLtEq, cmpNeq, compDivide, compMinus, compMultiply, compPlus, compUnaryMinus, getBooleanValue, getFuzzyValue, getGenericValue, getNumericValue, getValue, getValueString, replaceValues, setBooleanValue, setFuzzyValue, setGenericValue, setNumericValue, setStringValue, setValue, setValueString
 
Methods inherited from class com.ibm.able.data.AbleVariable
arlCRdString, arlInitializerString, armlCRdString, armlInitializerString, getArlComment, getChgSupport, getComment, getContext, getDataType, getDataTypeAsString, getId, getName, getPrompt, getPromptString, getReferences, getReferent, getReferents, getTemplateString, isBound, isConstant, isGlobal, isLocal, isStatic, isTemplate, notStatic, setChgSupport, setComment, setContext, setId, setInitialValue, setPrompt, setReferences, setStatic, setTemplate, xmlCRdString, xmlCWrString, xmlInitializerString
 
Methods inherited from class com.ibm.able.data.AbleLhs
asgnIs, asgnIs, bitwiseAND, bitwiseNOT, bitwiseOR, bitwiseShiftLeft, bitwiseShiftRight, bitwiseShiftRightZeroFill, bitwiseXOR, compModulo, logicalAND, logicalNOT, logicalOR
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbleGenericVariable

public AbleGenericVariable(java.lang.String theName)
Create a new generic variable. The initial value is null.

Parameters:
theName - The unique name of the variable.


AbleGenericVariable

public AbleGenericVariable(java.lang.String theName,
                           boolean theStaticFlag,
                           boolean theGlobalFlag)
Create a new generic variable. The initial value is null.

Parameters:
theName - The unique name of the variable.

theStaticFlag - Use true if this variable is to be marked as static, which means that it will ignore future reset requests; use false if the variable can be reset to its initial value when requested.

theGlobalFlag - Use true if this variable is to be considered global; use false if the variable is to be considered local.


AbleGenericVariable

public AbleGenericVariable(java.lang.String theName,
                           boolean theStaticFlag,
                           boolean theGlobalFlag,
                           java.lang.Object theInitialValue)
Create a new generic variable. The initial value is null.

Parameters:
theName - The unique name of the variable.

theStaticFlag - Use true if this variable is to be marked as static, which means that it will ignore future reset requests; use false if the variable can be reset to its initial value when requested.

theGlobalFlag - Use true if this variable is to be considered global; use false if the variable is to be considered local.

theInitialValue - The value to which this variable is initially set.


AbleGenericVariable

public AbleGenericVariable(java.lang.String theName,
                           java.lang.Object theInitialValue)
Create a new generic variable. The initial value is the specified Object.

Parameters:
theName - The unique name of the variable.

theInitialValue - The value to which this variable is initially set.


AbleGenericVariable

protected AbleGenericVariable(int theDataType,
                              java.lang.String theName,
                              boolean theStaticFlag,
                              boolean theGlobalFlag,
                              java.lang.Object theInitialValue)
Create a new variable of the specified type and with the specified name. Also indicate whether the variable is static and specify the variable's initial value.

This constructor is obviously used by variables derived from this generic variable; for example, AbleTypedVariable.

Parameters:
theDataType - An AbleData.<DataType> constant.

theName - The unique name of the variable.

theStaticFlag - Use true if this variable is to be marked as static, which means that it will ignore future reset requests; use false if the variable can be reset to its initial value when requested.

theGlobalFlag - Use true if this variable is to be considered global; use false if the variable is to be considered local.

theInitialValue - The value to which this variable is initially set.

Method Detail

getStringValue

public java.lang.String getStringValue()
                                throws AbleDataException
Retrieve the value of this data object as a string value.

Specified by:
getStringValue in interface AbleRd
Overrides:
getStringValue in class AbleTypedVariable
Returns:
A String, if the value of this object can be represented as a string value.
Throws:
AbleDataException - If the value of this object cannot be represented as a string value.

arlDclString

public java.lang.String arlDclString()
Return a formal ARL "declaration" string that describes this data object.

Specified by:
arlDclString in interface AbleWr
Overrides:
arlDclString in class AbleTypedVariable
Returns:
A String describing the data object in formal rule language.

xmlDclString

public java.lang.String xmlDclString()
Return a formal XML "declaration" string that describes this data object.

Specified by:
xmlDclString in interface AbleWr
Overrides:
xmlDclString in class AbleTypedVariable
Returns:
A String describing the data object in XML.

armlDclString

public java.lang.String armlDclString()
Return a formal XML "declaration" string that describes this data object.

Overrides:
armlDclString in class AbleTypedVariable
Returns:
A String describing the data object in XML.

reset

public void reset()
           throws AbleDataException
Reset the variable to its intial state.

Overrides:
reset in class AbleTypedVariable
Throws:
AbleDataException

init

public void init()
          throws AbleDataException
Init the variable to its intial state.

Overrides:
init in class AbleTypedVariable
Throws:
AbleDataException

getDataTypeClass

public java.lang.Class getDataTypeClass()
Description copied from class: AbleLhs
Retrieve the actual class of this object's underlying data type.

Specified by:
getDataTypeClass in interface AbleRd
Overrides:
getDataTypeClass in class AbleTypedVariable

getDataTypeClassName

public java.lang.String getDataTypeClassName()
Description copied from class: AbleLhs
Retrieve the name of the class of this object's underlying data type.

Specified by:
getDataTypeClassName in interface AbleRd
Overrides:
getDataTypeClassName in class AbleTypedVariable

getDataTypeName

public java.lang.String getDataTypeName()
Retrieve the data type name. This is the name used in the ABLE Rule Set, for example, Integer, Customer, etc.

Overrides:
getDataTypeName in class AbleTypedVariable

getLiteralClass

public java.lang.Class getLiteralClass()
Retrieve the class of this variable's related AbleLiteral data type.

Overrides:
getLiteralClass in class AbleTypedVariable
Returns:
The class of the literal data type.

setRawValue

protected void setRawValue(java.lang.Object theNewValue)
                    throws AbleDataException
Set the variable's current value.

Note that this method fires a PropertyChange with both old and new values, but only if a PropertyChangeSupport object has been set in the variable.

Throws:
AbleDataException

toString

public java.lang.String toString()
Retrieve a string describing (the contents of) the object.

Overrides:
toString in class AbleTypedVariable
Returns:
A String containing the current contents of the object.

traceString

public java.lang.String traceString(int theTraceStringFlavor)
Retrieve a string describing (the contents of) the object.

Specified by:
traceString in interface AbleRd
Overrides:
traceString in class AbleTypedVariable
Parameters:
theTraceStringFlavor - An Able.TraceStringFlavor value.

Returns:
A String containing the current contents of the object.

ABLE 2.3.0 07/13/2005 14:21:00

(C) Copyright IBM Corporation 1999, 2005