abc4j API Specification

abc.notation
Class NoteAbstract

java.lang.Object
  extended by abc.notation.NoteAbstract
All Implemented Interfaces:
MusicElement
Direct Known Subclasses:
MultiNote, Note

public class NoteAbstract
extends java.lang.Object
implements MusicElement

This is the abstract class to define notes or multi notes.


Field Summary
static byte DOWN
          The down bow type.
static byte NONE
          The none bow type.
static byte UP
          The up bow type.
 
Constructor Summary
NoteAbstract()
           
 
Method Summary
 byte countDots()
          Returns the number of dots for this note.
 byte getBow()
          Returns the bow to be used when playing this note.
 java.lang.String getChordName()
          Returns the name of the chord.
 byte getDotted()
          Deprecated. replaced by countDots()
 Note[] getGracingNotes()
          Returns the gracing notes to be played with this note.
 int getGracingNotesLength(short defaultNoteLength)
          Needs to be reworked !!
 SlurDefinition getSlurDefinition()
           
 Tuplet getTuplet()
          Returns the tuplet this note is part of.
 boolean hasGeneralGracing()
          Returns true if this note has a general gracing, false otherwise.
 boolean hasGracingNotes()
          Returns true if this note has gracings, false otherwise.
 boolean hasStaccato()
          Returns true if this note should be played with staccato.
 boolean isBeginingSlur()
           
 boolean isEndingSlur()
           
 boolean isPartOfSlur()
          Returns true if this Note is part of a slur.
 boolean isPartOfTuplet()
          Return true if this note is part of a tuplet.
 void setBow(byte bowValue)
          Sets the bow to be used when playing this note.
 void setChordName(java.lang.String chordName)
          Sets the name of the chord.
 void setDotted(byte dotsNumber)
          Sets the number of dots for this note.
 void setGeneralGracing(boolean hasGeneralGracing)
          Specifies if this note should be played with a general gracing or not.
 void setGracingNotes(Note[] notes)
           
 void setPartOfSlur(boolean isPartOfSlur)
          Sets if this note is part of a slur or not.
 void setSlurDefinition(SlurDefinition slurDefinition)
           
 void setStaccato(boolean staccatoValue)
          Sets the staccato playing style of this note.
 java.lang.String toString()
          Returns a String representation of this Object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NONE

public static final byte NONE
The none bow type.

See Also:
Constant Field Values

DOWN

public static final byte DOWN
The down bow type.

See Also:
Constant Field Values

UP

public static final byte UP
The up bow type.

See Also:
Constant Field Values
Constructor Detail

NoteAbstract

public NoteAbstract()
Method Detail

setChordName

public void setChordName(java.lang.String chordName)
Sets the name of the chord.

Parameters:
chordName - The name of the chord, ex: Gm6.

getChordName

public java.lang.String getChordName()
Returns the name of the chord.

Returns:
The name of the chord, null if no chord has been set.

getBow

public byte getBow()
Returns the bow to be used when playing this note.

Returns:
The bow to be used when playing this note.
See Also:
setBow(byte)

setBow

public void setBow(byte bowValue)
Sets the bow to be used when playing this note.

Parameters:
bowValue - The bow to be used when playing this note. Possible values are NONE (the default value when not specified), UP or DOWN.

getGracingNotes

public Note[] getGracingNotes()
Returns the gracing notes to be played with this note.

Returns:
The gracing notes to be played with this note. null if this note has no gracing notes.
See Also:
hasGracingNotes()

setGracingNotes

public void setGracingNotes(Note[] notes)

hasGracingNotes

public boolean hasGracingNotes()
Returns true if this note has gracings, false otherwise.

Returns:
true if this note has gracings, false otherwise.

setDotted

public void setDotted(byte dotsNumber)
Sets the number of dots for this note.

Parameters:
dotsNumber - The number of dots for this note.

getDotted

public byte getDotted()
Deprecated. replaced by countDots()

Returns the dotted value of this note.

Returns:
The dotted value of this note. Default is 0.
See Also:
countDots()

countDots

public byte countDots()
Returns the number of dots for this note.

Returns:
The number of dots for this note. Default is 0.

hasGeneralGracing

public boolean hasGeneralGracing()
Returns true if this note has a general gracing, false otherwise.

Returns:
true if this note has a general gracing, false otherwise.

setGeneralGracing

public void setGeneralGracing(boolean hasGeneralGracing)
Specifies if this note should be played with a general gracing or not.

Parameters:
hasGeneralGracing - true if this note should be played with a general gracing, false otherwise.

hasStaccato

public boolean hasStaccato()
Returns true if this note should be played with staccato.

Returns:
true if this note should be played with staccato, false otherwise.
See Also:
setStaccato(boolean)

setStaccato

public void setStaccato(boolean staccatoValue)
Sets the staccato playing style of this note.

Parameters:
staccatoValue - true if this note should be played with staccato, false otherwise.
See Also:
hasStaccato()

isPartOfSlur

public boolean isPartOfSlur()
Returns true if this Note is part of a slur.

Returns:
true if this Note is part of a slur, false otherwise.

isPartOfTuplet

public boolean isPartOfTuplet()
Return true if this note is part of a tuplet.

Returns:
true if this note is part of a tuplet, false otherwise.

getTuplet

public Tuplet getTuplet()
Returns the tuplet this note is part of.

Returns:
The tuplet this note is part of. null is returned if this note isn't part of a tuplet.
See Also:
isPartOfTuplet()

setPartOfSlur

public void setPartOfSlur(boolean isPartOfSlur)
Sets if this note is part of a slur or not.

Parameters:
isPartOfSlur - true if this note is part of a slur, false otherwise.

getGracingNotesLength

public int getGracingNotesLength(short defaultNoteLength)
Needs to be reworked !!


getSlurDefinition

public SlurDefinition getSlurDefinition()
Returns:
Returns the slurDefinition.

isBeginingSlur

public boolean isBeginingSlur()

isEndingSlur

public boolean isEndingSlur()

setSlurDefinition

public void setSlurDefinition(SlurDefinition slurDefinition)
Parameters:
slurDefinition - The slurDefinition to set.

toString

public java.lang.String toString()
Returns a String representation of this Object.

Overrides:
toString in class java.lang.Object
Returns:
a String representation of this Object.

abc4j API Specification

Submit a bug or feature