All Implemented Interfaces:
Serializable, Cloneable, Iterable<Object>, Collection<Object>, List<Object>, RandomAccess, SequencedCollection<Object>

public class ListenerListextends Vector<Object>
A thread-safe list for managing event listeners. This class extends Vector to provide a collection that prevents duplicate listener objects from being added.
See Also:
  • Constructor Details

    • ListenerList

      public ListenerList()
      Constructs an empty listener list; every listener is added later through add().
  • Method Details

    • add

      public boolean add(Object obj)
      Adds a listener object to the list if it's not already present.
      Specified by:
      add in interface Collection<Object>
      Specified by:
      add in interface List<Object>
      Overrides:
      add in class Vector<Object>
      Parameters:
      obj - the listener object to add
      Returns:
      true if the object was added, false if it was already in the list