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 AbleTimeStampLiteral

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

All Implemented Interfaces:
  AbleRd, java.io.Serializable

public class AbleTimeStampLiteral
extends AbleLiteral
implements java.io.Serializable

This class wraps a value of a Java Calendar object inside an AbleLiteral. An object of type AbleTimeStampLiteral contains a single, immutable field whose type is Calendar. Instances of AbleTimeStampLiteral are used by the Able rules classes in clauses and expressions. In addition, this class provides methods for converting a Calendar to a String value as well as other logical comparison and math operator methods useful when dealing with a Calendar.

See Also:
  Serialized Form

Field Summary
`protected java.util.Calendar` | `myValue` The immutable value of this literal.

Constructor Summary
`AbleTimeStampLiteral()` Create a new literal with the current time as the initial value.
`AbleTimeStampLiteral(java.util.Calendar theValue)` Create a new literal with the specified value.
`AbleTimeStampLiteral(java.lang.String 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.
`boolean` | `cmpEq(AbleRd theRhs)` Comparison, equal to: compare the current value of this data object to the current value of theRhs.
`boolean` | `cmpGt(AbleRd theRhs)` Comparison, greater than: compare the current value of this data object to the current value of theRhs.
`boolean` | `cmpGtEq(AbleRd theRhs)` Comparison, greater than or equal to: compare the current value of this data object to the current value of theRhs.
`boolean` | `cmpLt(AbleRd theRhs)` Comparison, less than: compare the current value of this data object to the current value of theRhs.
`boolean` | `cmpLtEq(AbleRd theRhs)` Comparison, less than or 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` | `equals(java.lang.Object theOtherObject)`
`java.lang.String` | `formatDateAndTime(java.util.Calendar theCalendar)` Return a formatted string representation of the specified Calendar object using the default format.
`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.
`int` | `hashCode()`
`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, cmpIs, compDivide, compMinus, compModulo, compMultiply, compPlus, compUnaryMinus, getDataTypeAsString, getReferent, getReferents, getTemplateString, isConstant, logicalAND, logicalNOT, logicalOR`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### myValue

    protected java.util.Calendar myValue

  The immutable value of this literal.

Constructor Detail

### AbleTimeStampLiteral

    public AbleTimeStampLiteral()

  Create a new literal with the current time as the initial value.

### AbleTimeStampLiteral

    public AbleTimeStampLiteral(java.util.Calendar theValue)

  Create a new literal with the specified value.

Parameters:
  `theValue` - The value to which this literal is to be set.

### AbleTimeStampLiteral

    public AbleTimeStampLiteral(java.lang.String 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. If the current value is 0.0, false is returned; otherwise true is returned.
  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:
    A Double object.
  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. Double.toString() is used to produce the string.
  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 AbleNumericLiteral 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. Double.toString() is used to produce the string.

### 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. A form similar to "<numericLiteral value=\"n.m\"/>" is returned.

### formatDateAndTime

    public java.lang.String formatDateAndTime(java.util.Calendar theCalendar)

  Return a formatted string representation of the specified Calendar object using the default format.

  Parameters:
    `theCalendar` - A Calendar object.

  Returns:
    A formatted string.

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

### cmpGt

    public boolean cmpGt(AbleRd theRhs)
                  throws AbleDataException

  Comparison, greater than: compare the current value of this data object to the current value of theRhs.

  ">" is used for numeric compares; Collator.compare() is used for String compares. Use of other data types on the left-hand side causes an exception.

  Specified by:
    `cmpGt` in interface `AbleRd`
  Overrides:
    `cmpGt` in class `AbleLiteral`
  Parameters:
    `theRhs` - The right-hand side of the comparison.

  Returns:
    true, if this data object is greater than theRhs; false, otherwise.
  Throws:
    `AbleDataException` - If the right-hand side cannot be converted (if necessary) and compared to this data object.

### cmpGtEq

    public boolean cmpGtEq(AbleRd theRhs)
                    throws AbleDataException

  Comparison, greater than or equal to: compare the current value of this data object to the current value of theRhs.

  ">=" is used for numeric compares; Collator.compare() is used for String compares. Use of other data types on the left-hand side causes an exception.

  Specified by:
    `cmpGtEq` in interface `AbleRd`
  Overrides:
    `cmpGtEq` in class `AbleLiteral`
  Parameters:
    `theRhs` - The right-hand side of the comparison.

  Returns:
    true, if this data object is greater than or equal to theRhs; false, otherwise.
  Throws:
    `AbleDataException` - If the right-hand side cannot be converted (if necessary) and compared to this data object.

### cmpLt

    public boolean cmpLt(AbleRd theRhs)
                  throws AbleDataException

  Comparison, less than: compare the current value of this data object to the current value of theRhs.

  "<" is used for numeric compares; Collator.compare() is used for String compares. Use of other data types on the left-hand side causes an exception.

  Specified by:
    `cmpLt` in interface `AbleRd`
  Overrides:
    `cmpLt` in class `AbleLiteral`
  Parameters:
    `theRhs` - The right-hand side of the comparison.

  Returns:
    true, if this data object is less than theRhs; false, otherwise.
  Throws:
    `AbleDataException` - If the right-hand side cannot be converted (if necessary) and compared to this data object.

### cmpLtEq

    public boolean cmpLtEq(AbleRd theRhs)
                    throws AbleDataException

  Comparison, less than or equal to: compare the current value of this data object to the current value of theRhs.

  "<=" is used for numeric compares; Collator.compare() is used for String compares. Use of other data types on the left-hand side causes an exception.

  Specified by:
    `cmpLtEq` in interface `AbleRd`
  Overrides:
    `cmpLtEq` in class `AbleLiteral`
  Parameters:
    `theRhs` - The right-hand side of the comparison.

  Returns:
    true, if this data object is less than or 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.

### equals

    public boolean equals(java.lang.Object theOtherObject)

### hashCode

    public int hashCode()

### toString

    public java.lang.String toString()

  Description copied from class: `AbleLiteral`
  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.

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