org.apache.cocoon.forms.util
Class CombiningMap

java.lang.Object
  extended by java.util.AbstractMap
      extended by org.apache.cocoon.forms.util.CombiningMap
All Implemented Interfaces:
Map

public class CombiningMap
extends AbstractMap

A read-only implementation of Map that combines several other maps.

Version:
$Id: CombiningMap.html 1304258 2012-03-23 10:09:27Z ilgrosso $

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
protected  List maps
           
 
Constructor Summary
CombiningMap()
           
 
Method Summary
 CombiningMap add(Map map)
          Adds a Map in the combined map, with the lowest lookup priority.
 boolean containsKey(Object key)
           
 Set entrySet()
           
 Object get(Object key)
           
 
Methods inherited from class java.util.AbstractMap
clear, clone, containsValue, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

maps

protected List maps
Constructor Detail

CombiningMap

public CombiningMap()
Method Detail

add

public CombiningMap add(Map map)
Adds a Map in the combined map, with the lowest lookup priority.

New maps cannot be added if this object was already iterated.

Parameters:
map - the new map
Returns:
this object, as a convenience to write combiner.add(map1).add(map2).add(map3)

get

public Object get(Object key)
Specified by:
get in interface Map
Overrides:
get in class AbstractMap

containsKey

public boolean containsKey(Object key)
Specified by:
containsKey in interface Map
Overrides:
containsKey in class AbstractMap

entrySet

public Set entrySet()
Specified by:
entrySet in interface Map
Specified by:
entrySet in class AbstractMap


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.