Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
org.bukkit.Note.Tone Enum Reference

Public Member Functions

byte getId ()
 
byte getId (boolean sharped)
 
boolean isSharpable ()
 
boolean isSharped (byte id)
 

Static Public Member Functions

static Tone getById (byte id)
 
 [static initializer]
 

Public Attributes

 G =(0x1, true)
 
 A =(0x3, true)
 
 B =(0x5, false)
 
 C =(0x6, true)
 
 D =(0x8, true)
 
 E =(0xA, false)
 
 F =(0xB, true)
 

Static Public Attributes

staticfinal byte TONES_COUNT = 12
 

Detailed Description

An enum holding tones.

Definition at line 17 of file Note.java.

Member Function Documentation

static Tone org.bukkit.Note.Tone.getById ( byte  id)
static

Returns the tone to id. Also returning the semitones.

Parameters
idthe id of the tone.
Returns
the tone to id.
Deprecated:
Magic value

Definition at line 103 of file Note.java.

Referenced by org.bukkit.Note.getTone(), and org.bukkit.Note.isSharped().

103  {
104  return BY_DATA.get(id);
105  }
byte org.bukkit.Note.Tone.getId ( )

Returns the not sharped id of this tone.

Returns
the not sharped id of this tone.
Deprecated:
Magic value

Definition at line 45 of file Note.java.

References org.bukkit.Note.getId().

Referenced by org.bukkit.Note.Note().

45  {
46  return getId(false);
47  }
byte org.bukkit.Note.Tone.getId ( boolean  sharped)

Returns the id of this tone. These method allows to return the sharped id of the tone. If the tone couldn't be sharped it always return the not sharped id of this tone.

Parameters
sharpedSet to true to return the sharped id.
Returns
the id of this tone.
Deprecated:
Magic value

Definition at line 59 of file Note.java.

59  {
60  byte id = (byte) (sharped && sharpable ? this.id + 1 : this.id);
61 
62  return (byte) (id % TONES_COUNT);
63  }
Note sharped()
Definition: Note.java:194
staticfinal byte TONES_COUNT
Definition: Note.java:31
boolean org.bukkit.Note.Tone.isSharpable ( )

Returns if this tone could be sharped.

Returns
if this tone could be sharped.

Definition at line 70 of file Note.java.

Referenced by org.bukkit.Note.flat(), and org.bukkit.Note.Note().

70  {
71  return sharpable;
72  }
boolean org.bukkit.Note.Tone.isSharped ( byte  id)

Returns if this tone id is the sharped id of the tone.

Parameters
idthe id of the tone.
Returns
if the tone id is the sharped id of the tone.
Exceptions
IllegalArgumentExceptionif neither the tone nor the semitone have the id.
Deprecated:
Magic value

Definition at line 84 of file Note.java.

References org.bukkit.Note.getId().

Referenced by org.bukkit.Note.isSharped().

84  {
85  if (id == getId(false)) {
86  return false;
87  } else if (id == getId(true)) {
88  return true;
89  } else {
90  // The id isn't matching to the tone!
91  throw new IllegalArgumentException("The id isn't matching to the tone.");
92  }
93  }

Member Data Documentation

static final byte org.bukkit.Note.Tone.TONES_COUNT = 12
static

The number of tones including sharped tones.

Definition at line 31 of file Note.java.

Referenced by org.bukkit.Note.getOctave(), and org.bukkit.Note.Note().


The documentation for this enum was generated from the following file: