Class WeakHashSet

  • All Implemented Interfaces:
    java.lang.Iterable, java.util.Collection, java.util.Set

    public class WeakHashSet
    extends java.util.AbstractSet
    implements java.util.Set
    The WeakHashSet is an implementation of the Set interface that uses a WeakHashMap.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean add​(java.lang.Object obj)  
      void clear()  
      boolean contains​(java.lang.Object obj)  
      boolean isEmpty()  
      java.util.Iterator iterator()  
      boolean remove​(java.lang.Object obj)  
      int size()  
      • Methods inherited from class java.util.AbstractSet

        equals, hashCode, removeAll
      • Methods inherited from class java.util.AbstractCollection

        addAll, containsAll, retainAll, toArray, toArray, toString
      • Methods inherited from class java.lang.Object

        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

        addAll, containsAll, equals, hashCode, removeAll, retainAll, spliterator, toArray, toArray
    • Constructor Detail

      • WeakHashSet

        public WeakHashSet()
      • WeakHashSet

        public WeakHashSet​(java.util.Collection c)
      • WeakHashSet

        public WeakHashSet​(int initialCapacity,
                           float loadFactor)
      • WeakHashSet

        public WeakHashSet​(int initialCapacity)
    • Method Detail

      • iterator

        public java.util.Iterator iterator()
        Specified by:
        iterator in interface java.util.Collection
        Specified by:
        iterator in interface java.lang.Iterable
        Specified by:
        iterator in interface java.util.Set
        Specified by:
        iterator in class java.util.AbstractCollection
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection
        Specified by:
        size in interface java.util.Set
        Specified by:
        size in class java.util.AbstractCollection
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Collection
        Specified by:
        isEmpty in interface java.util.Set
        Overrides:
        isEmpty in class java.util.AbstractCollection
      • contains

        public boolean contains​(java.lang.Object obj)
        Specified by:
        contains in interface java.util.Collection
        Specified by:
        contains in interface java.util.Set
        Overrides:
        contains in class java.util.AbstractCollection
      • add

        public boolean add​(java.lang.Object obj)
        Specified by:
        add in interface java.util.Collection
        Specified by:
        add in interface java.util.Set
        Overrides:
        add in class java.util.AbstractCollection
      • remove

        public boolean remove​(java.lang.Object obj)
        Specified by:
        remove in interface java.util.Collection
        Specified by:
        remove in interface java.util.Set
        Overrides:
        remove in class java.util.AbstractCollection
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Collection
        Specified by:
        clear in interface java.util.Set
        Overrides:
        clear in class java.util.AbstractCollection