|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.pealfactory.compose.halfleadspliced.Method
Represents a method: holds name, abbreviation, place notation and leadhead, as well as internal data used to increase performance, such as table permutation numbers for leadhead and place notation permutations. Methods are provided to calculate these perm numbers, and to use them to generate and count music in a lead of the method from a giving starting row.
Since Indis, an alternate constructor is available which supports "composite" methods. These contain the first-half place notation for one method (e.g. Cambridge) and the second half of another (e.g. Yorkshire). Such methods are automatically assigned a two-letter abbreviation (e.g. "CY"). It is no longer possible to generate or count music for individual half-leads.
Much of the code within this class has been heavily tuned for performance, and should not be modified without extensive benchmarking on a range of searches.
| Field Summary | |
private int |
f1stHalfLength
|
private int |
f2ndHalfLength
|
private java.lang.String |
fAbbrev
|
private ImmutableRow[] |
fCallPerms
|
private int |
fCOM
=1 if two halves of composite are different methods |
private ImmutableRow |
fHalflead
|
private int |
fIndex1
|
private int |
fIndex2
|
private ImmutableRow |
fLeadhead
|
private int |
fLeadLength
|
private int[] |
fLeadPermNums
|
private int |
fMethodIndex
|
private java.lang.String |
fName
|
private PN |
fPN
|
private PN |
fPN2
|
private int[] |
fPNPermNums
|
static byte[] |
kBOB_PN
|
static int |
kNCALLTYPES
|
static byte[] |
kSINGLE_PN
|
| Constructor Summary | |
Method(Method m1,
Method m2,
int index)
Create composite method with first half pn from m1 and second half from m2. |
|
Method(java.lang.String name,
java.lang.String pn)
|
|
Method(java.lang.String name,
java.lang.String abbrev,
java.lang.String pn)
Note calcPerms() and updateLeadPerms() MUST be called prior to use. |
|
| Method Summary | |
void |
calcPerms(Tables tables)
Calculates place notation, and leadhead permutations for this method. |
boolean |
equals(java.lang.Object o)
Two methods are equal if their names are equal |
void |
generateLead(RowNode start,
int[] rowNums)
Generates node numbers for entire lead of method, from leadhead up to leadend. |
java.lang.String |
getAbbrev()
|
int |
getCOM()
Returns 0 if this method has the same 1st & 2nd halves, or 1 if it is a composite made out of two different halfleads. |
ImmutableRow |
getHalflead()
Final for speed. |
int |
getIndex1()
|
int |
getIndex2()
|
ImmutableRow |
getLeadhead()
Final for speed. |
int |
getLeadLength()
Final for speed |
int |
getLeadPermNum(int call)
Final for speed (inlining) |
int |
getMethodIndex()
Final for speed |
java.lang.String |
getName()
|
PN |
getPN()
|
private void |
init(java.lang.String name,
java.lang.String abbrev,
PN pn1,
PN pn2)
|
int |
leadMusic(RowNode start)
Calculates music score for one lead of method, from leadhead up to but NOT INCLUDING following leadhead. |
int |
nRowsInFirstHalf()
|
int |
nRowsInSecondHalf()
|
void |
setMethodIndex(int methodIndex)
|
void |
updateLeadPerms(Tables tables)
Before use the leadhead perm numbers must be incremented so they correctly point into the node permtables. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
public static final int kNCALLTYPES
public static final byte[] kBOB_PN
public static final byte[] kSINGLE_PN
private int fMethodIndex
private int fIndex1
private int fIndex2
private java.lang.String fName
private java.lang.String fAbbrev
private PN fPN
private PN fPN2
private int[] fPNPermNums
private ImmutableRow fLeadhead
private ImmutableRow fHalflead
private ImmutableRow[] fCallPerms
private int fLeadLength
private int f1stHalfLength
private int f2ndHalfLength
private int[] fLeadPermNums
private int fCOM
| Constructor Detail |
public Method(java.lang.String name,
java.lang.String pn)
public Method(java.lang.String name,
java.lang.String abbrev,
java.lang.String pn)
public Method(Method m1,
Method m2,
int index)
| Method Detail |
private void init(java.lang.String name,
java.lang.String abbrev,
PN pn1,
PN pn2)
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic java.lang.String getName()
public java.lang.String getAbbrev()
public PN getPN()
public final int getMethodIndex()
public void setMethodIndex(int methodIndex)
public final int getIndex1()
public final int getIndex2()
public final int getLeadLength()
public int nRowsInFirstHalf()
public int nRowsInSecondHalf()
public int getCOM()
public final int getLeadPermNum(int call)
public final ImmutableRow getLeadhead()
public final ImmutableRow getHalflead()
public final int leadMusic(RowNode start)
public final void generateLead(RowNode start,
int[] rowNums)
public void calcPerms(Tables tables)
updateLeadPerms(org.pealfactory.compose.halfleadspliced.Tables)public void updateLeadPerms(Tables tables)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||