java.lang.Object
provided.abcMusic.musicFW.NESeqList
A non-empty ("cons") sequence list.
----------------------------------------------
A non-empty ISeqList
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate IPhrase
The "first" of the listprivate ISeqList
The "rest" of the listprivate static IPhraseVisitor
toString algo for rest, the recursive helper function of the ToString algo.static String
The ID value of this class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexecute(IPhraseVisitor algo, Object... params)
Calls the NESeqList.ID case of the visitor.getFirst()
Accessor method for the first elementgetRest()
Accessor method for the rest of the lsit(package private) static IPhraseVisitor
Getter for the _toStringAlgo helper.static void
setToStringAlgo(IPhraseVisitor stringAlgo)
Setter for the _toStringAlgo helper.toString()
Run a visitor over the list to convert it to a String.
-
Field Details
-
ID
The ID value of this class- See Also:
- Constant Field Values
-
_first
The "first" of the list -
_rest
The "rest" of the list -
_toStringAlgo
toString algo for rest, the recursive helper function of the ToString algo.
-
-
Constructor Details
-
NESeqList
Cons an IPhrase to a Sequence List.- Parameters:
first
- The first element of the sequencerest
- The rest of the sequence
-
-
Method Details
-
getFirst
Accessor method for the first element- Returns:
- the IPhrase that is the first element of the sequence list
-
getRest
Accessor method for the rest of the lsit- Returns:
- the rest of the sequence list
-
execute
Calls the NESeqList.ID case of the visitor. -
setToStringAlgo
Setter for the _toStringAlgo helper. This non-typical method is provided solely for the purpose of enabling the student to install their toStringAlgo into the read-only provided code.- Parameters:
stringAlgo
- The helper algo to use.
-
getToStringAlgo
Getter for the _toStringAlgo helper. Only for use internally inside this package so ToggleDecoratorSeqList and FineToggleDecoratorSeqList can use the same visitor.- Returns:
- the toStringAlgo helper visitor
-
toString
Run a visitor over the list to convert it to a String. Delegates to the rest of the list using the helper algo, with the accumulator (params[0]) set to "{"+_first.toString().
-