|
ABLE 2.3.0 07/13/2005 14:21:00 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Objectcom.ibm.able.data.AbleLhs
com.ibm.able.data.AbleVariable
com.ibm.able.data.AbleTypedVariable
com.ibm.able.data.AbleBooleanVariable
This class wraps a value of the primitive type boolean in an object. An object of type AbleBooleanVariable contains a single, mutable field whose type is boolean. Instances of AbleBooleanVariable are used by the Able rules classes in clauses and expressions. In addition, this class provides methods for converting a boolean to other datatypes, setting a boolean value using other datatypes, as well as other logical comparison and math operator methods useful when dealing with a boolean.
| Field Summary | |
|---|---|
protected boolean |
myValue
The current value of the variable. |
| Fields inherited from class com.ibm.able.data.AbleTypedVariable |
|---|
myDataTypeClass, myDataTypeClassName, myDataTypeName, myInitialParms |
| Fields inherited from class com.ibm.able.data.AbleVariable |
|---|
myBoundFlag, myChgSupport, myComment, myContext, myDataType, myGlobalFlag, myId, myName, myPrompt, myReferences, myStaticFlag, myTemplateFlag, myValueInitial |
| Constructor Summary | |
|---|---|
AbleBooleanVariable(java.lang.String theName,
boolean theInitialValue)
Create a new boolean variable with the specified initial value. |
|
AbleBooleanVariable(java.lang.String theName,
boolean theStaticFlag,
boolean theGlobalFlag)
Create a new boolean variable with a null (unbound) initial value. |
|
AbleBooleanVariable(java.lang.String theName,
boolean theStaticFlag,
boolean theGlobalFlag,
boolean theInitialValue)
Create a new boolean variable with the specified initial value. |
|
| 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. |
void |
asgnEq(AbleRd theRhs)
Assignment: assign the current value of theRhs to this data object. |
AbleLiteral |
bitwiseXOR(AbleRd theRhs)
Logical XOR: exclusive OR the current value of this data object with the current value of theRhs. |
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. |
boolean |
getBooleanValue()
Retrieve the value of this data object as a boolean value. |
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. |
AbleFuzzySet |
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.Class |
getLiteralClass()
Retrieve the class of this variable's related AbleLiteral data type. |
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 |
init()
Init the variable to its initial state. |
boolean |
logicalAND(AbleRd theRhs)
Logical AND the current value of this data object with the current value of theRhs. |
boolean |
logicalNOT(AbleRd theRhs)
Logical NOT: complement the current value of this data object. |
boolean |
logicalOR(AbleRd theRhs)
Logical OR the current value of this data object with the current value of theRhs. |
void |
reset()
Reset the variable to its initial state. |
void |
setBooleanValue(boolean theNewValue)
Set the value of this data object from a boolean value. |
void |
setFuzzyValue(AbleFuzzySet 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 |
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 |
|---|
clear, cmpGt, cmpGtEq, cmpIs, cmpLt, cmpLtEq, compDivide, compMinus, compMultiply, compPlus, compUnaryMinus, replaceValues |
| 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, compModulo |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected boolean myValue
| Constructor Detail |
public AbleBooleanVariable(java.lang.String theName,
boolean theInitialValue)
theName - The unique name of the variable.
theInitialValue - The value to which this variable is initially set.
public AbleBooleanVariable(java.lang.String theName,
boolean theStaticFlag,
boolean theGlobalFlag,
boolean theInitialValue)
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.
public AbleBooleanVariable(java.lang.String theName,
boolean theStaticFlag,
boolean theGlobalFlag)
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.
| Method Detail |
public boolean getBooleanValue()
throws AbleDataException
getBooleanValue in interface AbleRdgetBooleanValue in class AbleTypedVariableAbleDataException - If the value of this object cannot be represented as
a boolean value.
public AbleFuzzySet getFuzzyValue()
throws AbleDataException
getFuzzyValue in interface AbleRdgetFuzzyValue in class AbleTypedVariableAbleDataException - If the value of this object cannot be represented as
a fuzzy value.
public java.lang.Object getGenericValue()
throws AbleDataException
getGenericValue in interface AbleRdgetGenericValue in class AbleTypedVariableAbleDataException - If the value of this object cannot be represented as
an Object.
public double getNumericValue()
throws AbleDataException
getNumericValue in interface AbleRdgetNumericValue in class AbleTypedVariableAbleDataException - If the value of this object cannot be represented as
a numeric value.
public java.lang.String getStringValue()
throws AbleDataException
getStringValue in interface AbleRdgetStringValue in class AbleTypedVariableAbleDataException - If the value of this object cannot be represented as
a string value.
public AbleLiteral getValue()
throws AbleDataException
getValue in interface AbleRdgetValue in class AbleTypedVariableAbleDataException - If the value of this object cannot be represented as
a literal.
public void asgnEq(AbleRd theRhs)
throws AbleDataException
asgnEq in interface AbleWrasgnEq in class AbleTypedVariabletheRhs - The right-hand, or source, side of the assignment.
AbleDataException - If the right-hand side cannot be converted (if
necessary) and assigned to this data object.
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.
cmpEq in interface AbleRdcmpEq in class AbleTypedVariabletheRhs - The right-hand side of the comparison.
AbleDataException - If the right-hand side cannot be converted (if
necessary) and compared to this data object.
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.
cmpNeq in interface AbleRdcmpNeq in class AbleTypedVariabletheRhs - The right-hand side of the comparison.
AbleDataException - If the right-hand side cannot be converted (if
necessary) and compared to this data object.
public boolean logicalAND(AbleRd theRhs)
throws AbleDataException
"&&" is used for boolean AND.
logicalAND in interface AbleRdlogicalAND in class AbleLhstheRhs - The right-hand side of the comparison.
AbleDataException - If the right-hand side cannot be converted (if
necessary) and compared to this data object.
public boolean logicalOR(AbleRd theRhs)
throws AbleDataException
"||" is used for boolean OR.
logicalOR in interface AbleRdlogicalOR in class AbleLhstheRhs - The right-hand side of the comparison.
AbleDataException - If the right-hand side cannot be converted (if
necessary) and compared to this data object.
public boolean logicalNOT(AbleRd theRhs)
throws AbleDataException
"!" is used for boolean NOT.
logicalNOT in interface AbleRdlogicalNOT in class AbleLhstheRhs - The right-hand side of the comparison.
AbleDataException - If the right-hand side cannot be converted (if
necessary) and compared to this data object.
public AbleLiteral bitwiseXOR(AbleRd theRhs)
throws AbleDataException
"^" is used for bitwise or logical XOR.
bitwiseXOR in interface AbleRdbitwiseXOR in class AbleLhstheRhs - The right-hand side of the operation.
AbleDataException - If the right-hand side cannot be converted (if
necessary) and compared to this data object.
public void setBooleanValue(boolean theNewValue)
throws AbleDataException
setBooleanValue in interface AbleWrsetBooleanValue in class AbleTypedVariabletheNewValue - A boolean value.
AbleDataException - If the value of this object cannot be represented as
a boolean value.
public void setFuzzyValue(AbleFuzzySet theNewValue)
throws AbleDataException
setFuzzyValue in interface AbleWrsetFuzzyValue in class AbleTypedVariabletheNewValue - A fuzzy set.
AbleDataException - If the value of this object cannot be represented as
a fuzzy value.
public void setGenericValue(java.lang.Object theNewValue)
throws AbleDataException
setGenericValue in interface AbleWrsetGenericValue in class AbleTypedVariabletheNewValue - Any type of Object.
AbleDataException - If the value of this object cannot be derived from
the specified Object.
public void setNumericValue(double theNewValue)
throws AbleDataException
setNumericValue in interface AbleWrsetNumericValue in class AbleTypedVariabletheNewValue - Any number.
If the number is 0.0, the variable is set to false;
any other number sets the variable to true.
AbleDataException - If the value of this object cannot be represented as
a numeric value.
public void setStringValue(java.lang.String theNewValue)
throws AbleDataException
setStringValue in interface AbleWrsetStringValue in class AbleTypedVariabletheNewValue - A string.
If the string is "true" (case insensitive), the variable is set to true;
if the string is "false", the variable is set to false;
any other string causes an exception.
AbleDataException - If the value of this object cannot be represented as
a string value.
public void setValue(AbleLiteral theNewValue)
throws AbleDataException
setValue in interface AbleWrsetValue in class AbleTypedVariabletheNewValue - 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.
AbleDataException - If the value of this object cannot be determined
from the literal object.public java.lang.String arlDclString()
arlDclString in interface AbleWrarlDclString in class AbleTypedVariablepublic java.lang.String xmlDclString()
xmlDclString in interface AbleWrxmlDclString in class AbleTypedVariablepublic java.lang.String armlDclString()
armlDclString in class AbleTypedVariable
public void setValueString(java.lang.String theNewValue)
throws AbleDataException
setValueString in class AbleTypedVariableAbleDataExceptionpublic java.lang.String getValueString()
getValueString in class AbleTypedVariable
public void reset()
throws AbleDataException
reset in class AbleTypedVariableAbleDataException
public void init()
throws AbleDataException
init in class AbleTypedVariableAbleDataExceptionpublic java.lang.Class getDataTypeClass()
AbleLhs
getDataTypeClass in interface AbleRdgetDataTypeClass in class AbleTypedVariablepublic java.lang.String getDataTypeClassName()
AbleLhs
getDataTypeClassName in interface AbleRdgetDataTypeClassName in class AbleTypedVariablepublic java.lang.String getDataTypeName()
getDataTypeName in class AbleTypedVariablepublic java.lang.Class getLiteralClass()
getLiteralClass in class AbleTypedVariablepublic java.lang.String toString()
toString in class AbleTypedVariablepublic java.lang.String traceString(int theTraceStringFlavor)
traceString in interface AbleRdtraceString in class AbleTypedVariabletheTraceStringFlavor - An Able.TraceStringFlavor value.
|
ABLE 2.3.0 07/13/2005 14:21:00 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||