Overview | Package | Class | Use | Tree | Serialized | Deprecated | Index | Help
| 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

## com.ibm.able.data
Class AbleArrayLiteral

    java.lang.Object
      com.ibm.able.data.AbleLiteral
          com.ibm.able.data.AbleArrayLiteral

All Implemented Interfaces:
  AbleRd, java.io.Serializable

public class AbleArrayLiteral
extends AbleLiteral
implements java.io.Serializable

This class wraps a value of the type Object[] in an AbleLiteral object. An object of type AbleArrayLiteral contains a single, immutable field whose type is Object[]. Instances of AbleArrayLiteral are used by the Able rules classes in clauses and expressions. In addition, this class provides methods for logical comparison operators and for accessing single elements based on index value.

See Also:
  Serialized Form

Field Summary
`protected static java.text.NumberFormat` | `myNumberFormat`
`protected java.lang.Object` | `myValue` The immutable value of this literal.

Constructor Summary
`AbleArrayLiteral(java.lang.Object theValue)` Create a new literal with the specified value.

Method Summary
`java.lang.String` | `arlCRdString()` Return a formal ARL "clause read" string that describes this data object.
`static java.lang.String` | `arrayToString(java.lang.Object theArray)` Format a Java array for output display Java just returns an object ref, we need pretty print
`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.
`int` | `getDataType()` Retrieve the data type of 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.
`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.
`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` | `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` | `xmlCRdString()` Return a formal XML "clause read" string that describes this data object.

Methods inherited from class com.ibm.able.data.AbleLiteral
`bitwiseAND, bitwiseNOT, bitwiseOR, bitwiseShiftLeft, bitwiseShiftRight, bitwiseShiftRightZeroFill, bitwiseXOR, cmpGt, cmpGtEq, cmpIs, cmpLt, cmpLtEq, compDivide, compMinus, compModulo, compMultiply, compPlus, compUnaryMinus, getDataTypeAsString, getReferent, getReferents, getTemplateString, isConstant, logicalAND, logicalNOT, logicalOR`

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

  The immutable value of this literal.

### myNumberFormat

    protected static java.text.NumberFormat myNumberFormat

Constructor Detail

### AbleArrayLiteral

    public AbleArrayLiteral(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.

  Specified by:
    `getBooleanValue` in interface `AbleRd`
  Specified by:
    `getBooleanValue` in class `AbleLiteral`
  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.

### getFuzzyValue

    public AbleFuzzySet getFuzzyValue()
                               throws AbleDataException

  Retrieve the value of this data object as a fuzzy value.

  Specified by:
    `getFuzzyValue` in interface `AbleRd`
  Specified by:
    `getFuzzyValue` in class `AbleLiteral`
  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.

### getGenericValue

    public java.lang.Object getGenericValue()
                                     throws AbleDataException

  Retrieve the value of this data object as an Object.

  Specified by:
    `getGenericValue` in interface `AbleRd`
  Specified by:
    `getGenericValue` in class `AbleLiteral`
  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.

### getNumericValue

    public double getNumericValue()
                           throws AbleDataException

  Retrieve the value of this data object as a numeric value.

  Specified by:
    `getNumericValue` in interface `AbleRd`
  Specified by:
    `getNumericValue` in class `AbleLiteral`
  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.

### 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`
  Specified by:
    `getStringValue` in class `AbleLiteral`
  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.

### getValue

    public AbleLiteral getValue()
                         throws AbleDataException

  Retrieve the value of this data object as a literal.

  Specified by:
    `getValue` in interface `AbleRd`
  Specified by:
    `getValue` in class `AbleLiteral`
  Returns:
    An AbleGenericLiteral object.
  Throws:
    `AbleDataException` - If the value of this object cannot be represented as a literal.

### getDataTypeClass

    public java.lang.Class getDataTypeClass()

  Description copied from class: `AbleLiteral`
  Retrieve the actual class of this object's underlying data type.

  Specified by:
    `getDataTypeClass` in interface `AbleRd`
  Specified by:
    `getDataTypeClass` in class `AbleLiteral`
  Returns:
    The class of the underlying data type.

### getDataTypeClassName

    public java.lang.String getDataTypeClassName()

  Description copied from class: `AbleLiteral`
  Retrieve the name of the class of this object's underlying data type.

  Specified by:
    `getDataTypeClassName` in interface `AbleRd`
  Specified by:
    `getDataTypeClassName` in class `AbleLiteral`
  Returns:
    A String that is the name of the class of the underlying data type.

### arlCRdString

    public java.lang.String arlCRdString()

  Return a formal ARL "clause read" string that describes this data object.

  Specified by:
    `arlCRdString` in interface `AbleRd`
  Specified by:
    `arlCRdString` in class `AbleLiteral`
  Returns:
    A String describing the data object in formal rule language.

### xmlCRdString

    public java.lang.String xmlCRdString()

  Return a formal XML "clause read" string that describes this data object.

  Specified by:
    `xmlCRdString` in interface `AbleRd`
  Specified by:
    `xmlCRdString` in class `AbleLiteral`
  Returns:
    A String describing the data object in XML.

### 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.

  Specified by:
    `cmpEq` in interface `AbleRd`
  Overrides:
    `cmpEq` in class `AbleLiteral`
  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.

### 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.

  Specified by:
    `cmpNeq` in interface `AbleRd`
  Overrides:
    `cmpNeq` in class `AbleLiteral`
  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.

### toString

    public java.lang.String toString()

  Retrieve a string describing (the contents of) the object.

  Overrides:
    `toString` in class `AbleLiteral`
  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`
  Specified by:
    `traceString` in class `AbleLiteral`
  Parameters:
    `theTraceStringFlavor` - An Able.TraceStringFlavor value.

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

### arrayToString

    public static java.lang.String arrayToString(java.lang.Object theArray)
                                          throws AbleDataException

  Format a Java array for output display Java just returns an object ref, we need pretty print

  Throws:
    `AbleDataException`

### getDataType

    public int getDataType()

  Description copied from class: `AbleLiteral`
  Retrieve the data type of this data object.

  Specified by:
    `getDataType` in interface `AbleRd`
  Specified by:
    `getDataType` in class `AbleLiteral`
  Returns:
    An AbleData.<DataType> constant.
  See Also:
    `AbleRd.getDataType()`

Overview | Package | Class | Use | Tree | Serialized | Deprecated | Index | Help
| 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

(C) Copyright IBM Corporation 1999, 2005