org.apache.activemq.kaha
Interface MapContainer

All Superinterfaces:
java.util.Map
All Known Implementing Classes:
MapContainerImpl

public interface MapContainer
extends java.util.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
java.util.Map.Entry<K,V>
 
Method Summary
 void clear()
          empty the container
 boolean containsKey(java.lang.Object key)
           
 boolean containsValue(java.lang.Object o)
           
 java.util.Set entrySet()
           
 java.lang.Object get(java.lang.Object key)
          Get the value associated with the key
 java.lang.Object getId()
           
 java.util.Map getIndexMap()
           
 java.lang.Object getKey(StoreEntry keyLocation)
          Get the Key object from it's location
 java.lang.Object getValue(StoreEntry Valuelocation)
          Get the value from it's location
 boolean isEmpty()
           
 boolean isLoaded()
           
 java.util.Set keySet()
           
 void load()
          The container is created or retrieved in an unloaded state.
 StoreEntry place(java.lang.Object key, java.lang.Object Value)
          Add an entry to the Store Map
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          Add an entry
 void putAll(java.util.Map map)
          Add add entries in the supplied Map
 java.lang.Object remove(java.lang.Object key)
          remove an entry associated with the key
 void remove(StoreEntry entry)
          Remove an Entry from ther Map
 void setIndexMap(java.util.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
 java.util.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

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

size

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

isEmpty

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

containsKey

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

get

java.lang.Object get(java.lang.Object key)
Get the value associated with the key

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

containsValue

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

putAll

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

Specified by:
putAll in interface java.util.Map
Parameters:
map -

keySet

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

values

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

entrySet

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

put

java.lang.Object put(java.lang.Object key,
                     java.lang.Object value)
Add an entry

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

remove

java.lang.Object remove(java.lang.Object key)
remove an entry associated with the key

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

clear

void clear()
empty the container

Specified by:
clear in interface java.util.Map

place

StoreEntry place(java.lang.Object key,
                 java.lang.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

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

Parameters:
keyLocation -
Returns:
the key for the entry

getValue

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

Parameters:
Valuelocation -
Returns:
the Object

setIndexMap

void setIndexMap(java.util.Map map)
Set the internal index map

Parameters:
map -

getIndexMap

java.util.Map getIndexMap()
Returns:
the index map


Copyright © 2009 Apache Software Foundation. All Rights Reserved.