Package org.bukkit
Class Note
java.lang.Object
org.bukkit.Note
public class Note
extends java.lang.Object
A note class to store a specific note.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNote.ToneAn enum holding tones. -
Constructor Summary
-
Method Summary
Modifier and Type Method Description booleanequals(java.lang.Object obj)static Noteflat(int octave, Note.Tone tone)Creates a new note for a flat tone, such as A-flat.Noteflattened()bytegetId()Deprecated.Magic valueintgetOctave()Returns the octave of this note.Note.TonegetTone()Returns the tone of this note.inthashCode()booleanisSharped()Returns if this note is sharped.static Notenatural(int octave, Note.Tone tone)Creates a new note for a natural tone, such as A-natural.static Notesharp(int octave, Note.Tone tone)Creates a new note for a sharp tone, such as A-sharp.Notesharped()java.lang.StringtoString()
-
Constructor Details
-
Note
public Note(int note)Creates a new note.- Parameters:
note- Internal note id.getId()always return this value. The value has to be in the interval [0; 24].
-
Note
Creates a new note.- Parameters:
octave- The octave where the note is in. Has to be 0 - 2.tone- The tone within the octave. If the octave is 2 the note has to be F#.sharped- Set if the tone is sharped (e.g. for F#).
-
-
Method Details
-
flat
Creates a new note for a flat tone, such as A-flat.- Parameters:
octave- The octave where the note is in. Has to be 0 - 1.tone- The tone within the octave.- Returns:
- The new note.
-
sharp
Creates a new note for a sharp tone, such as A-sharp.- Parameters:
octave- The octave where the note is in. Has to be 0 - 2.tone- The tone within the octave. If the octave is 2 the note has to be F#.- Returns:
- The new note.
-
natural
Creates a new note for a natural tone, such as A-natural.- Parameters:
octave- The octave where the note is in. Has to be 0 - 1.tone- The tone within the octave.- Returns:
- The new note.
-
sharped
- Returns:
- The note a semitone above this one.
-
flattened
- Returns:
- The note a semitone below this one.
-
getId
@Deprecated public byte getId()Deprecated.Magic valueReturns the internal id of this note.- Returns:
- the internal id of this note.
-
getOctave
public int getOctave()Returns the octave of this note.- Returns:
- the octave of this note.
-
getTone
Returns the tone of this note.- Returns:
- the tone of this note.
-
isSharped
public boolean isSharped()Returns if this note is sharped.- Returns:
- if this note is sharped.
-
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-