Class CrudeIncrementalIntIdentityHashBiMap<K>

java.lang.Object
net.minecraft.util.CrudeIncrementalIntIdentityHashBiMap<K>
All Implemented Interfaces:
Iterable<K>, IdMap<K>

public class CrudeIncrementalIntIdentityHashBiMap<K> extends Object implements IdMap<K>
  • Field Details

    • NOT_FOUND

      private static final int NOT_FOUND
      See Also:
    • EMPTY_SLOT

      private static final Object EMPTY_SLOT
    • LOADFACTOR

      private static final float LOADFACTOR
      See Also:
    • keys

      private K[] keys
    • values

      private int[] values
    • byId

      private K[] byId
    • nextId

      private int nextId
    • size

      private int size
  • Constructor Details

    • CrudeIncrementalIntIdentityHashBiMap

      private CrudeIncrementalIntIdentityHashBiMap(int size)
    • CrudeIncrementalIntIdentityHashBiMap

      private CrudeIncrementalIntIdentityHashBiMap(K[] keys, int[] values, K[] byId, int nextId, int size)
  • Method Details

    • create

      public static <A> CrudeIncrementalIntIdentityHashBiMap<A> create(int size)
    • getId

      public int getId(@Nullable K value)
      Gets the integer ID we use to identify the given object.
      Specified by:
      getId in interface IdMap<K>
      Returns:
      the integer ID used to identify the given object
    • byId

      @Nullable public K byId(int value)
      Specified by:
      byId in interface IdMap<K>
    • getValue

      private int getValue(int key)
    • contains

      public boolean contains(K value)
    • contains

      public boolean contains(int value)
    • add

      public int add(K object)
      Adds the given object while expanding this map
    • nextId

      private int nextId()
    • grow

      private void grow(int capacity)
      Rehashes the map to the new capacity
    • addMapping

      public void addMapping(K object, int intKey)
      Puts the provided object value with the integer key.
    • hash

      private int hash(@Nullable K object)
    • indexOf

      private int indexOf(@Nullable K object, int startIndex)
    • findEmpty

      private int findEmpty(int startIndex)
    • iterator

      public Iterator<K> iterator()
      Specified by:
      iterator in interface Iterable<K>
    • clear

      public void clear()
    • size

      public int size()
      Specified by:
      size in interface IdMap<K>
    • copy