|
ABLE, Version 1.1b | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.able.data.AbleLhs | +--com.ibm.able.data.AbleVariable | +--com.ibm.able.data.AbleGenericVariable
This class defines the Able data generic variable. The value of a generic variable can be any Java object.
Field Summary | |
protected java.lang.Object |
myValue
|
protected java.lang.Object |
myValueInitial
|
Fields inherited from class com.ibm.able.data.AbleVariable |
myChgSupport,
myContext,
myDataType,
myId,
myName,
myReferences |
Constructor Summary | |
AbleGenericVariable(java.lang.Object theContext,
java.beans.PropertyChangeSupport theChgSupport,
int theId,
java.lang.String theName)
Create a new generic variable. |
|
AbleGenericVariable(java.lang.Object theContext,
java.beans.PropertyChangeSupport theChgSupport,
int theId,
java.lang.String theName,
java.lang.Object theInitialValue)
Create a new generic variable with the specified initial value. |
|
AbleGenericVariable(java.lang.String theName)
Create a new generic variable. |
Method Summary | |
boolean |
cmpEq(AbleRd theRhs)
Comparison, equal to: compare the current value of this data object to the current value of theRhs. |
boolean |
cmpNeq(AbleRd theRhs)
Comparison, not equal to: compare the current value of this data object to the current value of theRhs. |
static java.lang.String |
Copyright()
Determine the copyright of this class. |
boolean |
getBooleanValue()
Retrieve the value of this data object as a boolean value. |
AbleLiteral |
getFuzzyValue()
Retrieve the value of this data object as a fuzzy value. |
java.lang.Object |
getGenericValue()
Retrieve the value of this data object as an Object. |
java.lang.Object |
getInitialValue()
Retrieve the variable's initial value. |
double |
getNumericValue()
Retrieve the value of this data object as a numeric value. |
java.lang.String |
getStringValue()
Retrieve the value of this data object as a string value. |
AbleLiteral |
getValue()
Retrieve the value of this data object as a literal. |
java.lang.String |
getValueString()
Retrieve the variable's current value as a string. |
void |
reset()
Reset the variable to its intial state. |
java.lang.String |
rlDclString()
Return a formal rule language "declaration" string that describes this data object. |
void |
setBooleanValue(boolean theNewValue)
Set the value of this data object from a boolean value. |
void |
setFuzzyValue(AbleLiteral theNewValue)
Set the value of this data object from a fuzzy value. |
void |
setGenericValue(java.lang.Object theNewValue)
Set the value of this data object from an object. |
void |
setNumericValue(double theNewValue)
Set the value of this data object from a numeric value. |
void |
setStringValue(java.lang.String theNewValue)
Set the value of this data object from a string value. |
void |
setValue(AbleLiteral theNewValue)
Set the value of this data object from a literal object. |
void |
setValueString(java.lang.String theNewValue)
Set the variable's current value from a string. |
java.lang.String |
toString()
Retrieve a string describing (the contents of) the object. |
java.lang.String |
xmlCWrString()
Return a formal XML "clause write" string that describes this data object. |
java.lang.String |
xmlDclString()
Return a formal XML "declaration" string that describes this data object. |
Methods inherited from class com.ibm.able.data.AbleVariable |
getChgSupport,
getContext,
getDataType,
getDataTypeAsString,
getId,
getName,
getReferences,
getReferent,
rlCRdString,
setChgSupport,
setContext,
setId,
setReferences,
xmlCRdString |
Methods inherited from class com.ibm.able.data.AbleLhs |
asgnEq,
asgnIs,
asgnIs,
cmpGt,
cmpGtEq,
cmpIs,
cmpLt,
cmpLtEq |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected java.lang.Object myValue
protected java.lang.Object myValueInitial
Constructor Detail |
public AbleGenericVariable(java.lang.Object theContext, java.beans.PropertyChangeSupport theChgSupport, int theId, java.lang.String theName)
theContext
- The context in which this variable resides. May be
an Able ruleset, for example, or null if the
variable is not part of any context.
theChgSupport
- For throwing property change events.
This may be null.
theId
- The unique Id of the variable.
theName
- The unique name of the variable.
public AbleGenericVariable(java.lang.Object theContext, java.beans.PropertyChangeSupport theChgSupport, int theId, java.lang.String theName, java.lang.Object theInitialValue)
theContext
- The context in which this variable resides. May be
an Able ruleset, for example, or null if the
variable is not part of any context.
theChgSupport
- For throwing property change events.
This may be null.
theId
- The unique Id of the variable.
theName
- The unique name of the variable.
theInitialValue
- The value to which this variable is initially set.
public AbleGenericVariable(java.lang.String theName)
theName
- The unique name of the variable.
Method Detail |
public boolean getBooleanValue() throws AbleDataException
public AbleLiteral getFuzzyValue() throws AbleDataException
public java.lang.Object getGenericValue() throws AbleDataException
public double getNumericValue() throws AbleDataException
public java.lang.String getStringValue() throws AbleDataException
public AbleLiteral getValue() throws AbleDataException
public boolean cmpEq(AbleRd theRhs) throws AbleDataException
"==" is used for numeric and boolean compares; equals() is used for Object compares; and Collator.equals() is used for String compares.
theRhs
- The right-hand side of the comparison.
public boolean cmpNeq(AbleRd theRhs) throws AbleDataException
"!=" is used for numeric and boolean compares; ! equals() is used for Object compares; and ! Collator.equals() is used for String compares.
theRhs
- The right-hand side of the comparison.
public void setBooleanValue(boolean theNewValue) throws AbleDataException
theNewValue
- A boolean value.
public void setFuzzyValue(AbleLiteral theNewValue) throws AbleDataException
theNewValue
- A fuzzy set.
public void setGenericValue(java.lang.Object theNewValue) throws AbleDataException
theNewValue
- Any type of Object.
public void setNumericValue(double theNewValue) throws AbleDataException
theNewValue
- Any number.
public void setStringValue(java.lang.String theNewValue) throws AbleDataException
theNewValue
- A string.
public void setValue(AbleLiteral theNewValue) throws AbleDataException
theNewValue
- An Able literal of any type. An attempt is made to
convert the literal to an appropriate type before
assigning it to this "writable" object.
public java.lang.String rlDclString()
public java.lang.String xmlDclString()
public java.lang.String xmlCWrString()
public void setValueString(java.lang.String theNewValue) throws AbleDataException
public java.lang.String getValueString()
public void reset()
public java.lang.Object getInitialValue()
public java.lang.String toString()
public static java.lang.String Copyright()
|
ABLE, Version 1.1b | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |