AccessibilityListenerList (Java SE 26 & JDK 26)
Description: declaration: module: jdk.accessibility, package: com.sun.java.accessibility.util, class: AccessibilityListenerList
Keywords: com.sun.java.accessibility.util.AccessibilityListenerList class

# Class AccessibilityListenerList

java.lang.Object
com.sun.java.accessibility.util.AccessibilityListenerList

public class AccessibilityListenerList extends Object

The `AccessibilityListenerList` is a copy of the Swing `EventListerList` class.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected Object[]`
  `listenerList`
  The list of listener type, listener pairs

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AccessibilityListenerList()`
  Constructs an `AccessibilityListenerList`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `add(Class<? extends EventListener> t, EventListener l)`
  Add the listener as a listener of the specified type.
  `int`
  `getListenerCount()`
  Returns the total number of listeners for this listener list.
  `int`
  `getListenerCount(Class<? extends EventListener> t)`
  Return the total number of listeners of the supplied type for this listener list.
  `Object[]`
  `getListenerList()`
  Passes back the event listener list as an array of listener type, listener pairs.
  `void`
  `remove(Class<? extends EventListener> t, EventListener l)`
  Remove the listener as a listener of the specified type.
  `String`
  `toString()`
  Return a string representation of the `AccessibilityListenerList`.

  ### Methods declared in class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`
  Modifier and Type
  Method
  Description
  `protected Object`
  `clone()`
  Creates and returns a copy of this object.
  `boolean`
  `equals(Object obj)`
  Indicates whether some other object is "equal to" this one.
  `protected void`
  `finalize()`
  Deprecated, for removal: This API element is subject to removal in a future version.
  Finalization is deprecated and subject to removal in a future release.
  `final Class<?>`
  `getClass()`
  Returns the runtime class of this `Object`.
  `int`
  `hashCode()`
  Returns a hash code value for this object.
  `final void`
  `notify()`
  Wakes up a single thread that is waiting on this object's monitor.
  `final void`
  `notifyAll()`
  Wakes up all threads that are waiting on this object's monitor.
  `final void`
  `wait()`
  Causes the current thread to wait until it is awakened, typically by being notified or interrupted.
  `final void`
  `wait(long timeoutMillis)`
  Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
  `final void`
  `wait(long timeoutMillis, int nanos)`
  Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

- ## Field Details

  - ### listenerList

    protected transient Object[] listenerList
    The list of listener type, listener pairs

- ## Constructor Details

  - ### AccessibilityListenerList

    public AccessibilityListenerList()
    Constructs an `AccessibilityListenerList`.

- ## Method Details

  - ### getListenerList

    public Object[] getListenerList()
    Passes back the event listener list as an array of listener type, listener pairs. Note that for performance reasons, this implementation passes back the actual data structure in which the listener data is stored internally. This method is guaranteed to pass back a non-null array, so that no null-checking is required in fire methods. A zero-length array of Object is returned if there are currently no listeners.

    Absolutely no modification of the data contained in this array should be made. If any such manipulation is necessary, it should be done on a copy of the array returned rather than the array itself.

    Returns:
      an array of listener type, listener pairs.

  - ### getListenerCount

    public int getListenerCount()
    Returns the total number of listeners for this listener list.
    Returns:
      the total number of listeners for this listener list.

  - ### getListenerCount

    public int getListenerCount(Class<? extends EventListener> t)
    Return the total number of listeners of the supplied type for this listener list.
    Parameters:
      `t` - the type of the listener to be counted
    Returns:
      the number of listeners found

  - ### add

    public void add(Class<? extends EventListener> t, EventListener l)
    Add the listener as a listener of the specified type.
    Parameters:
      `t` - the type of the listener to be added
      `l` - the listener to be added

  - ### remove

    public void remove(Class<? extends EventListener> t, EventListener l)
    Remove the listener as a listener of the specified type.
    Parameters:
      `t` - the type of the listener to be removed
      `l` - the listener to be removed

  - ### toString

    public String toString()
    Return a string representation of the `AccessibilityListenerList`.
    Overrides:
      `toString` in class `Object`
    Returns:
      a string representation of the `AccessibilityListenerList`.