org.specrunner.listeners.core
Class ListenerManagerImpl

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.AbstractSequentialList<E>
              extended by java.util.LinkedList<ISpecRunnerListener>
                  extended by org.specrunner.listeners.core.ListenerManagerImpl
All Implemented Interfaces:
Serializable, Cloneable, Iterable<ISpecRunnerListener>, Collection<ISpecRunnerListener>, Deque<ISpecRunnerListener>, List<ISpecRunnerListener>, Queue<ISpecRunnerListener>, IListenerManager
Direct Known Subclasses:
ListenerManagerDefault

public class ListenerManagerImpl
extends LinkedList<ISpecRunnerListener>
implements IListenerManager

Default listener manager.

Author:
Thiago Santos
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
ListenerManagerImpl()
           
 
Method Summary
 boolean add(ISpecRunnerListener e)
           
<T extends ISpecRunnerListener>
List<T>
filterByType(Class<T> type)
          Filter listeners by their types.
 void remove(String name)
          Remove a listener by its name.
 void reset()
          Reset all listeners.
 
Methods inherited from class java.util.LinkedList
add, addAll, addAll, addFirst, addLast, clear, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, toArray, toArray
 
Methods inherited from class java.util.AbstractSequentialList
iterator
 
Methods inherited from class java.util.AbstractList
equals, hashCode, listIterator, removeRange, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray
 
Methods inherited from interface java.util.Deque
iterator
 

Constructor Detail

ListenerManagerImpl

public ListenerManagerImpl()
Method Detail

reset

public void reset()
Description copied from interface: IListenerManager
Reset all listeners.

Specified by:
reset in interface IListenerManager

add

public boolean add(ISpecRunnerListener e)
Specified by:
add in interface Collection<ISpecRunnerListener>
Specified by:
add in interface Deque<ISpecRunnerListener>
Specified by:
add in interface List<ISpecRunnerListener>
Specified by:
add in interface Queue<ISpecRunnerListener>
Overrides:
add in class LinkedList<ISpecRunnerListener>

remove

public void remove(String name)
Description copied from interface: IListenerManager
Remove a listener by its name.

Specified by:
remove in interface IListenerManager
Parameters:
name - The name of the listener to be removed.

filterByType

public <T extends ISpecRunnerListener> List<T> filterByType(Class<T> type)
Description copied from interface: IListenerManager
Filter listeners by their types.

Specified by:
filterByType in interface IListenerManager
Type Parameters:
T - The listener type.
Parameters:
type - The type to be filtered.
Returns:
The listeners of the given type.


Copyright © 2014. All rights reserved.