Package org.shredzone.commons.suncalc
Enum MoonPhase.Phase
- All Implemented Interfaces:
Serializable
,Comparable<MoonPhase.Phase>
,java.lang.constant.Constable
- Enclosing class:
- MoonPhase
Enumeration of moon phases.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionWaxing half moon.Full moon.Waning half moon.New moon.Waning crescent moon.Waning gibbous moon.Waxing crescent moon.Waxing gibbous moon. -
Method Summary
Modifier and TypeMethodDescriptiondouble
getAngle()
Returns the moons's angle in reference to the sun, in degrees.double
Returns the moons's angle in reference to the sun, in radians.static MoonPhase.Phase
toPhase
(double angle) Converts an angle to the closest matching moon phase.static MoonPhase.Phase
Returns the enum constant of this type with the specified name.static MoonPhase.Phase[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
NEW_MOON
New moon. -
WAXING_CRESCENT
Waxing crescent moon.- Since:
- 3.5
-
FIRST_QUARTER
Waxing half moon. -
WAXING_GIBBOUS
Waxing gibbous moon.- Since:
- 3.5
-
FULL_MOON
Full moon. -
WANING_GIBBOUS
Waning gibbous moon.- Since:
- 3.5
-
LAST_QUARTER
Waning half moon. -
WANING_CRESCENT
Waning crescent moon.- Since:
- 3.5
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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 nameNullPointerException
- if the argument is null
-
toPhase
Converts an angle to the closest matching moon phase.- Parameters:
angle
- Moon phase angle, in degrees. 0 = New Moon, 180 = Full Moon. Angles outside the [0,360) range are normalized into that range.- Returns:
- Closest Phase that is matching that angle.
- Since:
- 3.5
-
getAngle
Returns the moons's angle in reference to the sun, in degrees. -
getAngleRad
Returns the moons's angle in reference to the sun, in radians.
-