Package com.tangosol.util
Class LiteMap<K,V>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- com.oracle.coherence.common.collections.InflatableMap<K,V>
-
- com.tangosol.util.LiteMap<K,V>
-
- All Implemented Interfaces:
ExternalizableLite
,Externalizable
,Serializable
,Cloneable
,Map<K,V>
- Direct Known Subclasses:
JsonMap
public class LiteMap<K,V> extends com.oracle.coherence.common.collections.InflatableMap<K,V> implements ExternalizableLite
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:
- "empty map" - a map that contains no data;
- "single entry" - a reference directly to a single map entry
- "Object[]" - a reference to an array of entries; the item limit for this implementation is determined by the THRESHOLD constant;
- "delegation" - for more than THRESHOLD items, a map is created to delegate the map management to; sub-classes can override the default delegation class (java.util.HashMap) by overriding the factory method instantiateMap.
The LiteMap implementation supports the null key value.
- Author:
- cp 06/29/99
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.oracle.coherence.common.collections.InflatableMap
com.oracle.coherence.common.collections.InflatableMap.EntryIterator<K,V>, com.oracle.coherence.common.collections.InflatableMap.EntrySet
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
readExternal(DataInput in)
Restore the contents of this object by loading the object's state from the passed DataInput object.void
writeExternal(DataOutput out)
Save the contents of this object by storing the object's state into the passed DataOutput object.-
Methods inherited from class com.oracle.coherence.common.collections.InflatableMap
checkShrinkFromOther, clear, clone, containsKey, ensureRuntimeException, entrySet, get, instantiateEntry, instantiateEntrySet, instantiateMap, isEmpty, put, readExternal, remove, size, writeExternal
-
Methods inherited from class java.util.AbstractMap
containsValue, equals, hashCode, keySet, putAll, toString, values
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Method Detail
-
readExternal
public void readExternal(DataInput in) throws IOException
Restore the contents of this object by loading the object's state from the passed DataInput object.- Specified by:
readExternal
in interfaceExternalizableLite
- Parameters:
in
- the DataInput stream to read data from in order to restore the state of this object- Throws:
IOException
- if an I/O exception occursNotActiveException
- if the object is not in its initial state, and therefore cannot be deserialized into
-
writeExternal
public void writeExternal(DataOutput out) throws IOException
Save the contents of this object by storing the object's state into the passed DataOutput object.- Specified by:
writeExternal
in interfaceExternalizableLite
- Parameters:
out
- the DataOutput stream to write the state of this object to- Throws:
IOException
- if an I/O exception occurs
-
-