SMILA (incubation) API documentation

org.eclipse.smila.datamodel.impl
Class AbstractAny

java.lang.Object
  extended by org.eclipse.smila.datamodel.impl.AbstractAny
All Implemented Interfaces:
java.io.Serializable, java.lang.Iterable<Any>, Any
Direct Known Subclasses:
AnyMapImpl, AnySeqImpl, ValueImpl

public abstract class AbstractAny
extends java.lang.Object
implements Any, java.io.Serializable

Basic abstract implementation class for Any.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.smila.datamodel.Any
Any.ValueType
 
Field Summary
protected  Any.ValueType _valueType
          type of this value object.
 
Constructor Summary
protected AbstractAny(Any.ValueType valueType)
          Constructs a new AbstractAny.
 
Method Summary
 AnyMap asMap()
          returns this Any as an AnyMap object or throws an InvalidValueTypeException.
 AnySeq asSeq()
          returns this Any as an AnySeq object or throws an InvalidValueTypeException.
 Value asValue()
          returns this Any as an Value object or throws an InvalidValueTypeException.
 DataFactory getFactory()
          
 Any.ValueType getValueType()
          
 boolean isBoolean()
          
 boolean isDate()
          
 boolean isDateTime()
          
 boolean isDouble()
          
 boolean isLong()
          
 boolean isMap()
          
 boolean isNumber()
          
 boolean isSeq()
          
 boolean isString()
          
 boolean isValue()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.smila.datamodel.Any
isEmpty, iterator, size
 

Field Detail

_valueType

protected final Any.ValueType _valueType
type of this value object.

Constructor Detail

AbstractAny

protected AbstractAny(Any.ValueType valueType)
Constructs a new AbstractAny.

Parameters:
valueType - the type of the AnbstractAny.
Method Detail

getValueType

public Any.ValueType getValueType()

Specified by:
getValueType in interface Any
Returns:
value type

isMap

public boolean isMap()

Specified by:
isMap in interface Any
Returns:
true if value is of type map

isSeq

public boolean isSeq()

Specified by:
isSeq in interface Any
Returns:
true if value is of type sequence

isValue

public boolean isValue()

Specified by:
isValue in interface Any
Returns:
true if value is of type value

isString

public boolean isString()

Specified by:
isString in interface Any
Returns:
true if value is of type string

isDouble

public boolean isDouble()

Specified by:
isDouble in interface Any
Returns:
true if value is of type double

isBoolean

public boolean isBoolean()

Specified by:
isBoolean in interface Any
Returns:
true if value is of type boolean

isLong

public boolean isLong()

Specified by:
isLong in interface Any
Returns:
true if value is of type long

isDate

public boolean isDate()

Specified by:
isDate in interface Any
Returns:
true if value is of type date

isDateTime

public boolean isDateTime()

Specified by:
isDateTime in interface Any
Returns:
true if value is of type date time

isNumber

public boolean isNumber()

Specified by:
isNumber in interface Any
Returns:
true if value is of type long or double

getFactory

public DataFactory getFactory()

Specified by:
getFactory in interface Any
Returns:
data factory to create Anys of the same kind.

asValue

public Value asValue()
returns this Any as an Value object or throws an InvalidValueTypeException.

Specified by:
asValue in interface Any
See Also:
Any.asValue()

asMap

public AnyMap asMap()
returns this Any as an AnyMap object or throws an InvalidValueTypeException.

Specified by:
asMap in interface Any
See Also:
Any.asMap()

asSeq

public AnySeq asSeq()
returns this Any as an AnySeq object or throws an InvalidValueTypeException.

Specified by:
asSeq in interface Any
See Also:
Any.asSeq()

SMILA (incubation) API documentation