Package org.antlr.v4.runtime.misc
Class FlexibleHashMap<K,V>
- java.lang.Object
-
- org.antlr.v4.runtime.misc.FlexibleHashMap<K,V>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FlexibleHashMap.Entry<K,V>
-
Field Summary
Fields Modifier and Type Field Description protected 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
protected int
initialCapacity
static double
LOAD_FACTOR
protected int
n
How many elements in setprotected int
threshold
when to expand
-
Constructor Summary
Constructors Constructor Description FlexibleHashMap()
FlexibleHashMap(AbstractEqualityComparator<? super K> comparator)
FlexibleHashMap(AbstractEqualityComparator<? super K> comparator, int initialCapacity, int initialBucketCapacity)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
boolean
containsKey(Object key)
boolean
containsValue(Object value)
Set<Map.Entry<K,V>>
entrySet()
boolean
equals(Object o)
protected void
expand()
V
get(Object key)
protected int
getBucket(K key)
int
hashCode()
boolean
isEmpty()
Set<K>
keySet()
static void
main(String[] args)
V
put(K key, V value)
void
putAll(Map<? extends K,? extends V> m)
V
remove(Object key)
int
size()
String
toString()
String
toTableString()
Collection<V>
values()
-
Methods inherited from class java.lang.Object
clone, 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
-
-
-
-
Field Detail
-
INITAL_CAPACITY
public static final int INITAL_CAPACITY
- See Also:
- Constant Field Values
-
INITAL_BUCKET_CAPACITY
public static final int INITAL_BUCKET_CAPACITY
- See Also:
- Constant Field Values
-
LOAD_FACTOR
public static final double LOAD_FACTOR
- See Also:
- Constant Field Values
-
comparator
protected final AbstractEqualityComparator<? super K> comparator
-
buckets
protected LinkedList<FlexibleHashMap.Entry<K,V>>[] buckets
-
n
protected int n
How many elements in set
-
currentPrime
protected int currentPrime
-
threshold
protected int threshold
when to expand
-
initialCapacity
protected final int initialCapacity
-
initialBucketCapacity
protected final int initialBucketCapacity
-
-
Constructor Detail
-
FlexibleHashMap
public FlexibleHashMap()
-
FlexibleHashMap
public FlexibleHashMap(AbstractEqualityComparator<? super K> comparator)
-
FlexibleHashMap
public FlexibleHashMap(AbstractEqualityComparator<? super K> comparator, int initialCapacity, int initialBucketCapacity)
-
-
Method Detail
-
getBucket
protected int getBucket(K key)
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKey
in interfaceMap<K,V>
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValue
in interfaceMap<K,V>
-
hashCode
public int hashCode()
-
equals
public boolean equals(Object o)
-
expand
protected void expand()
-
toTableString
public String toTableString()
-
main
public static void main(String[] args)
-
-