public class MetricalLpcfgHead extends java.lang.Object implements java.lang.Comparable<MetricalLpcfgHead>, java.io.Serializable
MetricalLpcfgHead
represents the head of a node in our lexicalized pcfg.
It contains information about the longest note lying under a node, that note's location
relative to the start of the beat, and whether that note begins from a tie. It's natural
ordering is first by decreasing length
, then by increasing startQuantum
,
and finally by tiesIn
, where false
comes first.Modifier and Type | Field and Description |
---|---|
private double |
length
The length of this head, normalized so that a value of
1.0 represents
the sub beat length. |
private static long |
serialVersionUID
Version 1
|
private double |
startQuantum
The offset of the quantum which begins the first occurrence of a note of this head's length
in the current node, normalized so that a value of
1.0 represents
the sub beat length. |
private boolean |
tiesIn
True if this head starts with a TIE.
|
Constructor and Description |
---|
MetricalLpcfgHead()
|
MetricalLpcfgHead(double length,
double startQuantum,
boolean tiesIn)
Create a new head with the given fields.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(MetricalLpcfgHead other) |
boolean |
equals(java.lang.Object other) |
double |
getLength()
Get the length of this head.
|
MetricalLpcfgHead |
getShifted(double shiftLength)
Get a new head with its
startQuantum shifted right by some length. |
int |
hashCode() |
java.lang.String |
toString() |
private static final long serialVersionUID
private final double length
1.0
represents
the sub beat length.private final boolean tiesIn
startQuantum
== 0
.private final double startQuantum
1.0
represents
the sub beat length.public MetricalLpcfgHead()
public MetricalLpcfgHead(double length, double startQuantum, boolean tiesIn)
length
- length
startQuantum
- startQuantum
tiesIn
- tiesIn
public MetricalLpcfgHead getShifted(double shiftLength)
startQuantum
shifted right by some length.shiftLength
- The length to shift startQuantum
by.startQuantum
shifted.public double getLength()
length
public int compareTo(MetricalLpcfgHead other)
compareTo
in interface java.lang.Comparable<MetricalLpcfgHead>
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object