|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object scale.common.Root scale.score.Note scale.score.chords.Chord scale.score.chords.SequentialChord scale.score.chords.NullChord
public class NullChord
This class is used as a place holder in the construction of the CFG.
$Id: NullChord.java,v 1.23 2005-02-07 21:28:36 burrill Exp $
Copyright 2005 by the Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
This class represents a non-action. We really don't want null actions in Score, but having this class simplifies the translation from Clef to Scribble. These nodes are removed from Score (Scribble) as soon as the initial, complete Cfg is generated.
Field Summary |
---|
Fields inherited from class scale.score.chords.Chord |
---|
lineNumber |
Constructor Summary | |
---|---|
NullChord()
|
|
NullChord(Chord next)
Create a NullChord. |
Method Summary | |
---|---|
Chord |
copy()
Make a copy of this CFG node with the same out-going CFG edges. |
boolean |
isSpecial()
Return true if this is chord was added for the convenience of the compiler and does not correspond to actual source code in the user program. |
void |
visit(Predicate p)
Process a node by calling its associated routine. |
Methods inherited from class scale.score.Note |
---|
getChord, getEssentialUse, setAnnotationLevel, setReportLevel, toString, validate |
Methods inherited from class scale.common.Root |
---|
addAnnotation, allAnnotations, allMatchingAnnotations, getAnnotation, getDisplayName, getDisplayString, getNodeCount, getNodeID, hasAnnotation, hasEqualAnnotation, hashCode, removeAnnotation, removeAnnotations, toStringAnnotations, toStringClass, trace, trace, trace |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public NullChord(Chord next)
next
- is the out-going CFG edge and may be nullpublic NullChord()
Method Detail |
---|
public Chord copy()
Chord
copy
in class Chord
public boolean isSpecial()
isSpecial
in class Chord
public void visit(Predicate p)
Note
Each class has a visit(Predicate p)
method. For
example, in class ABC
:
public void visit(Predicate p) { p.visitABC(this); }and the class that implements
Predicate
has a method
public void visitABC(Note n) { ABC a = (ABC) n; ... }Thus, the class that implements
Predicate
can call
n.visit(this);where
n
is a Note
sub-class without
determining which specific sub-class n
is.
The visit pattern basically avoids implementing a large
switch
statement or defining different methods
in each class for some purpose.
visit
in class Note
Predicate
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |