ABLE, Version 1.1b

com.ibm.able.data
Class AbleGenericLiteral

java.lang.Object
  |
  +--com.ibm.able.data.AbleLiteral
        |
        +--com.ibm.able.data.AbleGenericLiteral

public class AbleGenericLiteral
extends AbleLiteral
implements java.io.Serializable

This class defines the Able data generic literal.

Version:
$Revision: 1.4 $, $Date: 2000/08/24 12:13:34 $
See Also:
Serialized Form

Field Summary
protected  java.lang.Object myValue
           
 
Fields inherited from class com.ibm.able.data.AbleLiteral
myDataType
 
Constructor Summary
AbleGenericLiteral(java.lang.Object theValue)
          Create a new literal with the specified value.
 
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.
 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 rlCRdString()
          Return a formal rule language "clause read" string that describes this data object.
 java.lang.String toString()
          Retrieve a string describing (the contents of) the object.
 java.lang.String xmlCRdString()
          Return a formal XML "clause read" string that describes this data object.
 
Methods inherited from class com.ibm.able.data.AbleLiteral
cmpGt, cmpGtEq, cmpIs, cmpLt, cmpLtEq, getDataType, getDataTypeAsString, getReferent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

myValue

protected java.lang.Object myValue
Constructor Detail

AbleGenericLiteral

public AbleGenericLiteral(java.lang.Object theValue)
Create a new literal with the specified value.
Parameters:
theValue - The value to which this literal is to be set.

Method Detail

getBooleanValue

public boolean getBooleanValue()
                        throws AbleDataException
Retrieve the value of this data object as a boolean value.
Returns:
A boolean, if the value of this object can be represented as a boolean value.
Throws:
AbleDataException - If the value of this object cannot be represented as a boolean value.
Overrides:
getBooleanValue in class AbleLiteral

getFuzzyValue

public AbleLiteral getFuzzyValue()
                          throws AbleDataException
Retrieve the value of this data object as a fuzzy value.
Returns:
A fuzzy set, if the value of this object can be represented as a fuzzy value. This method always throws an exception.
Throws:
AbleDataException - If the value of this object cannot be represented as a fuzzy value.
Overrides:
getFuzzyValue in class AbleLiteral

getGenericValue

public java.lang.Object getGenericValue()
                                 throws AbleDataException
Retrieve the value of this data object as an Object.
Returns:
Any type of Object. Note that null is a valid value.
Throws:
AbleDataException - If the value of this object cannot be represented as an Object.
Overrides:
getGenericValue in class AbleLiteral

getNumericValue

public double getNumericValue()
                       throws AbleDataException
Retrieve the value of this data object as a numeric value.
Returns:
A double, if the value of this object can be represented as a numeric value.
Throws:
AbleDataException - If the value of this object cannot be represented as a numeric value.
Overrides:
getNumericValue in class AbleLiteral

getStringValue

public java.lang.String getStringValue()
                                throws AbleDataException
Retrieve the value of this data object as a string value.
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.
Overrides:
getStringValue in class AbleLiteral

getValue

public AbleLiteral getValue()
                     throws AbleDataException
Retrieve the value of this data object as a literal.
Returns:
An AbleGenericLiteral object.
Throws:
AbleDataException - If the value of this object cannot be represented as a literal.
Overrides:
getValue in class AbleLiteral

rlCRdString

public java.lang.String rlCRdString()
Return a formal rule language "clause read" string that describes this data object.
Returns:
A String describing the data object in formal rule language.
Overrides:
rlCRdString in class AbleLiteral

xmlCRdString

public java.lang.String xmlCRdString()
Return a formal XML "clause read" string that describes this data object.
Returns:
A String describing the data object in XML.
Overrides:
xmlCRdString in class AbleLiteral

cmpEq

public boolean cmpEq(AbleRd theRhs)
              throws AbleDataException
Comparison, equal to: compare the current value of this data object to the current value of theRhs.

"==" is used for numeric and boolean compares; equals() is used for Object compares; and Collator.equals() is used for String compares.

Parameters:
theRhs - The right-hand side of the comparison.

Returns:
true, if this data object is equal to theRhs; false, otherwise.
Throws:
AbleDataException - If the right-hand side cannot be converted (if necessary) and compared to this data object.
Overrides:
cmpEq in class AbleLiteral

cmpNeq

public boolean cmpNeq(AbleRd theRhs)
               throws AbleDataException
Comparison, not equal to: compare the current value of this data object to the current value of theRhs.

"!=" is used for numeric and boolean compares; ! equals() is used for Object compares; and ! Collator.equals() is used for String compares.

Parameters:
theRhs - The right-hand side of the comparison.

Returns:
true, if this data object is not equal to theRhs; false, otherwise.
Throws:
AbleDataException - If the right-hand side cannot be converted (if necessary) and compared to this data object.
Overrides:
cmpNeq in class AbleLiteral

toString

public java.lang.String toString()
Retrieve a string describing (the contents of) the object.
Returns:
A String containing the current contents of the object.
Overrides:
toString in class AbleLiteral

Copyright

public static java.lang.String Copyright()
Determine the copyright of this class.
Returns:
A String containing this class's copyright statement.

ABLE, Version 1.1b

ABLE: Produced by Joe, Don, and Jeff who say, 'Thanks for your support.'