SMILA (incubation) API documentation

org.eclipse.smila.datamodel.record
Interface Literal

All Superinterfaces:
Annotatable, AttributeValue
All Known Implementing Classes:
LiteralImpl

public interface Literal
extends AttributeValue

Interface of literal attribute values. The value object itself can be of one of these classes:

Author:
jschumacher

Nested Class Summary
static class Literal.DataType
          Enumeration of supported data types.
 
Method Summary
 java.lang.Boolean getBoolValue()
          get the boolean value of the literal if this is a boolean literal.
 Literal.DataType getDataType()
          data type of literal value.
 java.util.Date getDateTimeValue()
          get the datetime value of the literal if this is a datetime literal.
 java.util.Date getDateValue()
          get the date value of the literal if this is a date literal.
 java.lang.Double getFpValue()
          get the floating point value of the literal if this is a floating point literal.
 java.lang.Long getIntValue()
          get the integer value of the literal if this is an integer literal.
 java.lang.String getStringValue()
          get the value object as a string.
 java.util.Date getTimeValue()
          get the time value of the literal if this is a time literal.
 java.lang.Object getValue()
          get the value object.
 void setBoolValue(java.lang.Boolean value)
          set a boolean value for this literal.
 void setDateTimeValue(java.util.Date value)
          set a datetime value for this literal.
 void setDateValue(java.util.Date value)
          set a date value for this literal.
 void setFpValue(java.lang.Double value)
          set a floating point value for this literal.
 void setIntValue(java.lang.Integer value)
          set an integer value for this literal. just a convenience method that converts to java.lang.Long
 void setIntValue(java.lang.Long value)
          set an integer value for this literal.
 void setStringValue(java.lang.String value)
          set a string value for this literal.
 void setTimeValue(java.util.Date value)
          set a time value for this literal.
 void setValue(java.lang.Object value)
          set a new value object for this literal.
 
Methods inherited from interface org.eclipse.smila.datamodel.record.AttributeValue
getSemanticType, setSemanticType
 
Methods inherited from interface org.eclipse.smila.datamodel.record.Annotatable
addAnnotation, annotationsSize, getAnnotation, getAnnotationNames, getAnnotations, hasAnnotation, hasAnnotations, removeAnnotations, removeAnnotations, setAnnotation, setAnnotations
 

Method Detail

getDataType

Literal.DataType getDataType()
data type of literal value. See DataType enum in this interface for values.

Returns:
data type object.

getValue

java.lang.Object getValue()
get the value object.

Returns:
the value object.

getStringValue

java.lang.String getStringValue()
get the value object as a string. If the actual object is instance of string already, it is returned immediately. Else, toString() is used on the object to create a string representation.

Returns:
the string value object.

getIntValue

java.lang.Long getIntValue()
get the integer value of the literal if this is an integer literal.

Returns:
the value Long object if this literal is an integer literal, else null

getFpValue

java.lang.Double getFpValue()
get the floating point value of the literal if this is a floating point literal.

Returns:
the value Double object if this literal is a floating point literal, else null

getBoolValue

java.lang.Boolean getBoolValue()
get the boolean value of the literal if this is a boolean literal.

Returns:
the value Boolean object if this literal is a boolean literal, else null

getDateValue

java.util.Date getDateValue()
get the date value of the literal if this is a date literal.

Returns:
the value Date object if this literal is a date literal, else null

getTimeValue

java.util.Date getTimeValue()
get the time value of the literal if this is a time literal.

Returns:
the value Date object if this literal is a time literal, else null

getDateTimeValue

java.util.Date getDateTimeValue()
get the datetime value of the literal if this is a datetime literal.

Returns:
the value Date object if this literal is a datetime literal, else null

setValue

void setValue(java.lang.Object value)
              throws InvalidTypeException
set a new value object for this literal. An exception is throws if the object is not an instance of one of the supported classes or cannot be converted to one in a useful way.

Parameters:
value - new value object.
Throws:
InvalidTypeException - illegal class of value object.

setStringValue

void setStringValue(java.lang.String value)
set a string value for this literal.

Parameters:
value - new string value.

setIntValue

void setIntValue(java.lang.Long value)
set an integer value for this literal.

Parameters:
value - new integer value.

setIntValue

void setIntValue(java.lang.Integer value)
set an integer value for this literal. just a convenience method that converts to java.lang.Long

Parameters:
value - new integer value.

setFpValue

void setFpValue(java.lang.Double value)
set a floating point value for this literal.

Parameters:
value - new floating point value.

setBoolValue

void setBoolValue(java.lang.Boolean value)
set a boolean value for this literal.

Parameters:
value - new boolean value

setDateValue

void setDateValue(java.util.Date value)
set a date value for this literal.

Parameters:
value - new date value

setTimeValue

void setTimeValue(java.util.Date value)
set a time value for this literal.

Parameters:
value - new date/time/datetime value

setDateTimeValue

void setDateTimeValue(java.util.Date value)
set a datetime value for this literal.

Parameters:
value - new datetime value

SMILA (incubation) API documentation