Overview | Package | Class | Tree | Index | Help

Oracle® Coherence Java API Reference
v3.5.3
E15583-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.tangosol.util
Class Listeners

    java.lang.Object
      com.tangosol.util.Base
          com.tangosol.util.Listeners

All Implemented Interfaces:
  java.io.Serializable

    public class Listeners

extends Base
implements java.io.Serializable

Provide a simple, efficient, and thread-safe implementation of a list of event listeners. The implementation is optimized based on the assumption that listeners are added and removed relatively rarely, and that the list of listeners is requested relatively often. Thread safety is implemented by synchronizing on all methods that modify any data member of the class. Read-only methods are not synchronized.

Version:
  1.00, 11/16/97
Author:
  Cameron Purdy

Constructor Summary
`Listeners()` Default constructor.

Method Summary
`void` | `add(java.util.EventListener listener)` Add a listener.
`void` | `addAll(Listeners listeners)` Add all listeners from another Listeners object.
`boolean` | `contains(java.util.EventListener listener)` Check if a listener is in the list of listeners.
`boolean` | `isEmpty()` Check if there are no listeners.
`java.util.EventListener[]` | `listeners()` Get the list of listeners.
`void` | `remove(java.util.EventListener listener)` Remove a listener.
`void` | `removeAll()` Remove all listeners.
`java.lang.String` | `toString()` Return a string representation of the Listeners object.

Constructor Detail

### Listeners

    public Listeners()

  Default constructor.

Method Detail

### add

    public void add(java.util.EventListener listener)

  Add a listener.

  Parameters:
    `listener` - the EventListener to add

### remove

    public void remove(java.util.EventListener listener)

  Remove a listener.

  Parameters:
    `listener` - the EventListener to remove

### addAll

    public void addAll(Listeners listeners)

  Add all listeners from another Listeners object.

  Parameters:
    `listeners` - the Listeners to add

### removeAll

    public void removeAll()

  Remove all listeners.

### isEmpty

    public boolean isEmpty()

  Check if there are no listeners.

  Returns:
    true if there are no listeners

### contains

    public boolean contains(java.util.EventListener listener)

  Check if a listener is in the list of listeners.

  Parameters:
    `listener` - the EventListener to search for
  Returns:
    true if the listener is in the list of listeners

### listeners

    public java.util.EventListener[] listeners()

  Get the list of listeners. It is illegal to modify the return value from this method.

  Returns:
    a the list of listeners

### toString

    public java.lang.String toString()

  Return a string representation of the Listeners object.

  Returns:
    a string representation of the Listeners object

Overview | Package | Class | Tree | Index | Help

Oracle® Coherence Java API Reference
v3.5.3
E15583-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000, 2010, Oracle. All rights reserved.