Class ObjectSet<Key>

java.lang.Object
com.yourkit.probes.ObjectSet<Key>

public final class ObjectSet<Key> extends Object
A weak set of objects. Like an ordinary weak set, this set does not prevent its keys from being discarded by the garbage collector. Unlike an ordinary weak set, this set can be used (keeps the stored values) even inside the value's finalize() method.
  • Constructor Details

    • ObjectSet

      public ObjectSet()
  • Method Details

    • add

      public void add(@NotNull Key object)
    • addFirst

      public boolean addFirst(@NotNull Key object)
      Returns:
      true if the object was added to the set, false if the set already contained the object
    • contains

      public boolean contains(@NotNull Key object)