Class ImmutableMapValues<K,​V>

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Iterable<V>, java.util.Collection<V>

    final class ImmutableMapValues<K,​V>
    extends ImmutableCollection<V>
    values() implementation for ImmutableMap.
    • Constructor Detail

    • Method Detail

      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<K>
        Specified by:
        size in class java.util.AbstractCollection<V>
      • iterator

        public UnmodifiableIterator<V> iterator()
        Description copied from class: ImmutableCollection
        Returns an unmodifiable iterator across the elements in this collection.
        Specified by:
        iterator in interface java.util.Collection<K>
        Specified by:
        iterator in interface java.lang.Iterable<K>
        Specified by:
        iterator in class ImmutableCollection<V>
      • spliterator

        public java.util.Spliterator<V> spliterator()
        Specified by:
        spliterator in interface java.util.Collection<K>
        Specified by:
        spliterator in interface java.lang.Iterable<K>
        Overrides:
        spliterator in class ImmutableCollection<V>
      • contains

        public boolean contains​(@CheckForNull
                                java.lang.Object object)
        Specified by:
        contains in interface java.util.Collection<K>
        Specified by:
        contains in class ImmutableCollection<V>
      • isPartialView

        boolean isPartialView()
        Description copied from class: ImmutableCollection
        Returns true if this immutable collection's implementation contains references to user-created objects that aren't accessible via this collection's methods. This is generally used to determine whether copyOf implementations should make an explicit copy to avoid memory leaks.
        Specified by:
        isPartialView in class ImmutableCollection<V>
      • asList

        public ImmutableList<V> asList()
        Description copied from class: ImmutableCollection
        Returns an ImmutableList containing the same elements, in the same order, as this collection.

        Performance note: in most cases this method can return quickly without actually copying anything. The exact circumstances under which the copy is performed are undefined and subject to change.

        Overrides:
        asList in class ImmutableCollection<V>
      • forEach

        public void forEach​(java.util.function.Consumer<? super V> action)