Package eu.bandm.music.entities
Class QualifiedRational
- All Implemented Interfaces:
Tuploid0
,Tuploid1<Rational>
,Tuploid2<Rational,
,Boolean> Serializable
,Comparable<Tuple2<Rational,
Boolean>>
public class QualifiedRational
extends Tuple2<Rational,Boolean>
implements Comparable<Tuple2<Rational,Boolean>>
Realizes Rational X Bboolean.
The Boolean value has always the meaning of "soundNotPause".
The rational value can be used for time points OR for duration, so this data type is a little bit hacky.
It is needed as argument (and hashkey) for Metric Split operation.
The Boolean value has always the meaning of "soundNotPause".
The rational value can be used for time points OR for duration, so this data type is a little bit hacky.
It is needed as argument (and hashkey) for Metric Split operation.
FIXME "constructor private" machen und NUR NOCH cache benutzen ?
FIXME Zwei verschiedene Klassen für duration und time point?
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class eu.bandm.tools.ops.Tuple2
Tuple2.ListBuilder<B,
C> -
Field Summary
Modifier and TypeFieldDescriptionstatic Translet.Parser<QualifiedRational>
Parsing "1/4" for sound and "p1/4" for pause.(package private) static final Map<Rational,
QualifiedRational> Internal hashmap for instances representing pause durations.(package private) static final Map<Rational,
QualifiedRational> Internal hashmap for instances representing sounding durations. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<QualifiedRational>
Make a list of pause representing instances, with the given durations.static List<QualifiedRational>
Make a list of sound representing instances, with the given durations.int
static List<QualifiedRational>
Make a list of instances, the durations and kinds given by the two lists.static List<QualifiedRational>
Make a list of instances, the durations and kinds given by the two lists.get_durations
(List<QualifiedRational> qrats) Projection to the first component of the products.get_soundsNotPauses
(List<QualifiedRational> qrats) Projection to the second component of the products.static QualifiedRational
pause
(int p, int q) Factory method, use internal cache.static QualifiedRational
Factory method, use internal cache.static QualifiedRational
sound
(int p, int q) Factory method, use internal cache.static QualifiedRational
Factory method, use internal cache.toString()
withRational
(Rational duration) Return a new instance with the given duration and a copied sound/pause value.
-
Field Details
-
pauses
Internal hashmap for instances representing pause durations. -
sounds
Internal hashmap for instances representing sounding durations. -
parser
Parsing "1/4" for sound and "p1/4" for pause.
-
-
Constructor Details
-
QualifiedRational
Only constructor.- Parameters:
r
- durationsoundNotPause
- evident
-
-
Method Details
-
toString
-
pause
Factory method, use internal cache. -
sound
Factory method, use internal cache. -
pause
Factory method, use internal cache. -
sound
Factory method, use internal cache. -
withRational
Return a new instance with the given duration and a copied sound/pause value. -
compareTo
- Specified by:
compareTo
in interfaceComparable<Tuple2<Rational,
Boolean>>
-
get_durations
Projection to the first component of the products. -
get_soundsNotPauses
Projection to the second component of the products. -
allSounds
Make a list of sound representing instances, with the given durations. -
allPause
Make a list of pause representing instances, with the given durations. -
fold
Make a list of instances, the durations and kinds given by the two lists. -
fold
Make a list of instances, the durations and kinds given by the two lists.
-