K - the type of key stored in this map.V - the type of value stored in this map.@ReplacedBy(value="java.util.Map") public class StreamableHashMap<K,V> extends HashMap<K,V> implements Streamable
HashMap extension that can be streamed. The keys and values in the map must also be
of streamable types.Streamable,
Serialized FormAbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>Streamable.Closure| Constructor and Description |
|---|
StreamableHashMap()
Constructs an empty hash map with the default number of hash buckets.
|
StreamableHashMap(int buckets,
float loadFactor)
Constructs an empty hash map with the specified number of hash buckets.
|
StreamableHashMap(Map<? extends K,? extends V> map)
Constructs a hash map with the default number of hash buckets, populated with the same
values as the provided Map.
|
| Modifier and Type | Method and Description |
|---|---|
static <K,V> StreamableHashMap<K,V> |
newMap()
Creates an empty StreamableHashMap.
|
static <K,V> StreamableHashMap<K,V> |
newMap(Map<? extends K,? extends V> map)
Creates StreamableHashMap populated with the same values as the provided Map.
|
void |
readObject(ObjectInputStream in)
Reads our custom streamable fields.
|
void |
writeObject(ObjectOutputStream out)
Writes our custom streamable fields.
|
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesequals, hashCode, toStringpublic StreamableHashMap(int buckets,
float loadFactor)
public StreamableHashMap()
public static <K,V> StreamableHashMap<K,V> newMap()
public static <K,V> StreamableHashMap<K,V> newMap(Map<? extends K,? extends V> map)
public void writeObject(ObjectOutputStream out) throws IOException
IOExceptionpublic void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
IOExceptionClassNotFoundExceptionCopyright © 2015. All rights reserved.