ABLE 2.0.0 07/02/2003 10:25:01

com.ibm.able.data
Class AbleTypedVariable

java.lang.Object
  |
  +--com.ibm.able.data.AbleLhs
        |
        +--com.ibm.able.data.AbleVariable
              |
              +--com.ibm.able.data.AbleGenericVariable
                    |
                    +--com.ibm.able.data.AbleTypedVariable
All Implemented Interfaces:
AbleRd, AbleWr, java.io.Serializable
Direct Known Subclasses:
AbleArrayVariable, AbleBooleanVariable, AbleBuiltInVariable, AbleByteVariable, AbleCategoricalVariable, AbleCharacterVariable, AbleClassVariable, AbleDiscreteVariable, AbleDoubleVariable, AbleExpressionVariable, AbleFloatVariable, AbleIntegerVariable, AbleLongVariable, AbleShortVariable, AbleStringVariable, AbleTimeStampVariable

public class AbleTypedVariable
extends AbleGenericVariable
implements java.io.Serializable

This class defines an AbleVariable that takes values of a single specified Class or implementors of a specified Interface. The datatype must be specified on the constructor, either by providing an instance of the intended type or by explicitly stating the data type name and corresponding data type class name.

Instances of AbleTypedVariables can be null or can hold an instance of the declared type of object. Methods can be called on the object values using AbleTypedVariableMethodLiterals. Data members can be access using AbleTypedVariableFields.

See Also:
Serialized Form

Field Summary
protected  java.lang.Class myDataTypeClass
          The class of this data type.
protected  java.lang.String myDataTypeClassName
          The class name of this data type
protected  java.lang.String myDataTypeName
          The name of this data type.
protected  java.util.Vector myInitialParms
          The parameters used when the initial value of this object was constructed.
 
Fields inherited from class com.ibm.able.data.AbleGenericVariable
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
AbleTypedVariable(AbleTypedVariable theTypedVar)
          Create a duplicate of this variable with the same initial value and type but with the name suffixed with "clone".
AbleTypedVariable(java.lang.String theName, boolean theStaticFlag, boolean theGlobalFlag, java.lang.Object theInitialValue, java.lang.String theDataTypeName, java.util.Vector theInitialParms)
          Create a new typed variable.
AbleTypedVariable(java.lang.String theName, boolean theStaticFlag, boolean theGlobalFlag, java.lang.String theDataTypeName, java.lang.String theDataTypeClassName)
          Create a new typed variable with a null initial value .
AbleTypedVariable(java.lang.String theName, java.lang.String theDataTypeName, java.lang.String theDataTypeClassName)
          Create a new typed variable with a null initial value and with the global and static flags set to false.
 
Method Summary
 java.lang.String arlDclString()
          Return a formal ARL "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.
 void init()
          Init the variable to its initial state.
 void reset()
          Reset the variable to its initial state.
protected  void setRawValue(java.lang.Object theNewValue)
          Set the variable's current value.
 void setStringValue(java.lang.String theNewValue)
          Set the value of this data object from a string 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.AbleGenericVariable
asgnEq, cmpEq, cmpGt, cmpGtEq, cmpIs, cmpLt, cmpLtEq, cmpNeq, compDivide, compMinus, compMultiply, compPlus, compUnaryMinus, getBooleanValue, getFuzzyValue, getGenericValue, getLiteralClass, getNumericValue, getStringValue, getValue, getValueString, replaceValues, setBooleanValue, setFuzzyValue, setGenericValue, setNumericValue, setValue, setValueString
 
Methods inherited from class com.ibm.able.data.AbleVariable
arlCRdString, arlInitializerString, 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, Copyright, logicalAND, logicalNOT, logicalOR
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

myDataTypeName

protected java.lang.String myDataTypeName
The name of this data type.

myDataTypeClass

protected transient java.lang.Class myDataTypeClass
The class of this data type.

myDataTypeClassName

protected java.lang.String myDataTypeClassName
The class name of this data type

myInitialParms

protected java.util.Vector myInitialParms
The parameters used when the initial value of this object was constructed.
Constructor Detail

AbleTypedVariable

