provided.music
Class FineToggleDecoratorSeqList

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

public class FineToggleDecoratorSeqList
extends ToggleDecoratorSeqList

The class is used to implement "Da Capo al fine" or "D.C. al fine", which is to repeat from the beginning up to the "fine" marker. this class assumes that only two target decorees are ever used. The is ToggleDecoratorSeqList that can be signaled to switch to the another target. Be default, the target decoree (#0) remains the same even when it is accessed. But after setFine() is called, the target decoree is switched to the #1 decoree (the "fine" target, usually an MTSeqList because it is the end of the piece). After the #1 decoree is used, the target decoree is advanced to the next available decoree, which , for two decorees, would be back to the #0 decoree. The class returns to default behavior then.

Author:
swong

Field Summary
private  boolean isFine
          Flag that tells the system that the "fine" decoree is to be used next.
 
Constructor Summary
FineToggleDecoratorSeqList()
          Instantiates the class with two MTSeqList decorees.
FineToggleDecoratorSeqList(ISeqList... decorees)
          Instantiates the class with the given decorees.
 
Method Summary
 java.lang.Object execute(IPhraseVisitor algo, java.lang.Object... params)
          Delegates the call to the designated ISeqList decoree.
 void setFine()
           
 
Methods inherited from class provided.music.ToggleDecoratorSeqList
getTargetDecoree, setDecoree, setDecorees, setTargetToDecoree
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isFine

private boolean isFine
Flag that tells the system that the "fine" decoree is to be used next.

Constructor Detail

FineToggleDecoratorSeqList

public FineToggleDecoratorSeqList()
Instantiates the class with two MTSeqList decorees.


FineToggleDecoratorSeqList

public FineToggleDecoratorSeqList(ISeqList... decorees)
Instantiates the class with the given decorees.

Parameters:
decorees - vararg list of ISeqList target decorees.
Method Detail

setFine

public void setFine()

execute

public java.lang.Object execute(IPhraseVisitor algo,
                                java.lang.Object... params)
Delegates the call to the designated ISeqList decoree. If setFine() was called after any previous execution of this method, the #1 decoree is used. setFine is reset. If not, the #0 decoree is used.

Specified by:
execute in interface IPhrase
Overrides:
execute in class ToggleDecoratorSeqList
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.