SMILA 1.0 API documentation

org.eclipse.smila.datamodel
Interface Any

All Superinterfaces:
java.lang.Iterable<Any>
All Known Subinterfaces:
AnyMap, AnySeq, Value
All Known Implementing Classes:
AbstractAny, AnyMapImpl, AnySeqImpl, ImmutableAnyMapImpl, ValueImpl

public interface Any
extends java.lang.Iterable<Any>

Interface for metadata objects. See SMILA Data Model for details.


Nested Class Summary
static class Any.ValueType
          Enumeration with the possible value types.
 
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 isEmpty()
           
 boolean isLong()
           
 boolean isMap()
           
 boolean isNumber()
           
 boolean isSeq()
           
 boolean isString()
           
 boolean isValue()
           
 java.util.Iterator<Any> iterator()
           
 int size()
           
 

Method Detail

getValueType

Any.ValueType getValueType()
Returns:
value type

isMap

boolean isMap()
Returns:
true if value is of type map

isSeq

boolean isSeq()
Returns:
true if value is of type sequence

isValue

boolean isValue()
Returns:
true if value is of type value

isString

boolean isString()
Returns:
true if value is of type string

isDouble

boolean isDouble()
Returns:
true if value is of type double

isBoolean

boolean isBoolean()
Returns:
true if value is of type boolean

isLong

boolean isLong()
Returns:
true if value is of type long

isDate

boolean isDate()
Returns:
true if value is of type date

isDateTime

boolean isDateTime()
Returns:
true if value is of type date time

isNumber

boolean isNumber()
Returns:
true if value is of type long or double

getFactory

DataFactory getFactory()
Returns:
data factory to create Anys of the same kind.

iterator

java.util.Iterator<Any> iterator()
Specified by:
iterator in interface java.lang.Iterable<Any>
Returns:
iterator over elements. For Value, this return an iterator about the value itself. For AnyMap it returns an iterator on the values.

isEmpty

boolean isEmpty()
Returns:
true, if the Any does not have content. For Value: returns always false.

size

int size()
Returns:
size of Any. For Value this is always 1.

asValue

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


asMap

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


asSeq

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


SMILA 1.0 API documentation