Class RP_SYS_OverrideTracksValue
java.lang.Object
org.jjazz.rhythmmusicgeneration.api.RP_SYS_OverrideTracksValue
Store which source RhythmVoice is overridden by which [RhythmVoice-rhythm variation] pair.
This is an immutable value.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionRP_SYS_OverrideTracksValue(Rhythm baseRhythm) Create a value with no override.RP_SYS_OverrideTracksValue(Rhythm baseRhythm, Map<RhythmVoice, RP_SYS_OverrideTracksValue.Override> mappings) Create the value for baseRhythm with the specified mappings. -
Method Summary
Modifier and TypeMethodDescriptionclone()Get all the destination rhythms used in the mappings.Get all the source RhythmVoices mapped to other RhythmVoices.getOverride(RhythmVoice rvSrc) The destination RhythmVoice and variation for rvSrc.booleanisEmpty()If true no RhythmVoice mapping is set.static RP_SYS_OverrideTracksValueloadFromString(Rhythm baseRhythm, String s) Create an object from a string.static StringSave the specified object state as a string.set(RhythmVoice rvSrc, RP_SYS_OverrideTracksValue.Override override) Return a new RP_SYS_OverrideTracksValue cloned from this instance but with the rvSrc-Override mapping changed.toString()static StringtoString(RhythmVoice rvSrc, RP_SYS_OverrideTracksValue.Override override)
-
Constructor Details
-
RP_SYS_OverrideTracksValue
Create a value with no override.- Parameters:
baseRhythm- Must implement the ConfigurableMusicGeneratorProvider interface
-
RP_SYS_OverrideTracksValue
public RP_SYS_OverrideTracksValue(Rhythm baseRhythm, Map<RhythmVoice, RP_SYS_OverrideTracksValue.Override> mappings) Create the value for baseRhythm with the specified mappings.- Parameters:
baseRhythm- Must implement the ConfigurableMusicGeneratorProvider interfacemappings- All RhythmVoice keys must belong to baseRhythm. Override can not be null.
-
-
Method Details
-
set
public RP_SYS_OverrideTracksValue set(RhythmVoice rvSrc, RP_SYS_OverrideTracksValue.Override override) Return a new RP_SYS_OverrideTracksValue cloned from this instance but with the rvSrc-Override mapping changed.- Parameters:
rvSrc- Must belong to the baseRhythmoverride- Can be null to remove the mapping for rvSrc- Returns:
-
getBaseRhythm
-
getAllDestinationRhythms
-
isEmpty
public boolean isEmpty()If true no RhythmVoice mapping is set.- Returns:
-
clone
-
getAllSourceRhythmVoices
Get all the source RhythmVoices mapped to other RhythmVoices.- Returns:
-
getOverride
The destination RhythmVoice and variation for rvSrc.- Parameters:
rvSrc-- Returns:
- Can be null if not mapped
-
toDescriptionString
-
toString
-
saveAsString
Save the specified object state as a string."Phrase1>>jjSwing-ID>>Bass>>Main B-1 && Chord1>>popRock-ID>>Chord1" means :
- base rhythm voice Phrase1 is mapped to jjSwing/Bass rhythm voice with variation Main B-1
- base rhythm voice Chord1 is mapped to popRock/Chord1 rhythm voice with no dest. variation specified.- Parameters:
v-- Returns:
- See Also:
-
loadFromString
Create an object from a string.- Parameters:
baseRhythm-s-- Returns:
- Can not be null. If an error occured, returns the default value
- See Also:
-
toString
-