provided.music
Class DecoratorSeqList

java.lang.Object
  extended by provided.music.DecoratorSeqList
All Implemented Interfaces:
IPhrase, ISeqList

public class DecoratorSeqList
extends java.lang.Object
implements ISeqList

An ISeqList that transparently routes the visitor execution to its decoree. This class is primarily used to provide a placeholder when a the music should flow to a specific point in the sequence but that point has not yet been calculated, as occurs for instance, during the processing of repeats. When that target point is finally calculated, the decoree can be set and the decorated target will behave identically to the target. This decorator can also be used to dynamically change the flow of the music by changing the target.

Author:
swong

Field Summary
private  ISeqList decoree
          The decoree/target ISeqList list.
 
Constructor Summary
DecoratorSeqList()
          Constructor that is used when the decoree is not known at construction time.
DecoratorSeqList(ISeqList decoree)
          Constructor used to set the decoree to a known value at construction time.
 
Method Summary
 java.lang.Object execute(IPhraseVisitor algo, java.lang.Object... params)
          Simply delegates the call to the decoree.
 void setDecoree(ISeqList decoree)
          Setter methods used to set the decoree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

decoree

private ISeqList decoree
The decoree/target ISeqList list. An MTSeqList by default.

Constructor Detail

DecoratorSeqList

public DecoratorSeqList(ISeqList decoree)
Constructor used to set the decoree to a known value at construction time.

Parameters:
decoree -

DecoratorSeqList

public DecoratorSeqList()
Constructor that is used when the decoree is not known at construction time. Decoree is set to an MTSeqList.

Method Detail

setDecoree

public void setDecoree(ISeqList decoree)
Setter methods used to set the decoree.

Parameters:
decoree - The new decoree ISeqList.

execute

public java.lang.Object execute(IPhraseVisitor algo,
                                java.lang.Object... params)
Simply delegates the call to the decoree.

Specified by:
execute in interface IPhrase
Parameters:
algo - The visitor to execute
params - The input parameters supplied to the algo when its appropriate case is called.
Returns:
The return value from executing the appropriate case on the visitor.