de.dante.extex.interpreter.observer.command
Class CommandObserverList

java.lang.Object
  extended byde.dante.extex.interpreter.observer.command.CommandObserverList
All Implemented Interfaces:
CommandObserver

public final class CommandObserverList
extends java.lang.Object
implements CommandObserver

This class provides a type-safe list of observers for the execute event.

Version:
$Revision: 1.2 $
Author:
Gerd Neugebauer

Constructor Summary
CommandObserverList()
           
 
Method Summary
 void add(CommandObserver observer)
          Add an observer to the list.
static CommandObserver register(CommandObserver list, CommandObserver observer)
          Take a list and add an observer.
 void update(Token token)
          Invoke all observers on the list to inform them of the token to be expanded.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandObserverList

public CommandObserverList()
Method Detail

register

public static CommandObserver register(CommandObserver list,
                                       CommandObserver observer)
Take a list and add an observer. If the list is null then a new one is created.

Parameters:
list - the input list or null
observer - the observer to add
Returns:
the input list or a new one with the observer added

add

public void add(CommandObserver observer)
Add an observer to the list.

Parameters:
observer - the observer to add to the list

update

public void update(Token token)
Invoke all observers on the list to inform them of the token to be expanded.

Specified by:
update in interface CommandObserver
Parameters:
token - the token to be expanded