Package org.antlr.v4.runtime.atn
Class ATNConfigSet.AbstractConfigHashSet
java.lang.Object
org.antlr.v4.runtime.misc.Array2DHashSet<ATNConfig>
org.antlr.v4.runtime.atn.ATNConfigSet.AbstractConfigHashSet
- Direct Known Subclasses:
ATNConfigSet.ConfigHashSet
,OrderedATNConfigSet.LexerConfigHashSet
- Enclosing class:
ATNConfigSet
-
Nested Class Summary
Nested classes/interfaces inherited from class org.antlr.v4.runtime.misc.Array2DHashSet
Array2DHashSet.SetIterator
-
Field Summary
Fields inherited from class org.antlr.v4.runtime.misc.Array2DHashSet
buckets, comparator, currentPrime, INITAL_BUCKET_CAPACITY, INITAL_CAPACITY, initialBucketCapacity, initialCapacity, LOAD_FACTOR, n, threshold
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractConfigHashSet
(AbstractEqualityComparator<? super ATNConfig> comparator) AbstractConfigHashSet
(AbstractEqualityComparator<? super ATNConfig> comparator, int initialCapacity, int initialBucketCapacity) -
Method Summary
Modifier and TypeMethodDescriptionprotected final ATNConfig
Returno
as an instance of the element typeT
.protected final ATNConfig[]
createBucket
(int capacity) Return an array ofT
with lengthcapacity
.protected final ATNConfig[][]
createBuckets
(int capacity) Return an array ofT[]
with lengthcapacity
.Methods inherited from class org.antlr.v4.runtime.misc.Array2DHashSet
add, addAll, clear, contains, containsAll, containsFast, equals, expand, get, getBucket, getOrAdd, getOrAddImpl, hashCode, isEmpty, iterator, remove, removeAll, removeFast, retainAll, size, toArray, toArray, toString, toTableString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.Set
spliterator
-
Constructor Details
-
AbstractConfigHashSet
-
AbstractConfigHashSet
public AbstractConfigHashSet(AbstractEqualityComparator<? super ATNConfig> comparator, int initialCapacity, int initialBucketCapacity)
-
-
Method Details
-
asElementType
Description copied from class:Array2DHashSet
Returno
as an instance of the element typeT
. Ifo
is non-null but known to not be an instance ofT
, this method returnsnull
. The base implementation does not perform any type checks; override this method to provide strong type checks for theArray2DHashSet.contains(java.lang.Object)
andArray2DHashSet.remove(java.lang.Object)
methods to ensure the arguments to theEqualityComparator
for the set always have the expected types.- Overrides:
asElementType
in classArray2DHashSet<ATNConfig>
- Parameters:
o
- the object to try and cast to the element type of the set- Returns:
o
if it could be an instance ofT
, otherwisenull
.
-
createBuckets
Description copied from class:Array2DHashSet
Return an array ofT[]
with lengthcapacity
.- Overrides:
createBuckets
in classArray2DHashSet<ATNConfig>
- Parameters:
capacity
- the length of the array to return- Returns:
- the newly constructed array
-
createBucket
Description copied from class:Array2DHashSet
Return an array ofT
with lengthcapacity
.- Overrides:
createBucket
in classArray2DHashSet<ATNConfig>
- Parameters:
capacity
- the length of the array to return- Returns:
- the newly constructed array
-