com.caucho.amber.collection
Class MapImpl<K,V>

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by com.caucho.amber.collection.MapImpl<K,V>
All Implemented Interfaces:
AmberCollection, java.util.Map<K,V>

public class MapImpl<K,V>
extends java.util.AbstractMap<K,V>
implements AmberCollection

Represents a lazy collection.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Constructor Summary
MapImpl(AmberConnection aConn, java.lang.String query, java.lang.reflect.Method methodGetMapKey)
           
MapImpl(AmberQuery query, java.lang.reflect.Method methodGetMapKey)
           
 
Method Summary
 void clear()
          Clears the collection.
 void detach()
          Detaches the collection.
 java.util.Set<java.util.Map.Entry<K,V>> entrySet()
          Returns a set view of the mappings contained in this map.
 V get(java.lang.Object key)
          Returns an iterator of the items.
 AmberQuery getQuery()
          Returns the query.
 AmberConnection getSession()
          Returns the session.
protected  boolean isValid()
           
 java.util.Set<K> keySet()
          Returns a set view of the keys contained in this map.
 void putAll(java.util.Map<? extends K,? extends V> map)
          Adds an item to the collection.
 void setSession(AmberConnection aConn)
          Sets the session.
 int size()
          Returns the number of items in the collection.
 void update()
          Updates the collection.
 
Methods inherited from class java.util.AbstractMap
clone, containsKey, containsValue, equals, hashCode, isEmpty, put, remove, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MapImpl

public MapImpl(AmberConnection aConn,
               java.lang.String query,
               java.lang.reflect.Method methodGetMapKey)

MapImpl

public MapImpl(AmberQuery query,
               java.lang.reflect.Method methodGetMapKey)
Method Detail

setSession

public void setSession(AmberConnection aConn)
Sets the session.


getSession

public AmberConnection getSession()
Returns the session.


getQuery

public AmberQuery getQuery()
Returns the query.


size

public int size()
Returns the number of items in the collection.

Specified by:
size in interface java.util.Map<K,V>
Overrides:
size in class java.util.AbstractMap<K,V>

entrySet

public java.util.Set<java.util.Map.Entry<K,V>> entrySet()
Returns a set view of the mappings contained in this map.

Specified by:
entrySet in interface java.util.Map<K,V>
Specified by:
entrySet in class java.util.AbstractMap<K,V>

get

public V get(java.lang.Object key)
Returns an iterator of the items.

Specified by:
get in interface java.util.Map<K,V>
Overrides:
get in class java.util.AbstractMap<K,V>

keySet

public java.util.Set<K> keySet()
Returns a set view of the keys contained in this map.

Specified by:
keySet in interface java.util.Map<K,V>
Overrides:
keySet in class java.util.AbstractMap<K,V>

clear

public void clear()
Clears the collection.

Specified by:
clear in interface java.util.Map<K,V>
Overrides:
clear in class java.util.AbstractMap<K,V>

update

public void update()
Updates the collection.

Specified by:
update in interface AmberCollection

detach

public void detach()
Detaches the collection.


putAll

public void putAll(java.util.Map<? extends K,? extends V> map)
Adds an item to the collection.

Specified by:
putAll in interface java.util.Map<K,V>
Overrides:
putAll in class java.util.AbstractMap<K,V>

isValid

protected boolean isValid()