Class IntObjectBiMap<T>

  • All Implemented Interfaces:
    com.carrotsearch.hppc.IntObjectAssociativeContainer<T>, com.carrotsearch.hppc.IntObjectMap<T>, java.lang.Iterable<com.carrotsearch.hppc.cursors.IntObjectCursor<T>>

    public final class IntObjectBiMap<T>
    extends java.lang.Object
    implements com.carrotsearch.hppc.IntObjectMap<T>
    Very simple BiMap implementation which simply wraps two IntObjectMaps
    Since:
    4.1
    Version:
    4.1
    Author:
    Michael Grove
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()
      boolean containsKey​(int key)
      boolean equals​(java.lang.Object obj)
      void forEach​(java.util.function.Consumer<? super com.carrotsearch.hppc.cursors.IntObjectCursor<T>> action)
      <T1 extends com.carrotsearch.hppc.predicates.IntObjectPredicate<? super T>>
      T1
      forEach​(T1 predicate)
      T get​(int key)
      T getOrDefault​(int key, T defaultValue)
      int hashCode()
      boolean indexExists​(int index)
      T indexGet​(int index)
      void indexInsert​(int index, int key, T value)
      int indexOf​(int key)
      T indexReplace​(int index, T newValue)
      com.carrotsearch.hppc.ObjectIntMap<T> inverse()  
      boolean isEmpty()
      java.util.Iterator<com.carrotsearch.hppc.cursors.IntObjectCursor<T>> iterator()
      com.carrotsearch.hppc.IntCollection keys()
      T put​(int key, T value)
      int putAll​(com.carrotsearch.hppc.IntObjectAssociativeContainer<? extends T> container)
      int putAll​(java.lang.Iterable<? extends com.carrotsearch.hppc.cursors.IntObjectCursor<? extends T>> iterable)
      void release()
      T remove​(int key)
      int removeAll​(com.carrotsearch.hppc.IntContainer container)
      int removeAll​(com.carrotsearch.hppc.predicates.IntObjectPredicate<? super T> predicate)
      int removeAll​(com.carrotsearch.hppc.predicates.IntPredicate predicate)
      int size()
      java.util.Spliterator<com.carrotsearch.hppc.cursors.IntObjectCursor<T>> spliterator()
      com.carrotsearch.hppc.ObjectContainer<T> values()
      java.lang.String visualizeKeyDistribution​(int characters)
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • IntObjectBiMap

        public IntObjectBiMap()
      • IntObjectBiMap

        public IntObjectBiMap​(com.carrotsearch.hppc.IntObjectMap<T> theMap,
                              com.carrotsearch.hppc.ObjectIntMap<T> theInverse)
    • Method Detail

      • inverse

        public com.carrotsearch.hppc.ObjectIntMap<T> inverse()
      • clear

        public void clear()
        Specified by:
        clear in interface com.carrotsearch.hppc.IntObjectMap<T>
      • equals

        public boolean equals​(java.lang.Object obj)
        Specified by:
        equals in interface com.carrotsearch.hppc.IntObjectMap<T>
        Overrides:
        equals in class java.lang.Object
      • get

        public T get​(int key)
        Specified by:
        get in interface com.carrotsearch.hppc.IntObjectMap<T>
      • getOrDefault

        public T getOrDefault​(int key,
                              T defaultValue)
        Specified by:
        getOrDefault in interface com.carrotsearch.hppc.IntObjectMap<T>
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface com.carrotsearch.hppc.IntObjectMap<T>
        Overrides:
        hashCode in class java.lang.Object
      • indexExists

        public boolean indexExists​(int index)
        Specified by:
        indexExists in interface com.carrotsearch.hppc.IntObjectMap<T>
      • indexGet

        public T indexGet​(int index)
        Specified by:
        indexGet in interface com.carrotsearch.hppc.IntObjectMap<T>
      • indexInsert

        public void indexInsert​(int index,
                                int key,
                                T value)
        Specified by:
        indexInsert in interface com.carrotsearch.hppc.IntObjectMap<T>
      • indexOf

        public int indexOf​(int key)
        Specified by:
        indexOf in interface com.carrotsearch.hppc.IntObjectMap<T>
      • indexReplace

        public T indexReplace​(int index,
                              T newValue)
        Specified by:
        indexReplace in interface com.carrotsearch.hppc.IntObjectMap<T>
      • put

        public T put​(int key,
                     T value)
        Specified by:
        put in interface com.carrotsearch.hppc.IntObjectMap<T>
      • putAll

        public int putAll​(com.carrotsearch.hppc.IntObjectAssociativeContainer<? extends T> container)
        Specified by:
        putAll in interface com.carrotsearch.hppc.IntObjectMap<T>
      • putAll

        public int putAll​(java.lang.Iterable<? extends com.carrotsearch.hppc.cursors.IntObjectCursor<? extends T>> iterable)
        Specified by:
        putAll in interface com.carrotsearch.hppc.IntObjectMap<T>
      • release

        public void release()
        Specified by:
        release in interface com.carrotsearch.hppc.IntObjectMap<T>
      • remove

        public T remove​(int key)
        Specified by:
        remove in interface com.carrotsearch.hppc.IntObjectMap<T>
      • visualizeKeyDistribution

        public java.lang.String visualizeKeyDistribution​(int characters)
        Specified by:
        visualizeKeyDistribution in interface com.carrotsearch.hppc.IntObjectMap<T>
      • containsKey

        public boolean containsKey​(int key)
        Specified by:
        containsKey in interface com.carrotsearch.hppc.IntObjectAssociativeContainer<T>
      • forEach

        public <T1 extends com.carrotsearch.hppc.predicates.IntObjectPredicate<? super T>> T1 forEach​(T1 predicate)
        Specified by:
        forEach in interface com.carrotsearch.hppc.IntObjectAssociativeContainer<T>
      • forEach

        public <T1 extends com.carrotsearch.hppc.procedures.IntObjectProcedure<? super T>> T1 forEach​(T1 procedure)
        Specified by:
        forEach in interface com.carrotsearch.hppc.IntObjectAssociativeContainer<T>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface com.carrotsearch.hppc.IntObjectAssociativeContainer<T>
      • iterator

        public java.util.Iterator<com.carrotsearch.hppc.cursors.IntObjectCursor<T>> iterator()
        Specified by:
        iterator in interface com.carrotsearch.hppc.IntObjectAssociativeContainer<T>
        Specified by:
        iterator in interface java.lang.Iterable<T>
      • keys

        public com.carrotsearch.hppc.IntCollection keys()
        Specified by:
        keys in interface com.carrotsearch.hppc.IntObjectAssociativeContainer<T>
      • removeAll

        public int removeAll​(com.carrotsearch.hppc.IntContainer container)
        Specified by:
        removeAll in interface com.carrotsearch.hppc.IntObjectAssociativeContainer<T>
      • removeAll

        public int removeAll​(com.carrotsearch.hppc.predicates.IntObjectPredicate<? super T> predicate)
        Specified by:
        removeAll in interface com.carrotsearch.hppc.IntObjectAssociativeContainer<T>
      • removeAll

        public int removeAll​(com.carrotsearch.hppc.predicates.IntPredicate predicate)
        Specified by:
        removeAll in interface com.carrotsearch.hppc.IntObjectAssociativeContainer<T>
      • size

        public int size()
        Specified by:
        size in interface com.carrotsearch.hppc.IntObjectAssociativeContainer<T>
      • values

        public com.carrotsearch.hppc.ObjectContainer<T> values()
        Specified by:
        values in interface com.carrotsearch.hppc.IntObjectAssociativeContainer<T>
      • forEach

        public void forEach​(java.util.function.Consumer<? super com.carrotsearch.hppc.cursors.IntObjectCursor<T>> action)
        Specified by:
        forEach in interface java.lang.Iterable<T>
      • spliterator

        public java.util.Spliterator<com.carrotsearch.hppc.cursors.IntObjectCursor<T>> spliterator()
        Specified by:
        spliterator in interface java.lang.Iterable<T>