SMILA 1.0 API documentation

org.eclipse.smila.datamodel.impl
Class ImmutableAnyMapImpl

java.lang.Object
  extended by org.eclipse.smila.datamodel.impl.ImmutableAnyMapImpl
All Implemented Interfaces:
java.lang.Iterable<Any>, java.util.Map<java.lang.String,Any>, Any, AnyMap

public class ImmutableAnyMapImpl
extends java.lang.Object
implements AnyMap

immutable decorator for an AnyMap.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.smila.datamodel.Any
Any.ValueType
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Method Summary
 void add(java.lang.String key, Any value)
          Adds the given value to the mapped entry of the given key.
 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.
 void clear()
           
 boolean containsKey(java.lang.Object key)
           
 boolean containsValue(java.lang.Object value)
           
 java.util.Set<java.util.Map.Entry<java.lang.String,Any>> entrySet()
           
 boolean equals(java.lang.Object o)
           
 Any get(java.lang.Object key)
           
 java.lang.Boolean getBooleanValue(java.lang.String key)
           
 java.util.Date getDateTimeValue(java.lang.String key)
           
 java.util.Date getDateValue(java.lang.String key)
           
 java.lang.Double getDoubleValue(java.lang.String key)
           
 DataFactory getFactory()
           
 java.lang.Long getLongValue(java.lang.String key)
           
 AnyMap getMap(java.lang.String key)
           
 AnyMap getMap(java.lang.String key, boolean create)
          Gets the map and optionally creates one under the given key if not present.
 AnySeq getSeq(java.lang.String key)
           
 AnySeq getSeq(java.lang.String key, boolean create)
          Gets the seq and optionally creates one under the given key if not present.
 java.lang.String getStringValue(java.lang.String key)
           
 Value getValue(java.lang.String key)
           
 Any.ValueType getValueType()
           
 int hashCode()
           
 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()
           
 java.util.Set<java.lang.String> keySet()
           
 Any put(java.lang.String key, Any value)
           
 Any put(java.lang.String key, java.lang.Boolean value)
           
 Any put(java.lang.String key, java.lang.Number value)
          Long, Integer, Short and Byte values will be converted to Value object of type LONG, all others to Value object of type DOUBLE.
 Any put(java.lang.String key, java.lang.String value)
           
 void putAll(java.util.Map<? extends java.lang.String,? extends Any> m)
           
 Any remove(java.lang.Object key)
           
 int size()
           
 java.util.Collection<Any> values()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

add

public void add(java.lang.String key,
                Any value)
Description copied from interface: AnyMap
Adds the given value to the mapped entry of the given key. If there's no mapping yet, the new value is added as Seq with one value. If the key is currently mapped to a Value/Map, the Value/Map is converted to a Seq containing the Value/Map and the Seq is added. If the key is currently mapped to a Seq, new value is added to that Seq.

Specified by:
add in interface AnyMap
Parameters:
key -
value -
See Also:
AnyMap.add(java.lang.String, org.eclipse.smila.datamodel.Any)

asMap

public AnyMap asMap()
Description copied from interface: Any
returns this Any as an AnyMap object or throws an InvalidValueTypeException.

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

asSeq

public AnySeq asSeq()
Description copied from interface: Any
returns this Any as an AnySeq object or throws an InvalidValueTypeException.

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

asValue

public Value asValue()
Description copied from interface: Any
returns this Any as an Value object or throws an InvalidValueTypeException.

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

clear

public void clear()
Specified by:
clear in interface java.util.Map<java.lang.String,Any>
See Also:
Map.clear()

containsKey

public boolean containsKey(java.lang.Object key)
Specified by:
containsKey in interface java.util.Map<java.lang.String,Any>
Parameters:
key -
Returns:
See Also:
Map.containsKey(java.lang.Object)

containsValue

public boolean containsValue(java.lang.Object value)
Specified by:
containsValue in interface java.util.Map<java.lang.String,Any>
Parameters:
value -
Returns:
See Also:
Map.containsValue(java.lang.Object)

entrySet

public java.util.Set<java.util.Map.Entry<java.lang.String,Any>> entrySet()
Specified by:
entrySet in interface java.util.Map<java.lang.String,Any>
Returns:
See Also:
Map.entrySet()

equals

public boolean equals(java.lang.Object o)
Specified by:
equals in interface java.util.Map<java.lang.String,Any>
Overrides:
equals in class java.lang.Object
Parameters:
o -
Returns:
See Also:
Map.equals(java.lang.Object)

get

public Any get(java.lang.Object key)
Specified by:
get in interface java.util.Map<java.lang.String,Any>
Parameters:
key -
Returns:
See Also:
Map.get(java.lang.Object)

getBooleanValue

public java.lang.Boolean getBooleanValue(java.lang.String key)
Specified by:
getBooleanValue in interface AnyMap
Parameters:
key -
Returns:
See Also:
AnyMap.getBooleanValue(java.lang.String)

getDateTimeValue

public java.util.Date getDateTimeValue(java.lang.String key)
Specified by:
getDateTimeValue in interface AnyMap
Parameters:
key -
Returns:
See Also:
AnyMap.getDateTimeValue(java.lang.String)

getDateValue

public java.util.Date getDateValue(java.lang.String key)
Specified by:
getDateValue in interface AnyMap
Parameters:
key -
Returns:
See Also:
AnyMap.getDateValue(java.lang.String)

getDoubleValue

public java.lang.Double getDoubleValue(java.lang.String key)
Specified by:
getDoubleValue in interface AnyMap
Parameters:
key -
Returns:
See Also:
AnyMap.getDoubleValue(java.lang.String)

getFactory

