org.bukkit
Enum Note.Tone

java.lang.Object
  extended by java.lang.Enum<Note.Tone>
      extended by org.bukkit.Note.Tone
All Implemented Interfaces:
Serializable, Comparable<Note.Tone>
Enclosing class:
Note

public static enum Note.Tone
extends Enum<Note.Tone>

An enum holding tones.


Enum Constant Summary
A
           
B
           
C
           
D
           
E
           
F
           
G
           
 
Field Summary
static byte TONES_COUNT
          The number of tones including sharped tones.
 
Method Summary
static Note.Tone getById(byte id)
          Returns the tone to id.
 byte getId()
          Returns the not sharped id of this tone.
 byte getId(boolean sharped)
          Returns the id of this tone.
 boolean isSharpable()
          Returns if this tone could be sharped.
 boolean isSharped(byte id)
          Returns if this tone id is the sharped id of the tone.
static Note.Tone valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Note.Tone[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

G

public static final Note.Tone G

A

public static final Note.Tone A

B

public static final Note.Tone B

C

public static final Note.Tone C

D

public static final Note.Tone D

E

public static final Note.Tone E

F

public static final Note.Tone F
Field Detail

TONES_COUNT

public static final byte TONES_COUNT
The number of tones including sharped tones.

See Also:
Constant Field Values
Method Detail

values

public static final Note.Tone[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(Note.Tone c : Note.Tone.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static Note.Tone valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name

getId

public byte getId()
Returns the not sharped id of this tone.

Returns:
the not sharped id of this tone.

getId

public byte 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:
sharped - Set to true to return the sharped id.
Returns:
the id of this tone.

isSharpable

public boolean isSharpable()
Returns if this tone could be sharped.

Returns:
if this tone could be sharped.

isSharped

public boolean isSharped(byte id)
Returns if this tone id is the sharped id of the tone.

Parameters:
id - the id of the tone.
Returns:
if the tone id is the sharped id of the tone.
Throws:
IllegalArgumentException - if neither the tone nor the semitone have the id.

getById

public static Note.Tone getById(byte id)
Returns the tone to id. Also returning the semitones.

Parameters:
id - the id of the tone.
Returns:
the tone to id.


Copyright © 2013. All Rights Reserved.