|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.tangosol.util.Base
com.tangosol.util.Listeners
public class Listeners
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.
Constructor Summary | |
---|---|
Listeners()
Default constructor. |
Method Summary | |
---|---|
void |
add(EventListener listener)
Add a listener. |
void |
addAll(Listeners listeners)
Add all listeners from another Listeners object. |
boolean |
contains(EventListener listener)
Check if a listener is in the list of listeners. |
boolean |
isEmpty()
Check if there are no listeners. |
EventListener[] |
listeners()
Get the list of listeners. |
void |
remove(EventListener listener)
Remove a listener. |
void |
removeAll()
Remove all listeners. |
String |
toString()
Return a string representation of the Listeners object. |
Constructor Detail |
---|
public Listeners()
Method Detail |
---|
public void add(EventListener listener)
listener
- the EventListener to addpublic void remove(EventListener listener)
listener
- the EventListener to removepublic void addAll(Listeners listeners)
listeners
- the Listeners to addpublic void removeAll()
public boolean isEmpty()
public boolean contains(EventListener listener)
listener
- the EventListener to search for
public EventListener[] listeners()
public String toString()
|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |