|
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
java.util.AbstractMap
com.tangosol.util.LiteMap
public class LiteMap
An implementation of java.util.Map that is optimal (in terms of both size and speed) for very small sets of data but still works excellently with large sets of data. This implementation is not thread-safe.
The LiteMap implementation switches at runtime between several different sub-implementations for storing the Map of objects, described here:
The LiteMap implementation supports the null key value.
Nested Class Summary | |
---|---|
static class |
LiteMap.EntryIterator A simple Iterator for LiteMap Entry objects. |
protected class |
LiteMap.EntrySet A Set of entries backed by this Map. |
Nested classes/interfaces inherited from interface java.util.Map |
---|
java.util.Map.Entry |
Constructor Summary | |
---|---|
LiteMap() Construct a LiteMap. |
|
LiteMap(java.util.Map map) Construct a LiteMap with the same mappings as the given map. |
Method Summary | |
---|---|
protected void |
checkShrinkFromOther() After a mutation operation has reduced the size of an underlying Map, check if the delegation model should be replaced with a more size- efficient storage approach, and switch accordingly. |
void |
clear() Clear all key/value mappings. |
java.lang.Object |
clone() Create a clone of the ImmutableArrayList. |
boolean |
containsKey(java.lang.Object oKey) Returns true if this map contains a mapping for the specified key. |
java.util.Set |
entrySet() Returns a set view of the mappings contained in this map. |
java.lang.Object |
get(java.lang.Object oKey) Returns the value to which this map maps the specified key. |
protected java.util.Map.Entry |
instantiateEntry(java.lang.Object key, java.lang.Object value) (Factory pattern) Instantiate a Map Entry. |
protected java.util.Set |
instantiateEntrySet() (Factory pattern) Instantiate an Entry Set. |
protected java.util.Map |
instantiateMap() (Factory pattern) Instantiate a Map object to store entries in once the "lite" threshold has been exceeded. |
boolean |
isEmpty() Returns true if this map contains no key-value mappings. |
java.lang.Object |
put(java.lang.Object oKey, java.lang.Object oValue) Associates the specified value with the specified key in this map. |
void |
readExternal(java.io.DataInput in) Restore the contents of this object by loading the object's state from the passed DataInput object. |
void |
readExternal(java.io.ObjectInput in) Initialize this object from the data in the passed ObjectInput stream. |
java.lang.Object |
remove(java.lang.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. |
void |
writeExternal(java.io.DataOutput out) Save the contents of this object by storing the object's state into the passed DataOutput object. |
void |
writeExternal(java.io.ObjectOutput out) Write this object's data to the passed ObjectOutput stream. |
Methods inherited from class java.util.AbstractMap |
---|
containsValue, equals, hashCode, keySet, putAll, toString, values |
Constructor Detail |
---|
public LiteMap()
public LiteMap(java.util.Map map)
map
- the map whose mappings are to be placed in this map.Method Detail |
---|
public boolean isEmpty()
isEmpty
in interface java.util.Map
isEmpty
in class java.util.AbstractMap
public int size()
size
in interface java.util.Map
size
in class java.util.AbstractMap
public boolean containsKey(java.lang.Object oKey)
containsKey
in interface java.util.Map
containsKey
in class java.util.AbstractMap
oKey
- key whose presence in this map is to be tested.public java.lang.Object get(java.lang.Object oKey)
get
in interface java.util.Map
get
in class java.util.AbstractMap
oKey
- the key objectAbstractMap.containsKey(Object)
public java.lang.Object put(java.lang.Object oKey, java.lang.Object oValue)
put
in interface java.util.Map
put
in class java.util.AbstractMap
oKey
- key with which the specified value is to be associatedoValue
- value to be associated with the specified keypublic java.lang.Object remove(java.lang.Object oKey)
remove
in interface java.util.Map
remove
in class java.util.AbstractMap
oKey
- key whose mapping is to be removed from the mappublic void clear()
clear
in interface java.util.Map
clear
in class java.util.AbstractMap
public java.lang.Object clone()
clone
in class java.util.AbstractMap
public java.util.Set entrySet()
Map Entry
. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress (except by the iterator's own remove operation, or by the setValue operation on a map entry returned by the iterator) the results of the iteration are undefined. The set supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Set.remove, removeAll, retainAll and clear operations. It is not expected to support the add or addAll operations.entrySet
in interface java.util.Map
entrySet
in class java.util.AbstractMap
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
in
- the stream to read data from in order to restore the objectjava.io.IOException
- if an I/O exception occursjava.lang.ClassNotFoundException
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
out
- the stream to write the object tojava.io.IOException
- if an I/O exception occurspublic void readExternal(java.io.DataInput in) throws java.io.IOException
readExternal
in interface ExternalizableLite
in
- the DataInput stream to read data from in order to restore the state of this objectjava.io.IOException
- if an I/O exception occursjava.io.NotActiveException
- if the object is not in its initial state, and therefore cannot be deserialized intopublic void writeExternal(java.io.DataOutput out) throws java.io.IOException
writeExternal
in interface ExternalizableLite
out
- the DataOutput stream to write the state of this object tojava.io.IOException
- if an I/O exception occursprotected java.util.Map.Entry instantiateEntry(java.lang.Object key, java.lang.Object value)
protected java.util.Set instantiateEntrySet()
protected java.util.Map instantiateMap()
protected void checkShrinkFromOther()
|
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 |