Class WeakSet<T>

java.lang.Object
ghidra.util.datastruct.WeakSet<T>
All Implemented Interfaces:
Iterable<T>
Direct Known Subclasses:
CopyOnReadWeakSet

public abstract class WeakSet<T> extends Object implements Iterable<T>
  • Field Details

  • Constructor Details

    • WeakSet

      public WeakSet()
  • Method Details

    • maybeWarnAboutAnonymousValue

      protected void maybeWarnAboutAnonymousValue(T t)
      Looks for situations where clients may lose the values added to this class. This most often happens when a client adds an anonymous, local listener to an object that is using a WeakSet to store its listeners. Our policy is to implement listeners at the class field level so that they will not be flagged by this method.
      Parameters:
      t - The object to check
    • addAll

      public void addAll(Iterable<T> it)
      Adds all items to this set
      Parameters:
      it - the items
    • add

      public abstract void add(T t)
      Add the given object to the set
      Parameters:
      t - the object to add
    • remove

      public abstract void remove(T t)
      Remove the given object from the data structure
      Parameters:
      t - the object to remove
    • contains

      public abstract boolean contains(T t)
      Returns true if the given object is in this data structure
      Parameters:
      t - the object
      Returns:
      true if the given object is in this data structure
    • clear

      public abstract void clear()
      Remove all elements from this data structure
    • size

      public abstract int size()
      Return the number of objects contained within this data structure
      Returns:
      the size
    • isEmpty

      public abstract boolean isEmpty()
      Return whether this data structure is empty
      Returns:
      whether this data structure is empty
    • values

      public abstract Collection<T> values()
      Returns a Collection view of this set. The returned Collection is backed by this set.
      Returns:
      a Collection view of this set. The returned Collection is backed by this set.
    • stream

      public Stream<T> stream()
      Returns a stream of the values of this collection.
      Returns:
      a stream of the values of this collection.
    • toString

      public String toString()
      Overrides:
      toString in class Object