Class Int2ObjectBiMap<K>

java.lang.Object
net.minecraft.util.collection.Int2ObjectBiMap<K>
All Implemented Interfaces:
Iterable<K>, IndexedIterable<K>

public class Int2ObjectBiMap<K>
extends Object
implements IndexedIterable<K>
  • Field Details

    • EMPTY

      private static final Object EMPTY
    • values

      private K[] values
    • ids

      private int[] ids
    • idToValues

      private K[] idToValues
    • nextId

      private int nextId
    • size

      private int size
  • Constructor Details

    • Int2ObjectBiMap

      public Int2ObjectBiMap​(int size)
  • Method Details

    • getRawId

      public int getRawId​(@Nullable K entry)
      Specified by:
      getRawId in interface IndexedIterable<K>
    • get

      @Nullable public K get​(int index)
      Specified by:
      get in interface IndexedIterable<K>
    • getIdFromIndex

      private int getIdFromIndex​(int index)
    • add

      public int add​(K value)
    • nextId

      private int nextId()
    • resize

      private void resize​(int newSize)
    • put

      public void put​(K value, int id)
    • getIdealIndex

      private int getIdealIndex​(@Nullable K value)
    • findIndex

      private int findIndex​(@Nullable K value, int id)
    • findFree

      private int findFree​(int size)
    • iterator

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

      public void clear()
    • size

      public int size()