public class CompressedHashMap<K,V>
extends java.lang.Object
implements java.util.Map<K,V>
Modifier and Type | Field and Description |
---|---|
protected java.util.HashMap<K,java.lang.Object> |
delegateMap
The delagated-to hash map used to store the compressed values.
|
protected static CompressedSerializer |
serializer
The object compressor for the values in the hash map.
|
Constructor and Description |
---|
CompressedHashMap()
Create hash map.
|
CompressedHashMap(int initialCapacity)
Create hash map with specified initial capacity.
|
CompressedHashMap(int initialCapacity,
float loadFactor)
Create hash map with specified initial capacity and load factor.
|
CompressedHashMap(java.util.Map<? extends K,? extends V> map)
Create hash map from another map.
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
java.lang.Object |
clone() |
protected java.lang.Object |
compress(java.lang.Object o) |
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(java.lang.Object value) |
protected V |
decompress(java.lang.Object o) |
java.util.Set<java.util.Map.Entry<K,V>> |
entrySet() |
V |
get(java.lang.Object key) |
boolean |
isEmpty() |
java.util.Set<K> |
keySet() |
V |
put(K key,
V value) |
void |
putAll(java.util.Map<? extends K,? extends V> m) |
V |
remove(java.lang.Object key) |
int |
size() |
java.util.Collection<V> |
values() |
protected static CompressedSerializer serializer
protected java.util.HashMap<K,java.lang.Object> delegateMap
public CompressedHashMap()
public CompressedHashMap(int initialCapacity)
initialCapacity
- The initial capacity.public CompressedHashMap(int initialCapacity, float loadFactor)
initialCapacity
- The initial capacity.loadFactor
- The load factor.protected V decompress(java.lang.Object o)
protected java.lang.Object compress(java.lang.Object o)
public void clear() throws java.lang.UnsupportedOperationException
public java.lang.Object clone()
clone
in class java.lang.Object
public boolean containsKey(java.lang.Object key) throws java.lang.ClassCastException, java.lang.NullPointerException
public boolean containsValue(java.lang.Object value) throws java.lang.ClassCastException, java.lang.NullPointerException
public void putAll(java.util.Map<? extends K,? extends V> m) throws java.lang.UnsupportedOperationException, java.lang.ClassCastException, java.lang.NullPointerException, java.lang.IllegalArgumentException
public V remove(java.lang.Object key) throws java.lang.UnsupportedOperationException, java.lang.ClassCastException, java.lang.NullPointerException
public V get(java.lang.Object key) throws java.lang.ClassCastException, java.lang.NullPointerException