public class FlexibleHashMap<K,V>
extends java.lang.Object
implements java.util.Map<K,V>
Modifier and Type | Class and Description |
---|---|
static class |
FlexibleHashMap.Entry<K,V> |
Modifier and Type | Field and Description |
---|---|
protected java.util.LinkedList<FlexibleHashMap.Entry<K,V>>[] |
buckets |
protected AbstractEqualityComparator<? super K> |
comparator |
protected int |
currentPrime |
static int |
INITAL_BUCKET_CAPACITY |
static int |
INITAL_CAPACITY |
protected int |
initialBucketCapacity |
static double |
LOAD_FACTOR |
protected int |
n
How many elements in set
|
protected int |
threshold |
Constructor and Description |
---|
FlexibleHashMap() |
FlexibleHashMap(AbstractEqualityComparator<? super K> comparator) |
FlexibleHashMap(AbstractEqualityComparator<? super K> comparator,
int initialCapacity,
int initialBucketCapacity) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(java.lang.Object value) |
java.util.Set<java.util.Map.Entry<K,V>> |
entrySet() |
boolean |
equals(java.lang.Object o) |
protected void |
expand() |
V |
get(java.lang.Object key) |
protected int |
getBucket(K key) |
int |
hashCode() |
boolean |
isEmpty() |
java.util.Set<K> |
keySet() |
static void |
main(java.lang.String[] args) |
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.lang.String |
toString() |
java.lang.String |
toTableString() |
java.util.Collection<V> |
values() |
public static final int INITAL_CAPACITY
public static final int INITAL_BUCKET_CAPACITY
public static final double LOAD_FACTOR
protected final AbstractEqualityComparator<? super K> comparator
protected java.util.LinkedList<FlexibleHashMap.Entry<K,V>>[] buckets
protected int n
protected int threshold
protected int currentPrime
protected int initialBucketCapacity
public FlexibleHashMap()
public FlexibleHashMap(AbstractEqualityComparator<? super K> comparator)
public FlexibleHashMap(AbstractEqualityComparator<? super K> comparator, int initialCapacity, int initialBucketCapacity)
protected int getBucket(K key)
public boolean containsKey(java.lang.Object key)
public boolean containsValue(java.lang.Object value)
public int hashCode()
public boolean equals(java.lang.Object o)
protected void expand()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toTableString()
public static void main(java.lang.String[] args)