SMILA (incubation) API documentation

org.eclipse.smila.datamodel
Interface AnySeq

All Superinterfaces:
Any, java.util.Collection<Any>, java.lang.Iterable<Any>, java.util.List<Any>
All Known Implementing Classes:
AnySeqImpl

public interface AnySeq
extends java.util.List<Any>, Any

Interface for a sequence of Any objects.

AnySeq does not allow null values!

Author:
cind01

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.smila.datamodel.Any
Any.ValueType
 
Method Summary
 void add(int index, Any element)
           
 boolean add(java.lang.Number number)
          Long, Integer, Short and Byte values will be converted to Value object of type LONG, all others to Value object of type DOUBLE.
 boolean add(java.lang.String element)
           
 java.util.List<java.lang.Long> asLongs()
          returns all values as a List of Long.
 java.util.List<java.lang.String> asStrings()
          returns all values as a List of Strings.
 java.lang.Boolean getBooleanValue(int index)
           
 java.util.Date getDateTimeValue(int index)
           
 java.util.Date getDateValue(int index)
           
 java.lang.Double getDoubleValue(int index)
           
 java.lang.Long getLongValue(int index)
           
 AnyMap getMap(int index)
           
 AnySeq getSeq(int index)
           
 java.lang.String getStringValue(int index)
           
 Value getValue(int index)
           
 
Methods inherited from interface java.util.List
add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray
 
Methods inherited from interface org.eclipse.smila.datamodel.Any
asMap, asSeq, asValue, getFactory, getValueType, isBoolean, isDate, isDateTime, isDouble, isEmpty, isLong, isMap, isNumber, isSeq, isString, isValue, iterator, size
 

Method Detail

add

boolean add(java.lang.String element)
Parameters:
element - The string object to add
Returns:
true if successfully added, false else

add

boolean add(java.lang.Number number)
Long, Integer, Short and Byte values will be converted to Value object of type LONG, all others to Value object of type DOUBLE.

Parameters:
number - The number object to add
Returns:
true if successfully added, false else

add

void add(int index,
         Any element)
Specified by:
add in interface java.util.List<Any>
Parameters:
index - The index where to add the any object
element - The any object to add

getMap

AnyMap getMap(int index)
Parameters:
index - The index of the object to return
Returns:
The AnyMap matching to the index, an InvalidValueTypeException is thrown if the value is not of type AnyMap

getSeq

AnySeq getSeq(int index)
Parameters:
index - The index of the object to return
Returns:
The AnySeq matching to this index, an InvalidValueTypeException is thrown if the value is not of type

getValue

Value getValue(int index)
Parameters:
index - The index of the object to return
Returns:
The value matching to this index, an InvalidValueTypeException is thrown if the value is no value type.

getStringValue

java.lang.String getStringValue(int index)
Parameters:
index - The index of the object to return
Returns:
The string value matching to this index, an InvalidValueTypeException is thrown if the value is not of type string

getDoubleValue

java.lang.Double getDoubleValue(int index)
Parameters:
index - The index of the object to return
Returns:
The double value matching to this index, an InvalidValueTypeException is thrown if the value is not of type double

getLongValue

java.lang.Long getLongValue(int index)
Parameters:
index - The index of the object to return
Returns:
The long value matching to this index, an InvalidValueTypeException is thrown if the value is not of type long

getBooleanValue

java.lang.Boolean getBooleanValue(int index)
Parameters:
index - The index of the object to return
Returns:
The boolean value matching to this index, an InvalidValueTypeException is thrown if the value is not of type boolean

getDateValue

java.util.Date getDateValue(int index)
Parameters:
index - The index of the object to return
Returns:
The date value matching to this index, an InvalidValueTypeException is thrown if the value is not of type date

getDateTimeValue

java.util.Date getDateTimeValue(int index)
Parameters:
index - The index of the object to return
Returns:
The date time value matching to this index, an InvalidValueTypeException is thrown if the value is not of type date time

asStrings

java.util.List<java.lang.String> asStrings()
returns all values as a List of Strings.

Throws:
InvalidValueTypeException - if not all contained values are strings.

asLongs

java.util.List<java.lang.Long> asLongs()
returns all values as a List of Long.

Throws:
InvalidValueTypeException - if not all contained values are Longs.

SMILA (incubation) API documentation