Class RegularImmutableBiMap.Inverse

  • All Implemented Interfaces:
    BiMap<V,​K>, java.io.Serializable, java.util.Map<V,​K>
    Enclosing class:
    RegularImmutableBiMap<K,​V>

    private final class RegularImmutableBiMap.Inverse
    extends ImmutableBiMap<V,​K>
    • Constructor Detail

      • Inverse

        private Inverse()
    • Method Detail

      • size

        public int size()
      • inverse

        public ImmutableBiMap<K,​V> inverse()
        Description copied from class: ImmutableBiMap
        Returns the inverse view of this bimap, which maps each of this bimap's values to its associated key. The two bimaps are backed by the same data; any changes to one will appear in the other.

        Note:There is no guaranteed correspondence between the iteration order of a bimap and that of its inverse.

        The inverse of an ImmutableBiMap is another ImmutableBiMap.

        Specified by:
        inverse in interface BiMap<V,​K>
        Specified by:
        inverse in class ImmutableBiMap<V,​K>
        Returns:
        the inverse view of this bimap
      • forEach

        public void forEach​(java.util.function.BiConsumer<? super V,​? super K> action)
      • get

        @CheckForNull
        public K get​(@CheckForNull
                     java.lang.Object value)
        Specified by:
        get in interface java.util.Map<V,​K>
        Specified by:
        get in class ImmutableMap<V,​K>
      • writeReplace

        java.lang.Object writeReplace()
        Description copied from class: ImmutableMap
        Returns a serializable form of this object. Non-public subclasses should not override this method. Publicly-accessible subclasses must override this method and should return a subclass of SerializedForm whose readResolve() method returns objects of the subclass type.
        Overrides:
        writeReplace in class ImmutableBiMap<V,​K>