Package org.jjazz.harmony.api
Enum Class Degree
- All Implemented Interfaces:
Serializable
,Comparable<Degree>
,Constable
The possible degrees that make a chord.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionint
static Degree
getDegree
(Degree.Natural n, int alt) Example: n=NINTH, alt=+1, return NINTH_SHARPstatic Degree
getDegreeMostProbable
(int relPitch) Provide the "most probable" degree for the specified relpitch.getDegrees
(int relPitch) The degrees who match the relative pitch.int
getPitch()
The relative pitch of the degreestatic Degree
Returns the enum constant of this class with the specified name.static Degree[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
ROOT
-
NINTH_FLAT
-
NINTH
-
NINTH_SHARP
-
THIRD_FLAT
-
THIRD
-
FOURTH_OR_ELEVENTH
-
ELEVENTH_SHARP
-
FIFTH_FLAT
-
FIFTH
-
FIFTH_SHARP
-
THIRTEENTH_FLAT
-
SIXTH_OR_THIRTEENTH
-
SEVENTH_FLAT
-
SEVENTH
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException
- if the argument is null
-
getPitch
public int getPitch()The relative pitch of the degree- Returns:
- [0-11]
-
getNatural
-
getAlteration
public int getAlteration()- Returns:
- -1, 0 or 1. For ex. -1 for b9.
-
toStringShort
- Returns:
- "0", "3", "b9", "#11", etc
-
getDegree
Example: n=NINTH, alt=+1, return NINTH_SHARP- Parameters:
n
-alt
-- Returns:
- A ChordDegree or null if no degree match
-
getDegrees
The degrees who match the relative pitch. Ex. relPitch=4 => THIRD Ex. relPitch=3 => NINTH_SHARP and THIRD_FLAT- Parameters:
relPitch
-- Returns:
- A Degree list with 1 or 2 degrees.
-
getDegreeMostProbable
Provide the "most probable" degree for the specified relpitch.Ex: relPitch=3 (Eb) => return THIRD_MINOR rather than NINTH_SHARP.
- Parameters:
relPitch
- 0-11- Returns:
- A Degree. Can't be null.
-