Class Object2IntBiMap<T>

java.lang.Object
org.geysermc.geyser.util.collection.Object2IntBiMap<T>
Type Parameters:
T - the value
All Implemented Interfaces:
it.unimi.dsi.fastutil.Function<T,​Integer>, it.unimi.dsi.fastutil.objects.Object2IntFunction<T>, it.unimi.dsi.fastutil.objects.Object2IntMap<T>, Function<T,​Integer>, ToIntFunction<T>, Map<T,​Integer>

public class Object2IntBiMap<T> extends Object implements it.unimi.dsi.fastutil.objects.Object2IntMap<T>
A primitive int BiMap implementation built around fastutil to reduce boxing and the memory footprint. Protocol has a Int2ObjectBiMap class, but it does not extend the Map interface making it difficult to utilize it in for loops and the registry system.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface it.unimi.dsi.fastutil.objects.Object2IntMap

    it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<K extends Object>, it.unimi.dsi.fastutil.objects.Object2IntMap.FastEntrySet<K extends Object>
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    Object2IntBiMap​(int expected)
     
    Object2IntBiMap​(int expected, float loadFactor)
     
    Object2IntBiMap​(int expected, float loadFactor, int defaultBackwardsValue)
     
    Object2IntBiMap​(int expected, float loadFactor, T defaultForwardsValue, int defaultBackwardsValue)
     
    Object2IntBiMap​(T defaultForwardsValue)
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    boolean
     
    boolean
    containsValue​(int i)
     
    int
     
    void
     
    void
     
    boolean
    equals​(Object o)
     
    get​(int key)
     
    int
    getInt​(Object o)
     
    getOrDefault​(int key, T defaultValue)
     
    int
    getOrDefault​(Object key, int defaultValue)
     
    int
     
    it.unimi.dsi.fastutil.objects.ObjectSet<it.unimi.dsi.fastutil.ints.Int2ObjectMap.Entry<T>>
     
    boolean
     
    it.unimi.dsi.fastutil.objects.ObjectSet<T>
     
    it.unimi.dsi.fastutil.objects.ObjectSet<it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<T>>
     
    int
    put​(T key, int value)
     
    void
    putAll​(@NotNull Map<? extends T,​? extends Integer> m)
     
    int
    removeInt​(Object key)
     
    int
     
     
    it.unimi.dsi.fastutil.ints.IntCollection
     

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface it.unimi.dsi.fastutil.Function

    apply

    Methods inherited from interface java.util.function.Function

    compose

    Methods inherited from interface java.util.Map

    compute, computeIfAbsent, computeIfPresent, replaceAll

    Methods inherited from interface it.unimi.dsi.fastutil.objects.Object2IntFunction

    andThen, andThenByte, andThenChar, andThenDouble, andThenFloat, andThenInt, andThenLong, andThenObject, andThenReference, andThenShort, applyAsInt, composeByte, composeChar, composeDouble, composeFloat, composeInt, composeLong, composeObject, composeReference, composeShort

    Methods inherited from interface it.unimi.dsi.fastutil.objects.Object2IntMap

    clear, computeIfAbsent, computeIfAbsent, computeInt, computeIntIfAbsent, computeIntIfAbsentPartial, computeIntIfPresent, containsValue, entrySet, forEach, get, getOrDefault, merge, merge, mergeInt, mergeInt, mergeInt, put, putIfAbsent, putIfAbsent, remove, remove, remove, replace, replace, replace, replace
  • Constructor Details

    • Object2IntBiMap

      public Object2IntBiMap()
    • Object2IntBiMap

      public Object2IntBiMap(int expected)
    • Object2IntBiMap

      public Object2IntBiMap(T defaultForwardsValue)
    • Object2IntBiMap

      public Object2IntBiMap(int expected, float loadFactor)
    • Object2IntBiMap

      public Object2IntBiMap(int expected, float loadFactor, int defaultBackwardsValue)
    • Object2IntBiMap

      public Object2IntBiMap(int expected, float loadFactor, T defaultForwardsValue, int defaultBackwardsValue)
  • Method Details

    • size

      public int size()
      Specified by:
      size in interface it.unimi.dsi.fastutil.Function<T,​Integer>
      Specified by:
      size in interface Map<T,​Integer>
      Specified by:
      size in interface it.unimi.dsi.fastutil.objects.Object2IntMap<T>
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface Map<T,​Integer>
    • getInt

      public int getInt(Object o)
      Specified by:
      getInt in interface it.unimi.dsi.fastutil.objects.Object2IntFunction<T>
    • get

      public T get(int key)
    • getOrDefault

      public int getOrDefault(Object key, int defaultValue)
      Specified by:
      getOrDefault in interface it.unimi.dsi.fastutil.objects.Object2IntFunction<T>
      Specified by:
      getOrDefault in interface it.unimi.dsi.fastutil.objects.Object2IntMap<T>
    • getOrDefault

      public T getOrDefault(int key, T defaultValue)
    • defaultReturnValue

      public void defaultReturnValue(int i)
      Specified by:
      defaultReturnValue in interface it.unimi.dsi.fastutil.objects.Object2IntFunction<T>
      Specified by:
      defaultReturnValue in interface it.unimi.dsi.fastutil.objects.Object2IntMap<T>
    • defaultReturnValue

      public void defaultReturnValue(T v)
    • defaultReturnValue

      public int defaultReturnValue()
      Specified by:
      defaultReturnValue in interface it.unimi.dsi.fastutil.objects.Object2IntFunction<T>
      Specified by:
      defaultReturnValue in interface it.unimi.dsi.fastutil.objects.Object2IntMap<T>
    • backwardsDefaultReturnValue

      public T backwardsDefaultReturnValue()
    • object2IntEntrySet

      public it.unimi.dsi.fastutil.objects.ObjectSet<it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<T>> object2IntEntrySet()
      Specified by:
      object2IntEntrySet in interface it.unimi.dsi.fastutil.objects.Object2IntMap<T>
    • int2ObjectEntrySet

      public it.unimi.dsi.fastutil.objects.ObjectSet<it.unimi.dsi.fastutil.ints.Int2ObjectMap.Entry<T>> int2ObjectEntrySet()
    • keySet

      public it.unimi.dsi.fastutil.objects.ObjectSet<T> keySet()
      Specified by:
      keySet in interface Map<T,​Integer>
      Specified by:
      keySet in interface it.unimi.dsi.fastutil.objects.Object2IntMap<T>
    • values

      public it.unimi.dsi.fastutil.ints.IntCollection values()
      Specified by:
      values in interface Map<T,​Integer>
      Specified by:
      values in interface it.unimi.dsi.fastutil.objects.Object2IntMap<T>
    • containsKey

      public boolean containsKey(Object o)
      Specified by:
      containsKey in interface it.unimi.dsi.fastutil.Function<T,​Integer>
      Specified by:
      containsKey in interface Map<T,​Integer>
      Specified by:
      containsKey in interface it.unimi.dsi.fastutil.objects.Object2IntMap<T>
    • containsValue

      public boolean containsValue(int i)
      Specified by:
      containsValue in interface it.unimi.dsi.fastutil.objects.Object2IntMap<T>
    • put

      public int put(T key, int value)
      Specified by:
      put in interface it.unimi.dsi.fastutil.objects.Object2IntFunction<T>
    • putAll

      public void putAll(@NotNull @NotNull Map<? extends T,​? extends Integer> m)
      Specified by:
      putAll in interface Map<T,​Integer>
    • removeInt

      public int removeInt(Object key)
      Specified by:
      removeInt in interface it.unimi.dsi.fastutil.objects.Object2IntFunction<T>
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface Map<T,​Integer>
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Specified by:
      equals in interface Map<T,​Integer>
      Overrides:
      equals in class Object