public AbleTypedVariable(java.lang.String theName,
                         boolean theStaticFlag,
                         boolean theGlobalFlag,
                         java.lang.Object theInitialValue,
                         java.lang.String theDataTypeName,
                         java.util.Vector theInitialParms)
Create a new typed variable. The initial value must be an instance of the type the variable represents.
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. It must be an instance of theDataTypeClass.

theDataTypeName - The name of a user-defined data type.

theInitialParms - The parameters used when the initial value was created.


AbleTypedVariable

public AbleTypedVariable(java.lang.String theName,
                         boolean theStaticFlag,
                         boolean theGlobalFlag,
                         java.lang.String theDataTypeName,
                         java.lang.String theDataTypeClassName)
Create a new typed variable with a null initial value .
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.

theDataTypeName - The name of a user-defined data type.

theDataTypeNameClassName - The fully qualified name of the user-defined data type.


AbleTypedVariable

public AbleTypedVariable(java.lang.String theName,
                         java.lang.String theDataTypeName,
                         java.lang.String theDataTypeClassName)
Create a new typed variable with a null initial value and with the global and static flags set to false.
Parameters:
theName - The unique name of the variable.

theDataTypeName - The name of a user-defined data type.

theDataTypeNameClassName - The fully qualified name of the user-defined data type.


AbleTypedVariable

public AbleTypedVariable(AbleTypedVariable theTypedVar)
Create a duplicate of this variable with the same initial value and type but with the name suffixed with "clone". These vars are not placed in the global symbol table and are used as temporary variables. This constructor is used by the AbleBeanLib.createInstance() method.
Parameters:
theTypeVar - An AbleTypeVariable to be cloned.
Method Detail

arlDclString

public java.lang.String arlDclString()
Return a formal ARL "declaration" string that describes this data object.
Overrides:
arlDclString in class AbleGenericVariable
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.
Overrides:
xmlDclString in class AbleGenericVariable
Returns:
A String describing the data object in XML.

getDataTypeClass

public java.lang.Class getDataTypeClass()
Description copied from class: AbleLhs
Retrieve the actual class of this object's underlying data type.
Overrides:
getDataTypeClass in class AbleGenericVariable
Following copied from class: com.ibm.able.data.AbleLhs
Returns:
The class of the underlying data type.

getDataTypeClassName

public java.lang.String getDataTypeClassName()
Description copied from class: AbleLhs
Retrieve the name of the class of this object's underlying data type.
Overrides:
getDataTypeClassName in class AbleGenericVariable
Following copied from class: com.ibm.able.data.AbleLhs
Returns:
A String that is the name of the class of the underlying data type.

setStringValue

public void setStringValue(java.lang.String theNewValue)
                    throws AbleDataException
Set the value of this data object from a string value.
Overrides:
setStringValue in class AbleGenericVariable
Parameters:
theNewValue - A string.

Throws:
AbleDataException - If the value of this object cannot be represented as a string value.

setRawValue

protected void setRawValue(java.lang.Object theNewValue)
                    throws AbleDataException
Description copied from class: AbleGenericVariable
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.

Overrides:
setRawValue in class AbleGenericVariable

getDataTypeName

public java.lang.String getDataTypeName()
Description copied from class: AbleGenericVariable
Retrieve the data type name. This is the name used in the ABLE Rule Set, for example, Integer, Customer, etc.
Overrides:
getDataTypeName in class AbleGenericVariable

reset

public void reset()
           throws AbleDataException
Reset the variable to its initial state.
Overrides:
reset in class AbleGenericVariable

init

public void init()
          throws AbleDataException
Init the variable to its initial state.
Overrides:
init in class AbleGenericVariable

toString

public java.lang.String toString()
Description copied from class: AbleGenericVariable
Retrieve a string describing (the contents of) the object.
Overrides:
toString in class AbleGenericVariable
Following copied from class: com.ibm.able.data.AbleGenericVariable
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.
Overrides:
traceString in class AbleGenericVariable
Parameters:
theFlavor - An Able.TraceStringFlavor value.

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

ABLE 2.0.0 07/02/2003 10:25:01

(C) Copyright IBM Corporation 1999, 2003