Class ClearableLongObjectHashMap<VType>

java.lang.Object
com.carrotsearch.hppc.LongObjectHashMap<VType>
org.antlr.v4.runtime.atn.ClearableLongObjectHashMap<VType>
Type Parameters:
VType - value type stored in the map
All Implemented Interfaces:
com.carrotsearch.hppc.Accountable, com.carrotsearch.hppc.LongObjectAssociativeContainer<VType>, com.carrotsearch.hppc.LongObjectMap<VType>, com.carrotsearch.hppc.Preallocable, Cloneable, Iterable<com.carrotsearch.hppc.cursors.LongObjectCursor<VType>>

final class ClearableLongObjectHashMap<VType> extends com.carrotsearch.hppc.LongObjectHashMap<VType>
Package-private long → V open-addressed map with O(1) empty clear(), used as the ATN config merge index.

API boundary: This type is package-private and never appears in any public or protected signature. External callers only touch ATNConfigSet's JDK Set surface. Extending HPPC here is intentional: the merge index is on the prediction hot path (indexOf/indexGet/indexInsert), so monomorphic inheritance avoids an extra wrapper frame while HPPC remains a non-exported implementation detail.

HPPC's default LongObjectHashMap.clear() always fills the entire tables (O(capacity)), even when empty. Retained config sets clear on every obtain/release; empty clear is a pure no-op here. Non-empty clear keeps bulk fill (right at high occupancy).

  • Nested Class Summary

    Nested classes/interfaces inherited from class com.carrotsearch.hppc.LongObjectHashMap

    com.carrotsearch.hppc.LongObjectHashMap.KeysContainer
  • Field Summary

    Fields inherited from class com.carrotsearch.hppc.LongObjectHashMap

    assigned, hasEmptyKey, keyMixer, keys, loadFactor, mask, orderMixer, resizeAt, values
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    ClearableLongObjectHashMap(int expectedElements)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clears all entries.
    (package private) int
    Open-addressed table length (including the dedicated empty-key slot).

    Methods inherited from class com.carrotsearch.hppc.LongObjectHashMap

    allocateBuffers, allocateThenInsertThenRehash, clone, containsKey, ensureCapacity, equalElements, equals, forEach, from, get, getOrDefault, hashCode, hashKey, indexExists, indexGet, indexInsert, indexOf, indexReplace, isEmpty, iterator, keys, put, putAll, putAll, putIfAbsent, ramBytesAllocated, ramBytesUsed, rehash, release, remove, removeAll, removeAll, removeAll, shiftConflictingKeys, size, toString, values, verifyLoadFactor, visualizeKeyDistribution

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Constructor Details

    • ClearableLongObjectHashMap

      ClearableLongObjectHashMap()
    • ClearableLongObjectHashMap

      ClearableLongObjectHashMap(int expectedElements)
      Parameters:
      expectedElements - expected entry count used as a capacity hint
  • Method Details

    • clear

      public void clear()
      Clears all entries. Already-empty maps return without touching backing arrays.
      Specified by:
      clear in interface com.carrotsearch.hppc.LongObjectMap<VType>
      Overrides:
      clear in class com.carrotsearch.hppc.LongObjectHashMap<VType>
    • tableLength

      int tableLength()
      Open-addressed table length (including the dedicated empty-key slot). Used by ATNConfigSet.clear() to choose sparse vs bulk clear.