ritornello.core.conceitual
Class Note

java.lang.Object
  |
  +--ritornello.core.conceitual.Note
Direct Known Subclasses:
PlayableNote

public class Note
extends java.lang.Object


Field Summary
static int DOUBLE_FLAT
          The double flat note value.
static int DOUBLE_SHARP
          The double sharp note value.
static int FLAT
          The flat note value.
static int NATURAL
          The natural note value.
static int SHARP
          The sharp note value.
 
Constructor Summary
Note(PitchName pitchName, int accident)
          Constructor.
 
Method Summary
 boolean equals(Note note)
          Compares two notes, based on their pitch name and accident.
 int getAccident()
          Gets the note accident.
 java.lang.String getAccidentName()
          Retrieves the accident name, given its code.
 java.util.Vector getChords()
           
 java.lang.String getName()
          Retrieves the note name.
 PitchName getPitchName()
          Returns the pitch name related to the note.
 java.util.Vector getScales()
           
static void main(java.lang.String[] argv)
          Test unit.
 void setAccident(int accident)
          Sets the note accident.
 void setPitchName(PitchName pitchName)
          Sets the pitch name.
 java.lang.String toString()
          Retrieves the note name by default.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NATURAL

public static final int NATURAL
The natural note value.

See Also:
Constant Field Values

SHARP

public static final int SHARP
The sharp note value.

See Also:
Constant Field Values

DOUBLE_SHARP

public static final int DOUBLE_SHARP
The double sharp note value.

See Also:
Constant Field Values

FLAT

public static final int FLAT
The flat note value.

See Also:
Constant Field Values

DOUBLE_FLAT

public static final int DOUBLE_FLAT
The double flat note value.

See Also:
Constant Field Values
Constructor Detail

Note

public Note(PitchName pitchName,
            int accident)
     throws ValidationException
Constructor. Sets the pitch name and accident for a note.

Parameters:
pitchName - - A note's pitch name.
accident - - A note accident (e.g. Natural(0), #(+1), b(-1), ##(+2), bb(-2)).
Throws:
ValidationException
Method Detail

getChords

public java.util.Vector getChords()
Returns:
java.util.Vector

getScales

public java.util.Vector getScales()
Returns:
java.util.Vector

getAccident

public int getAccident()
Gets the note accident.

Returns:
int

setAccident

public void setAccident(int accident)
                 throws ValidationException
Sets the note accident.

Parameters:
accident - - A note accident (e.g. Natural(0), #(+1), b(-1), ##(+2), bb(-2)).
Throws:
ValidationException

getAccidentName

public java.lang.String getAccidentName()
Retrieves the accident name, given its code.

Returns:
String

getPitchName

public PitchName getPitchName()
Returns the pitch name related to the note.

Returns:
PitchName

equals

public boolean equals(Note note)
Compares two notes, based on their pitch name and accident.

Parameters:
note - - A note to compare.
Returns:
boolean

setPitchName

public void setPitchName(PitchName pitchName)
Sets the pitch name.

Parameters:
pitchName - - The pitch name.

main

public static void main(java.lang.String[] argv)
Test unit.

Parameters:
argv - - The command line arguments.

getName

public java.lang.String getName()
Retrieves the note name.

Returns:
String

toString

public java.lang.String toString()
Retrieves the note name by default.

Overrides:
toString in class java.lang.Object
Returns:
String