|
Oracle® Coherence Java API Reference Release 3.6.0.0 E15725-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. <p/> 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.EntrySetA set of entries backed by this map. |
class |
AbstractKeySetBasedMap.KeyIteratorAn iterator over the keys from the internal key Set that implements element removal via the Map's removeBlind method. |
protected class |
AbstractKeySetBasedMap.KeySetA set of keys backed by this map. |
protected class |
AbstractKeySetBasedMap.ValuesCollectionA Collection of values backed by this map. |
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
Map.Entry |
| Constructor Summary | |
|---|---|
AbstractKeySetBasedMap() |
|
| Method Summary | |
|---|---|
boolean |
containsKey(Object oKey)Returns true if this map contains a mapping for the specified key. |
protected abstract Set |
getInternalKeySet()Obtain a set of keys that are represented by this Map. |
protected Set |
instantiateEntrySet()Factory pattern: Create a Set that represents the entries in the Map. |
protected Iterator |
instantiateKeyIterator()Factory pattern: Create a mutable Iterator over the keys in the Map |
protected Set |
instantiateKeySet()Factory pattern: Create a Set that represents the keys in the Map |
protected 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 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(Object oKey)
containsKey in interface MapcontainsKey in class AbstractKeyBasedMapoKey - key whose presence in this map is to be tested.public boolean isEmpty()
isEmpty in interface MapisEmpty in class AbstractKeyBasedMappublic int size()
size in interface Mapsize in class AbstractKeyBasedMapprotected Iterator iterateKeys()
iterateKeys in class AbstractKeyBasedMapprotected abstract Set getInternalKeySet()
protected boolean isInternalKeySetIteratorMutable()
AbstractKeyBasedMap.removeBlind(Object) methodprotected Set instantiateKeySet()
instantiateKeySet in class AbstractKeyBasedMapprotected Set instantiateEntrySet()
instantiateEntrySet in class AbstractKeyBasedMapprotected Collection instantiateValues()
instantiateValues in class AbstractKeyBasedMapprotected Iterator instantiateKeyIterator()
|
Oracle® Coherence Java API Reference Release 3.6.0.0 E15725-01 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||