public class MetricalLpcfgNonterminal extends java.lang.Object implements MetricalLpcfgNode, java.io.Serializable
MetricalLpcfgNonterminal is an internal node in a metrical lpcfg tree.| Modifier and Type | Class and Description |
|---|---|
static class |
MetricalLpcfgNonterminal.MetricalLpcfgLevel
An enum representing the level of a
MetricalLpcfgNonterminal |
static class |
MetricalLpcfgNonterminal.MetricalLpcfgType
An enum representing the type of a
MetricalLpcfgNonterminal |
| Modifier and Type | Field and Description |
|---|---|
private java.util.List<MetricalLpcfgNode> |
children
A List of the children of this node.
|
private MetricalLpcfgNonterminal.MetricalLpcfgLevel |
level
The level of this node.
|
private static long |
serialVersionUID
Version 1
|
private MetricalLpcfgNonterminal.MetricalLpcfgType |
type
The type of this node.
|
| Constructor and Description |
|---|
MetricalLpcfgNonterminal(MetricalLpcfgNonterminal.MetricalLpcfgLevel level)
Create a new non-terminal, initially of
type MetricalLpcfgNonterminal.MetricalLpcfgType.EVEN. |
MetricalLpcfgNonterminal(MetricalLpcfgNonterminal nonterminal)
Create a new non-terminal as a deep copy of the given one.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(MetricalLpcfgNode child)
Add a new node as a child of this non-terminal.
|
MetricalLpcfgNonterminal |
deepCopy()
Get a deep copy of this node.
|
boolean |
equals(java.lang.Object o) |
void |
fixChildrenTypes()
|
java.util.List<MetricalLpcfgNode> |
getChildren()
Get the children of this non-terminal.
|
MetricalLpcfgHead |
getHead()
Get the head of this non-terminal.
|
int |
getLength()
Get the length of this node, measured in sub beats.
|
MetricalLpcfgNonterminal.MetricalLpcfgLevel |
getLevel()
Get the level of this non-terminal.
|
MetricalLpcfgTerminal |
getTerminal()
Get the terminal at this level of the tree.
|
java.lang.String |
getTransitionString()
Get the transition String of this non-terminal.
|
java.lang.String |
getTypeString()
Get the String of the type of this node.
|
boolean |
isEmpty()
Get if this node is empty or not.
|
void |
setType(MetricalLpcfgNonterminal.MetricalLpcfgType type)
Set the
type to the given value. |
boolean |
startsWithRest()
Get if this node starts with a REST or not.
|
java.lang.String |
toString() |
java.lang.String |
toStringPretty(int depth,
java.lang.String tab)
Print the given node recursively in a pretty format.
|
private static final long serialVersionUID
private MetricalLpcfgNonterminal.MetricalLpcfgType type
private final MetricalLpcfgNonterminal.MetricalLpcfgLevel level
private final java.util.List<MetricalLpcfgNode> children
public MetricalLpcfgNonterminal(MetricalLpcfgNonterminal.MetricalLpcfgLevel level)
type MetricalLpcfgNonterminal.MetricalLpcfgType.EVEN.level - levelpublic MetricalLpcfgNonterminal(MetricalLpcfgNonterminal nonterminal)
nonterminal - The non-terminal we want a deep copy of.public boolean isEmpty()
MetricalLpcfgNodeisEmpty in interface MetricalLpcfgNodepublic boolean startsWithRest()
MetricalLpcfgNodestartsWithRest in interface MetricalLpcfgNodepublic java.util.List<MetricalLpcfgNode> getChildren()
childrenpublic void addChild(MetricalLpcfgNode child)
child - The new child node to add to childrenpublic void setType(MetricalLpcfgNonterminal.MetricalLpcfgType type)
type to the given value.type - typepublic java.lang.String getTypeString()
type's toString.public MetricalLpcfgNonterminal.MetricalLpcfgLevel getLevel()
levelpublic MetricalLpcfgTerminal getTerminal()
MetricalLpcfgNodegetTerminal in interface MetricalLpcfgNodepublic java.lang.String getTransitionString()
public MetricalLpcfgHead getHead()
getHead in interface MetricalLpcfgNodepublic void fixChildrenTypes()
public int getLength()
MetricalLpcfgNodegetLength in interface MetricalLpcfgNodepublic MetricalLpcfgNonterminal deepCopy()
MetricalLpcfgNodedeepCopy in interface MetricalLpcfgNodepublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic java.lang.String toStringPretty(int depth,
java.lang.String tab)
MetricalLpcfgNodetoStringPretty in interface MetricalLpcfgNodedepth - The depth of this node.tab - The tab String to indent tree levels.public java.lang.String toString()
toString in class java.lang.Object