Class CopyOnReadWeakSet<T>

  • All Implemented Interfaces:
    java.lang.Iterable<T>

    public class CopyOnReadWeakSet<T>
    extends WeakSet<T>
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected CopyOnReadWeakSet()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(T t)
      Add the given object to the set.
      void clear()
      Remove all elements from this data structure
      boolean contains​(T t)
      Returns true if the given object is in this data structure
      boolean isEmpty()
      Return whether this data structure is empty
      java.util.Iterator<T> iterator()
      Returns an iterator over the elements in this data structure.
      void remove​(T t)
      Remove the given object from the data structure
      int size()
      Return the number of objects contained within this data structure
      java.util.Collection<T> values()
      Returns a Collection view of this set.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • CopyOnReadWeakSet

        protected CopyOnReadWeakSet()
    • Method Detail

      • add

        public void add​(T t)
        Add the given object to the set.
        Specified by:
        add in class WeakSet<T>
        Parameters:
        t - the object to add
      • remove

        public void remove​(T t)
        Remove the given object from the data structure
        Specified by:
        remove in class WeakSet<T>
        Parameters:
        t - the object to remove
      • clear

        public void clear()
        Remove all elements from this data structure
        Specified by:
        clear in class WeakSet<T>
      • iterator

        public java.util.Iterator<T> iterator()
        Returns an iterator over the elements in this data structure.
      • values

        public java.util.Collection<T> values()
        Description copied from class: WeakSet
        Returns a Collection view of this set. The returned Collection is backed by this set.
        Specified by:
        values in class WeakSet<T>
        Returns:
        a Collection view of this set. The returned Collection is backed by this set.
      • isEmpty

        public boolean isEmpty()
        Description copied from class: WeakSet
        Return whether this data structure is empty
        Specified by:
        isEmpty in class WeakSet<T>
        Returns:
        whether this data structure is empty
      • size

        public int size()
        Description copied from class: WeakSet
        Return the number of objects contained within this data structure
        Specified by:
        size in class WeakSet<T>
        Returns:
        the size
      • contains

        public boolean contains​(T t)
        Description copied from class: WeakSet
        Returns true if the given object is in this data structure
        Specified by:
        contains in class WeakSet<T>
        Returns:
        true if the given object is in this data structure