Class ConcurrentHashMap.EntrySetView<K,​V>

  • All Implemented Interfaces:
    java.lang.Iterable<java.util.Map.Entry<K,​V>>, java.util.Collection<java.util.Map.Entry<K,​V>>, java.util.Set<java.util.Map.Entry<K,​V>>
    Enclosing class:
    ConcurrentHashMap<K,​V>

    public static final class ConcurrentHashMap.EntrySetView<K,​V>
    extends java.lang.Object
    implements java.util.Set<java.util.Map.Entry<K,​V>>
    A view of a ConcurrentHashMap as a Set of (key, value) entries. This class cannot be directly instantiated. See ConcurrentHashMap.entrySet.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean add​(java.util.Map.Entry<K,​V> e)  
      boolean addAll​(java.util.Collection<? extends java.util.Map.Entry<K,​V>> c)  
      void clear()  
      boolean contains​(java.lang.Object o)  
      boolean containsAll​(java.util.Collection<?> c)  
      boolean equals​(java.lang.Object o)  
      ConcurrentHashMap<K,​V> getMap()
      Returns the map backing this view.
      int hashCode()  
      boolean isEmpty()  
      java.util.Iterator<java.util.Map.Entry<K,​V>> iterator()
      Returns a "weakly consistent" iterator that will never throw ConcurrentModificationException, and guarantees to traverse elements as they existed upon construction of the iterator, and may (but is not guaranteed to) reflect any modifications subsequent to construction.
      boolean remove​(java.lang.Object o)  
      boolean removeAll​(java.util.Collection<?> c)  
      boolean retainAll​(java.util.Collection<?> c)  
      int size()  
      java.lang.Object[] toArray()  
      <T> T[] toArray​(T[] a)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, removeIf, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.Set

        clear, containsAll, hashCode, isEmpty, removeAll, retainAll, size, spliterator, toArray, toArray
    • Method Detail

      • contains

        public final boolean contains​(java.lang.Object o)
        Specified by:
        contains in interface java.util.Collection<K>
        Specified by:
        contains in interface java.util.Set<K>
      • remove

        public final boolean remove​(java.lang.Object o)
        Specified by:
        remove in interface java.util.Collection<K>
        Specified by:
        remove in interface java.util.Set<K>
      • iterator

        public final java.util.Iterator<java.util.Map.Entry<K,​V>> iterator()
        Returns a "weakly consistent" iterator that will never throw ConcurrentModificationException, and guarantees to traverse elements as they existed upon construction of the iterator, and may (but is not guaranteed to) reflect any modifications subsequent to construction.
        Specified by:
        iterator in interface java.util.Collection<K>
        Specified by:
        iterator in interface java.lang.Iterable<K>
        Specified by:
        iterator in interface java.util.Set<K>
        Returns:
        an iterator over the entries of this map
      • add

        public final boolean add​(java.util.Map.Entry<K,​V> e)
        Specified by:
        add in interface java.util.Collection<K>
        Specified by:
        add in interface java.util.Set<K>
      • addAll

        public final boolean addAll​(java.util.Collection<? extends java.util.Map.Entry<K,​V>> c)
        Specified by:
        addAll in interface java.util.Collection<K>
        Specified by:
        addAll in interface java.util.Set<K>
      • equals

        public boolean equals​(java.lang.Object o)
        Specified by:
        equals in interface java.util.Collection<K>
        Specified by:
        equals in interface java.util.Set<K>
        Overrides:
        equals in class java.lang.Object
      • getMap

        public ConcurrentHashMap<K,​V> getMap()
        Returns the map backing this view.
        Returns:
        the map backing this view
      • size

        public final int size()
      • isEmpty

        public final boolean isEmpty()
      • clear

        public final void clear()
      • toArray

        public final java.lang.Object[] toArray()
      • toArray

        public final <T> T[] toArray​(T[] a)
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public final java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • containsAll

        public final boolean containsAll​(java.util.Collection<?> c)
      • removeAll

        public final boolean removeAll​(java.util.Collection<?> c)
      • retainAll

        public final boolean retainAll​(java.util.Collection<?> c)