|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectprovided.music.ToggleDecoratorSeqList
public class ToggleDecoratorSeqList
Multiple Decorator ISeqList where the active decoree (the "target") is toggled (cycled, actually) through all the available decorees. This is arguably a State Design Pattern where each decoree is considered to be another state of the system. This is used to implement repeats where the first time through, the notes are linked back to a repeat start (decoree #0) but the next time through, the next note is the one after the repeat (decoree #1).
Field Summary | |
---|---|
private ISeqList[] |
decorees
The decoree/target ISeqList list. |
private int |
targetIdx
The index of the current target decoree |
Constructor Summary | |
---|---|
ToggleDecoratorSeqList()
Constructor that is used when the decoree is not known at construction time. |
|
ToggleDecoratorSeqList(ISeqList... decorees)
Constructor used to set the decorees to a known values at construction time. |
Method Summary | |
---|---|
java.lang.Object |
execute(IPhraseVisitor algo,
java.lang.Object... params)
Simply delegates the call to the decoree. |
ISeqList |
getTargetDecoree()
Accessor for the current target (active) decoree |
void |
setDecoree(int idx,
ISeqList decoree)
Setter methods used to set the decoree. |
void |
setDecorees(ISeqList... decorees)
|
void |
setTargetToDecoree(int targetIdx)
Used to explicitly set the target (active) decoree if needed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private ISeqList[] decorees
private int targetIdx
Constructor Detail |
---|
public ToggleDecoratorSeqList(ISeqList... decorees)
decorees
- vararg list of ISeqList decoreespublic ToggleDecoratorSeqList()
Method Detail |
---|
public void setDecorees(ISeqList... decorees)
public void setDecoree(int idx, ISeqList decoree)
decoree
- The new decoree ISeqList.public void setTargetToDecoree(int targetIdx)
targetIdx
- the index of the target decoreepublic ISeqList getTargetDecoree()
public java.lang.Object execute(IPhraseVisitor algo, java.lang.Object... params)
execute
in interface IPhrase
algo
- The visitor to executeparams
- The input parameters supplied to the algo when its appropriate case is called.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |