|
Oracle® Coherence Java API Reference Release 3.7.1.0 E22843-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.tangosol.util.Base
com.tangosol.util.AbstractKeyBasedMap
com.tangosol.util.AbstractKeySetBasedMap
public abstract class AbstractKeySetBasedMap
AbstractKeySetBasedMap is an extension to the AbstractKeyBasedMap that has a full awareness of the set of keys upon which the Map is based. As a result, it is possible to optimize the implementation of a number of methods that benefit from a knowledge of the entire set of keys.
Read-only implementations must implement getInternalKeySet()
and AbstractKeyBasedMap.get(Object)
. Read/write implementations must additionally implement AbstractKeyBasedMap.put(Object, Object)
and AbstractKeyBasedMap.remove(Object)
. If the implementation has any cost of returning an "old value", such as is done by the Map.put(K, V)
and Map.remove(Object)
, then the AbstractKeyBasedMap.putAll(java.util.Map)
and AbstractKeyBasedMap.removeBlind(Object)
methods should also be implemented. The only other obvious method for optimization is AbstractKeyBasedMap.clear()
, if the implementation is able to do it in bulk.
Nested Class Summary | |
---|---|
class |
AbstractKeySetBasedMap.EntrySet A set of entries backed by this map. |
class |
AbstractKeySetBasedMap.KeyIterator An iterator over the keys from the internal key Set that implements element removal via the Map's removeBlind method. |
protected class |
AbstractKeySetBasedMap.KeySet A set of keys backed by this map. |
protected class |
AbstractKeySetBasedMap.ValuesCollection A Collection of values backed by this map. |
Nested classes/interfaces inherited from interface java.util.Map |
---|
java.util.Map.Entry |
Constructor Summary | |
---|---|
AbstractKeySetBasedMap() |
Method Summary | |
---|---|
boolean |
containsKey(java.lang.Object oKey) Returns true if this map contains a mapping for the specified key. |
protected abstract java.util.Set |
getInternalKeySet() Obtain a set of keys that are represented by this Map. |
protected java.util.Set |
instantiateEntrySet() Factory pattern: Create a Set that represents the entries in the Map. |
protected java.util.Iterator |
instantiateKeyIterator() Factory pattern: Create a mutable Iterator over the keys in the Map |
protected java.util.Set |
instantiateKeySet() Factory pattern: Create a Set that represents the keys in the Map |
protected java.util.Collection |
instantiateValues() Factory pattern: Instantiate the values Collection. |
boolean |
isEmpty() Returns true if this map contains no key-value mappings. |
protected boolean |
isInternalKeySetIteratorMutable() Determine if this Iterator should remove an iterated item by calling remove on the internal key Set Iterator, or by calling removeBlind on the map itself. |
protected java.util.Iterator |
iterateKeys() Create an iterator over the keys in this Map. |
int |
size() Returns the number of key-value mappings in this map. |
Methods inherited from class com.tangosol.util.AbstractKeyBasedMap |
---|
clear, clone, containsValue, entrySet, equals, get, getAll, hashCode, keySet, put, putAll, remove, removeBlind, toString, values |
Constructor Detail |
---|
public AbstractKeySetBasedMap()
Method Detail |
---|
public boolean containsKey(java.lang.Object oKey)
containsKey
in interface java.util.Map
containsKey
in class AbstractKeyBasedMap
oKey
- key whose presence in this map is to be tested.public boolean isEmpty()
isEmpty
in interface java.util.Map
isEmpty
in class AbstractKeyBasedMap
public int size()
size
in interface java.util.Map
size
in class AbstractKeyBasedMap
protected java.util.Iterator iterateKeys()
iterateKeys
in class AbstractKeyBasedMap
protected abstract java.util.Set getInternalKeySet()
The AbstractKeySetBasedMap only utilizes the internal key set as a read-only resource.
protected boolean isInternalKeySetIteratorMutable()
AbstractKeyBasedMap.removeBlind(Object)
methodprotected java.util.Set instantiateKeySet()
instantiateKeySet
in class AbstractKeyBasedMap
protected java.util.Set instantiateEntrySet()
instantiateEntrySet
in class AbstractKeyBasedMap
protected java.util.Collection instantiateValues()
instantiateValues
in class AbstractKeyBasedMap
protected java.util.Iterator instantiateKeyIterator()
|
Oracle® Coherence Java API Reference Release 3.7.1.0 E22843-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |