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
Modifier and TypeFieldDescription(package private) Rational
The factor to apply (at the currently visited node) to the printed duration symbols.(package private) @Opt MTree.EssentialBracket
The most recently recognized bracket when descending. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
Payload method to be overridden by user.protected void
protected void
Internal worker method, called recursively depth first.protected void
testCloseBrackets
(Rational when) Called for each node to close essential n-plet-brackets, iff their end-of-duration is reached.void
visit()
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 registerlowestBracket
and 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.currentProportion
andlowestBracket
can be used in the code additionally to the argument "mt".
-