Package org.wmn4j.notation.access
Class Position
java.lang.Object
org.wmn4j.notation.access.Position
-
Constructor Summary
ConstructorsConstructorDescriptionPosition
(int partIndex, int measureNumber, int voiceNumber, int indexInVoice) Constructor for position in a part with only a single staff.Position
(int partIndex, int staffNumber, int measureNumber, int voiceNumber, int indexInVoice) Constructor for positions in parts with multiple staves.Position
(int partIndex, int staffNumber, int measureNumber, int voiceNumber, int indexInVoice, int indexInChord) Constructor for positions that can be used to access a note in a chord. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true if this position is equal to the given object.int
Returns the index of the note in a chord to which this position points.int
Returns the index in the voice to which this position points.int
Returns the number of the measure to which this position points.int
Returns the part number of this position.int
Returns the staff number in the part pointed to by this position.int
Returns the number of the voice to which this position points.int
hashCode()
boolean
Returns true if this position points to a note in a chord.toString()
-
Constructor Details
-
Position
public Position(int partIndex, int staffNumber, int measureNumber, int voiceNumber, int indexInVoice) Constructor for positions in parts with multiple staves.- Parameters:
partIndex
- the number (index) of the part in the the scorestaffNumber
- the number of the staff in the part. For parts with a single staff use the constructor without the staffNumber parametermeasureNumber
- the measure numbervoiceNumber
- the voice number in the measureindexInVoice
- the index in the voice specified by voiceNumber
-
Position
public Position(int partIndex, int staffNumber, int measureNumber, int voiceNumber, int indexInVoice, int indexInChord) Constructor for positions that can be used to access a note in a chord.- Parameters:
partIndex
- The number (index) of the part in the scorestaffNumber
- The number of the staff in the part. For single staff parts use the constructor without the staffNumber parametermeasureNumber
- The measure numbervoiceNumber
- The voice number in the measureindexInVoice
- The index in the voice specified by voiceNumberindexInChord
- Starting from the bottom of the chord, the index of the note
-
Position
public Position(int partIndex, int measureNumber, int voiceNumber, int indexInVoice) Constructor for position in a part with only a single staff.- Parameters:
partIndex
- the number (index) of the part in the scoremeasureNumber
- the measure numbervoiceNumber
- the voice number in the measureindexInVoice
- the index in the voice specified by voiceNumber
-
-
Method Details
-
getPartIndex
public int getPartIndex()Returns the part number of this position.- Returns:
- The number (index) of the part in the score
-
getStaffNumber
public int getStaffNumber()Returns the staff number in the part pointed to by this position.- Returns:
- the number of the staff in the part
-
getMeasureNumber
public int getMeasureNumber()Returns the number of the measure to which this position points.- Returns:
- the measure number specified by this position
-
getVoiceNumber
public int getVoiceNumber()Returns the number of the voice to which this position points.- Returns:
- the number of the voice in the measure
-
getIndexInVoice
public int getIndexInVoice()Returns the index in the voice to which this position points.- Returns:
- the index in the voice to which this position points
-
isInChord
public boolean isInChord()Returns true if this position points to a note in a chord.- Returns:
- true if this position is for a note in a chord
-
getIndexInChord
public int getIndexInChord()Returns the index of the note in a chord to which this position points.- Returns:
- the index, counting from the bottom of the chord, of a note in a chord
-
equals
Returns true if this position is equal to the given object. Two positions are equal if and only if they are equal in all fields. -
hashCode
public int hashCode() -
toString
-