Package org.antlr.v4.runtime.misc
Class FlexibleHashMap<K,V>
java.lang.Object
org.antlr.v4.runtime.misc.FlexibleHashMap<K,V>
- All Implemented Interfaces:
Map<K,
V>
A limited map (many unsupported operations) that lets me use
varying hashCode/equals.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected LinkedList<FlexibleHashMap.Entry<K,
V>>[] protected final AbstractEqualityComparator
<? super K> protected int
static final int
static final int
protected int
static final double
protected int
How many elements in setprotected int
-
Constructor Summary
ConstructorsConstructorDescriptionFlexibleHashMap
(AbstractEqualityComparator<? super K> comparator) FlexibleHashMap
(AbstractEqualityComparator<? super K> comparator, int initialCapacity, int initialBucketCapacity) -
Method Summary
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 Details
-
INITAL_CAPACITY
public static final int INITAL_CAPACITY- See Also:
-
INITAL_BUCKET_CAPACITY
public static final int INITAL_BUCKET_CAPACITY- See Also:
-
LOAD_FACTOR
public static final double LOAD_FACTOR- See Also:
-
comparator
-
buckets
-
n
protected int nHow many elements in set -
threshold
protected int threshold -
currentPrime
protected int currentPrime -
initialBucketCapacity
protected int initialBucketCapacity
-
-
Constructor Details
-
FlexibleHashMap
public FlexibleHashMap() -
FlexibleHashMap
-
FlexibleHashMap
public FlexibleHashMap(AbstractEqualityComparator<? super K> comparator, int initialCapacity, int initialBucketCapacity)
-
-
Method Details
-
getBucket
-
get
-
put
-
remove
-
putAll
-
keySet
-
values
-
entrySet
-
containsKey
- Specified by:
containsKey
in interfaceMap<K,
V>
-
containsValue
- Specified by:
containsValue
in interfaceMap<K,
V>
-
hashCode
public int hashCode() -
equals
-
expand
protected void expand() -
size
public int size() -
isEmpty
public boolean isEmpty() -
clear
public void clear() -
toString
-
toTableString
-
main
-