public DataFactory getFactory()
Specified by:
getFactory in interface Any
Returns:
See Also:
Any.getFactory()

getLongValue

public java.lang.Long getLongValue(java.lang.String key)
Specified by:
getLongValue in interface AnyMap
Parameters:
key -
Returns:
See Also:
AnyMap.getLongValue(java.lang.String)

getMap

public AnyMap getMap(java.lang.String key)
Specified by:
getMap in interface AnyMap
Parameters:
key -
Returns:
See Also:
AnyMap.getMap(java.lang.String)

getMap

public AnyMap getMap(java.lang.String key,
                     boolean create)
Description copied from interface: AnyMap
Gets the map and optionally creates one under the given key if not present.

Specified by:
getMap in interface AnyMap
Parameters:
key -
create -
Returns:
See Also:
AnyMap.getMap(java.lang.String, boolean)

getSeq

public AnySeq getSeq(java.lang.String key)
Specified by:
getSeq in interface AnyMap
Parameters:
key -
Returns:
See Also:
AnyMap.getSeq(java.lang.String)

getSeq

public AnySeq getSeq(java.lang.String key,
                     boolean create)
Description copied from interface: AnyMap
Gets the seq and optionally creates one under the given key if not present.

Specified by:
getSeq in interface AnyMap
Parameters:
key -
create -
Returns:
See Also:
AnyMap.getSeq(java.lang.String, boolean)

getStringValue

public java.lang.String getStringValue(java.lang.String key)
Specified by:
getStringValue in interface AnyMap
Parameters:
key -
Returns:
See Also:
AnyMap.getStringValue(java.lang.String)

getValue

public Value getValue(java.lang.String key)
Specified by:
getValue in interface AnyMap
Parameters:
key -
Returns:
See Also:
AnyMap.getValue(java.lang.String)

getValueType

public Any.ValueType getValueType()
Specified by:
getValueType in interface Any
Returns:
See Also:
Any.getValueType()

hashCode

public int hashCode()
Specified by:
hashCode in interface java.util.Map<java.lang.String,Any>
Overrides:
hashCode in class java.lang.Object
Returns:
See Also:
Map.hashCode()

isBoolean

public boolean isBoolean()
Specified by:
isBoolean in interface Any
Returns:
See Also:
Any.isBoolean()

isDate

public boolean isDate()
Specified by:
isDate in interface Any
Returns:
See Also:
Any.isDate()

isDateTime

public boolean isDateTime()
Specified by:
isDateTime in interface Any
Returns:
See Also:
Any.isDateTime()

isDouble

public boolean isDouble()
Specified by:
isDouble in interface Any
Returns:
See Also:
Any.isDouble()

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Map<java.lang.String,Any>
Specified by:
isEmpty in interface Any
Returns:
See Also:
Any.isEmpty()

isLong

public boolean isLong()
Specified by:
isLong in interface Any
Returns:
See Also:
Any.isLong()

isMap

public boolean isMap()
Specified by:
isMap in interface Any
Returns:
See Also:
Any.isMap()

isNumber

public boolean isNumber()
Specified by:
isNumber in interface Any
Returns:
See Also:
Any.isNumber()

isSeq

public boolean isSeq()
Specified by:
isSeq in interface Any
Returns:
See Also:
Any.isSeq()

isString

public boolean isString()
Specified by:
isString in interface Any
Returns:
See Also:
Any.isString()

isValue

public boolean isValue()
Specified by:
isValue in interface Any
Returns:
See Also:
Any.isValue()

iterator

public java.util.Iterator<Any> iterator()
Specified by:
iterator in interface java.lang.Iterable<Any>
Specified by:
iterator in interface Any
Returns:
See Also:
Any.iterator()

keySet

public java.util.Set<java.lang.String> keySet()
Specified by:
keySet in interface java.util.Map<java.lang.String,Any>
Returns:
See Also:
Map.keySet()

put

public Any put(java.lang.String key,
               Any value)
Specified by:
put in interface java.util.Map<java.lang.String,Any>
Specified by:
put in interface AnyMap
Parameters:
key -
value -
Returns:
See Also:
Map.put(java.lang.Object, java.lang.Object)

put

public Any put(java.lang.String key,
               java.lang.Boolean value)
Specified by:
put in interface AnyMap
Parameters:
key -
value -
Returns:
See Also:
AnyMap.put(java.lang.String, java.lang.Boolean)

put

public Any put(java.lang.String key,
               java.lang.Number value)
Description copied from interface: AnyMap
Long, Integer, Short and Byte values will be converted to Value object of type LONG, all others to Value object of type DOUBLE.

Specified by:
put in interface AnyMap
Parameters:
key -
value -
Returns:
See Also:
AnyMap.put(java.lang.String, java.lang.Number)

put

public Any put(java.lang.String key,
               java.lang.String value)
Specified by:
put in interface AnyMap
Parameters:
key -
value -
Returns:
See Also:
AnyMap.put(java.lang.String, java.lang.String)

putAll

public void putAll(java.util.Map<? extends java.lang.String,? extends Any> m)
Specified by:
putAll in interface java.util.Map<java.lang.String,Any>
Parameters:
m -
See Also:
Map.putAll(java.util.Map)

remove

public Any remove(java.lang.Object key)
Specified by:
remove in interface java.util.Map<java.lang.String,Any>
Parameters:
key -
Returns:
See Also:
Map.remove(java.lang.Object)

size

public int size()
Specified by:
size in interface java.util.Map<java.lang.String,Any>
Specified by:
size in interface Any
Returns:
See Also:
Any.size()

values

public java.util.Collection<Any> values()
Specified by:
values in interface java.util.Map<java.lang.String,Any>
Returns:
See Also:
Map.values()

SMILA 1.0 API documentation