org.apache.activemq.kaha
Interface MapContainer

All Superinterfaces:
Map
All Known Implementing Classes:
MapContainerImpl

public interface MapContainer
extends Map

Represents a container of persistent objects in the store Acts as a map, but values can be retrieved in insertion order

Version:
$Revision: 1.2 $

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Method Summary
 void clear()
          empty the container
 boolean containsKey(Object key)
           
 boolean containsValue(Object o)
           
 Set entrySet()
           
 Object get(Object key)
          Get the value associated with the key
 Object getId()
           
 Map getIndexMap()
           
 Object getKey(StoreEntry keyLocation)
          Get the Key object from it's location
 Object getValue(StoreEntry Valuelocation)
          Get the value from it's location
 boolean isEmpty()
           
 boolean isLoaded()
           
 Set keySet()
           
 void load()
          The container is created or retrieved in an unloaded state.
 StoreEntry place(Object key, Object Value)
          Add an entry to the Store Map
 Object put(Object key, Object value)
          Add an entry
 void putAll(Map map)
          Add add entries in the supplied Map
 Object remove(Object key)
          remove an entry associated with the key
 void remove(StoreEntry entry)
          Remove an Entry from ther Map
 void setIndexMap(Map map)
          Set the internal index map
 void setKeyMarshaller(Marshaller keyMarshaller)
          For homogenous containers can set a custom marshaller for loading keys The default uses Object serialization
 void setValueMarshaller(Marshaller valueMarshaller)
          For homogenous containers can set a custom marshaller for loading values The default uses Object serialization
 int size()
           
 void unload()
          unload indexes from the container
 Collection values()
           
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Method Detail

load

void load()
The container is created or retrieved in an unloaded state. load populates the container will all the indexes used etc and should be called before any operations on the container


unload

void unload()
unload indexes from the container


isLoaded

boolean isLoaded()
Returns:
true if the indexes are loaded

setKeyMarshaller

void setKeyMarshaller(Marshaller keyMarshaller)
For homogenous containers can set a custom marshaller for loading keys The default uses Object serialization

Parameters:
keyMarshaller -

setValueMarshaller

void setValueMarshaller(Marshaller valueMarshaller)
For homogenous containers can set a custom marshaller for loading values The default uses Object serialization

Parameters:
valueMarshaller -

getId

Object getId()
Returns:
the id the MapContainer was create with

size

int size()
Specified by:
size in interface Map
Returns:
the number of values in the container

isEmpty

boolean isEmpty()
Specified by:
isEmpty in interface Map
Returns:
true if there are no values stored in the container

containsKey

boolean containsKey(Object key)
Specified by:
containsKey in interface Map
Parameters:
key -
Returns:
true if the container contains the key

get

Object get(Object key)
Get the value associated with the key

Specified by:
get in interface Map
Parameters:
key -
Returns:
the value associated with the key from the store

containsValue

boolean containsValue(Object o)
Specified by:
containsValue in interface Map
Parameters:
o -
Returns:
true if the MapContainer contains the value o

putAll

void putAll(Map map)
Add add entries in the supplied Map

Specified by:
putAll in interface Map
Parameters:
map -

keySet

Set keySet()
Specified by:
keySet in interface Map
Returns:
a Set of all the keys

values

Collection values()
Specified by:
values in interface Map
Returns:
a collection of all the values - the values will be lazily pulled out of the store if iterated etc.

entrySet

Set entrySet()
Specified by:
entrySet in interface Map
Returns:
a Set of all the Map.Entry instances - the values will be lazily pulled out of the store if iterated etc.

put

Object put(Object key,
           Object value)
Add an entry

Specified by:
put in interface Map
Parameters:
key -
value -
Returns:
the old value for the key

remove

Object remove(Object key)
remove an entry associated with the key

Specified by:
remove in interface Map
Parameters:
key -
Returns:
the old value assocaited with the key or null

clear

void clear()
empty the container

Specified by:
clear in interface Map

place

StoreEntry place(Object key,
                 Object Value)
Add an entry to the Store Map

Parameters:
key -
Value -
Returns:
the StoreEntry associated with the entry

remove

void remove(StoreEntry entry)
Remove an Entry from ther Map

Parameters:
entry -

getKey

Object getKey(StoreEntry keyLocation)
Get the Key object from it's location

Parameters:
keyLocation -
Returns:
the key for the entry

getValue

Object getValue(StoreEntry Valuelocation)
Get the value from it's location

Parameters:
Valuelocation -
Returns:
the Object

setIndexMap

void setIndexMap(Map map)
Set the internal index map

Parameters:
map -

getIndexMap

Map getIndexMap()
Returns:
the index map


Copyright © 2011 Apache Software Foundation. All Rights Reserved.