public class MTreeCollector<M> extends Object
MeasureCollector
: The latter collects the names of
meters in the Main M-voice and stores them into barnum2metrum_explicit, which is
passed to the method insertMVoice(Vox,SortedMap)
.Modifier and Type | Field and Description |
---|---|
SortedMap<BigDecimal,MTreeSpec> |
commonDefs
Map all measure numbers to the mtree spec which is valid in that measure, according
to the global "M" voice.
|
Set<BigDecimal> |
explicitCommons
Where explicit meter name definitions are in the global M voice.
|
protected MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> |
msg
Evident
|
protected String |
paramNameMTree
Name of the parameter track to parse for mtree specifications.
|
static String |
runUpToCommon
Constant operator to indicate that an mtree specification
local to a voice shall be valid until the next explicit local entry or
the next entry in the global M-Voice, whatever comes earlier.
|
static String |
runUpToExplicit
Constant operator to indicate that an mtree specification
local to a voice shall be valid until the next explicit entry in this voice.
|
protected Iterable<TpTop> |
topTps
List of all time points to parse.
|
protected Map<TpTop,BigDecimal> |
tp2barnum
Input data, linking the top time points to bar numbers / measure numbers.
|
static String |
useCommon
Constant operator to indicate that from here on the mtree specification
in the M-Voice is again used in this voice.
|
Map<Vox,SortedMap<BigDecimal,MTreeSpec>> |
voiceDefs
Map measure numbers to localdefinitions of meter names to mtree specs, per voices.
|
Constructor and Description |
---|
MTreeCollector(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg,
String paramNameMTree,
Iterable<TpTop> topTps,
Map<TpTop,BigDecimal> tp2barnum)
Constructor for the user.
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
checkNotTop(Vox voice)
Verify that mtree source text does appear only with top level time nodes, not with
sub-nodes.
|
MTreeSpec |
get(Vox v,
BigDecimal t)
Return the mtree specification valid for a particular voice and measure number.
|
void |
insertMVoice(Vox voice,
SortedMap<BigDecimal,M> explicitMeterNames)
Analyse the "mtree" parameter track of the global metric "M" voice.
|
void |
insertVoice_noMTreeSpecs(Vox voice)
Add the map of all measure numbers to an mtree spec for a voice which is known
to have no own/local mtree specifications.
|
void |
insertVoice(Vox voice)
Analyse the "mtree" parameter track of a particular voice which is not
the global metric "M" voice.
|
@Opt MTreeSpec |
searchBackwards(SortedMap<BigDecimal,M> explicitMeterNames,
M metername,
BigDecimal barnum)
Search for the mtree spec definition for a particular meter name,
which is valid at a particular measure number.
|
public static final String runUpToExplicit
public static final String runUpToCommon
public static final String useCommon
protected final MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg
protected final String paramNameMTree
protected final Iterable<TpTop> topTps
protected final Map<TpTop,BigDecimal> tp2barnum
public SortedMap<BigDecimal,MTreeSpec> commonDefs
public Set<BigDecimal> explicitCommons
public Map<Vox,SortedMap<BigDecimal,MTreeSpec>> voiceDefs
public MTreeCollector(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, String paramNameMTree, Iterable<TpTop> topTps, Map<TpTop,BigDecimal> tp2barnum)
ATTENTION params 1 - 3 may be NULL fuer programmatic fill = direct write to map FIXME AUFRÄUMEN!!
@Opt public @Opt MTreeSpec searchBackwards(SortedMap<BigDecimal,M> explicitMeterNames, M metername, BigDecimal barnum)
explicitMeterNames
- names by measure number ("bar number")metername
- the name to find a definition forbarnum
- the point where the definition shall be validpublic void insertMVoice(Vox voice, SortedMap<BigDecimal,M> explicitMeterNames)
MeasureCollector
, and are passed as method argument.
Here the meter names from the m voice are checked a second time: Each first occurance of a particular meter name must be accompanied by an mtree spec. Each later occurance can copy the last assignment.
voice
- the global "M" voiceexplicitMeterNames
- the names of the meters collected in this voice
(by MeasureCollector
) by measure numbers.public void insertVoice(Vox voice)
voiceDefs
which maps every measure number to a meter
definition.voice
- to analyze.void checkNotTop(Vox voice)
public void insertVoice_noMTreeSpecs(Vox voice)
public MTreeSpec get(Vox v, BigDecimal t)