musiccreator
Enum Key
java.lang.Object
java.lang.Enum<Key>
musiccreator.Key
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable<Key>
public enum Key
- extends java.lang.Enum<Key>
Implements the Key class, which defines the musical concept of a key.
Each Key has a name, a number of sharps, number of flats, and an offset
from C in half-steps.
Method Summary |
java.lang.String |
Name()
|
int |
NumFlats()
|
int |
NumSharps()
|
int |
Offset()
|
static Key |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. |
static Key[] |
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 |
C
public static final Key C
G
public static final Key G
D
public static final Key D
A
public static final Key A
E
public static final Key E
B
public static final Key B
F_S
public static final Key F_S
C_S
public static final Key C_S
F
public static final Key F
B_F
public static final Key B_F
E_F
public static final Key E_F
A_F
public static final Key A_F
D_F
public static final Key D_F
G_F
public static final Key G_F
C_F
public static final Key C_F
values
public static final Key[] 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(Key c : Key.values())
System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in
the order they're declared
valueOf
public static Key valueOf(java.lang.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:
java.lang.IllegalArgumentException
- if this enum type has no constant
with the specified name
NumFlats
public int NumFlats()
- Returns:
- Number of flats in the key
NumSharps
public int NumSharps()
- Returns:
- Number of sharps in the key
Offset
public int Offset()
- Returns:
- Offset of the key in half-steps from C
Name
public java.lang.String Name()
- Returns:
- Name of the key