de.dante.extex.interpreter.observer.expandMacro
Class ExpandMacroObserverList

java.lang.Object
  extended byde.dante.extex.interpreter.observer.expandMacro.ExpandMacroObserverList
All Implemented Interfaces:
ExpandMacroObserver

public final class ExpandMacroObserverList
extends java.lang.Object
implements ExpandMacroObserver

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

Version:
$Revision: 1.5 $
Author:
Gerd Neugebauer

Constructor Summary
ExpandMacroObserverList()
           
 
Method Summary
 void add(ExpandMacroObserver observer)
          Add an observer to the list.
static ExpandMacroObserver register(ExpandMacroObserver list, ExpandMacroObserver observer)
          Take a list and add an observer.
 void update(Token token, Code code)
          This method is meant to be invoked just before a macro is expanded.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpandMacroObserverList

public ExpandMacroObserverList()
Method Detail

register

public static ExpandMacroObserver register(ExpandMacroObserver list,
                                           ExpandMacroObserver 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(ExpandMacroObserver observer)
Add an observer to the list.

Parameters:
observer - the observer to add to the list

update

public void update(Token token,
                   Code code)
Description copied from interface: ExpandMacroObserver
This method is meant to be invoked just before a macro is expanded.

Specified by:
update in interface ExpandMacroObserver
Parameters:
token - the token to be expanded
code - The code to which the token is expanded. This might be null for undefined macros
See Also:
ExpandMacroObserver.update( de.dante.extex.scanner.type.token.Token, de.dante.extex.interpreter.type.Code)