|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap
com.tangosol.util.ChainedMap
public class ChainedMap
Chains two maps into one virtual map.
The contents of the first map take precedence over the contents in the second map. If there are already entries in the two maps when this map is constructed, then the keys in the second map that are also in the first map will be removed from the second map.
Nested Class Summary | |
---|---|
class |
ChainedMap.EntrySet
A set of entries backed by this map. |
Nested classes/interfaces inherited from interface java.util.Map |
---|
Map.Entry |
Field Summary | |
---|---|
protected Map |
m_mapFirst
The first map. |
protected Map |
m_mapSecond
The second map. |
protected ChainedMap.EntrySet |
m_setEntries
The entry set. |
Constructor Summary | |
---|---|
ChainedMap(Map mapFirst,
Map mapSecond)
Construct a ChainedMap out of two maps. |
Method Summary | |
---|---|
boolean |
containsKey(Object oKey)
Returns true if this map contains a mapping for the specified key. |
Set |
entrySet()
Returns a set view of the mappings contained in this map. |
Object |
get(Object oKey)
Returns the value to which this map maps the specified key. |
Map |
getFirstMap()
Get the first (front) map. |
Map |
getSecondMap()
Get the second (back) map. |
protected ChainedMap.EntrySet |
instantiateEntrySet()
(Factory pattern) Instantiate an Entry Set or subclass thereof. |
Object |
put(Object oKey,
Object oValue)
Associates the specified value with the specified key in this map. |
Object |
remove(Object oKey)
Removes the mapping for this key from this map if present. |
int |
size()
Returns the number of key-value mappings in this map. |
Methods inherited from class java.util.AbstractMap |
---|
clear, clone, containsValue, equals, hashCode, isEmpty, keySet, putAll, toString, values |
Field Detail |
---|
protected Map m_mapFirst
protected Map m_mapSecond
protected transient ChainedMap.EntrySet m_setEntries
Constructor Detail |
---|
public ChainedMap(Map mapFirst, Map mapSecond)
mapFirst
- the map whose mappings are to be placed in this map.Method Detail |
---|
public Map getFirstMap()
Note: direct modifications of the returned map may cause an unpredictable behavior of the ChainedMap.
public Map getSecondMap()
Note: direct modifications of the returned map may cause an unpredictable behavior of the ChainedMap.
public int size()
size
in interface Map
size
in class AbstractMap
public boolean containsKey(Object oKey)
containsKey
in interface Map
containsKey
in class AbstractMap
oKey
- key whose presence in this map is to be tested
public Object get(Object oKey)
get
in interface Map
get
in class AbstractMap
oKey
- key whose associated value is to be returned
public Object put(Object oKey, Object oValue)
put
in interface Map
put
in class AbstractMap
oKey
- key with which the specified value is to be associatedoValue
- value to be associated with the specified key
public Object remove(Object oKey)
remove
in interface Map
remove
in class AbstractMap
oKey
- key whose mapping is to be removed from the map
public Set entrySet()
entrySet
in interface Map
entrySet
in class AbstractMap
protected ChainedMap.EntrySet instantiateEntrySet()
|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |