Package eu.bandm.music.entities
Class MTree.Visitor
java.lang.Object
eu.bandm.music.entities.MTree.Visitor
- Enclosing class:
MTree
Central means for evaluating an MTree. Given an
MTree m, execute
m.new Visitor(){...}.visit();
The code at "..." must override action(MTree).-
Field Summary
FieldsModifier and TypeFieldDescription(package private) RationalThe factor to apply (at the currently visited node) to the printed duration symbols.(package private) @Opt MTree.EssentialBracketThe most recently recognized bracket when descending. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidPayload method to be overridden by user.protected voidprotected voidInternal worker method, called recursively depth first.protected voidtestCloseBrackets(Rational when) Called for each node to close essential n-plet-brackets, iff their end-of-duration is reached.voidvisit()Entry point for applying the visitor to the node it is an inner instance of.
-
Field Details
-
currentProportion
Rational currentProportionThe factor to apply (at the currently visited node) to the printed duration symbols. -
lowestBracket
The most recently recognized bracket when descending.
-
-
Constructor Details
-
Visitor
public Visitor()
-
-
Method Details
-
testCloseBrackets
Called for each node to close essential n-plet-brackets, iff their end-of-duration is reached. Ignores vanishing brackets, because they are not in effect when their child nodes are. Reads and alters the global registerlowestBracketand writescurrentProportion. ATTENTION ASSUME that for each bracket holds: "vanishing implies singleton" -
visit
public void visit()Entry point for applying the visitor to the node it is an inner instance of. -
do_visit
Internal worker method, called recursively depth first. Sets the current (=innermost) bracket, updates the total proportion and calls the overridden payload methodaction(MTree). -
descend
-
action
Payload method to be overridden by user.currentProportionandlowestBracketcan be used in the code additionally to the argument "mt".
-