public enum MoonPhase extends Enum<MoonPhase>
Enumeration of the four most important moon phases.
| Enum Constant and Description |
|---|
FIRST_QUARTER
Marks the first quarter moon.
|
FULL_MOON
Marks the full moon.
|
LAST_QUARTER
Marks the last quarter moon.
|
NEW_MOON
Phase of new moon.
|
| Modifier and Type | Method and Description |
|---|---|
Moment |
after(Moment moment)
Obtains the first moon phase which is after given moment.
|
Moment |
atLunation(int n)
Obtains the time of n-th lunation based on this type of phase.
|
Moment |
atOrAfter(Moment moment)
Obtains the first moon phase which is at or after given moment.
|
Moment |
before(Moment moment)
Obtains the last moon phase which is still before given moment.
|
static double |
getIllumination(Moment moment)
Determines the degree of illumination of the moon at given moment.
|
static double |
getIllumination(Moment moment,
int precision)
Determines the degree of illumination of the moon at given moment.
|
static int |
maxLunation()
Obtains the maximum supported lunation.
|
static int |
minLunation()
Obtains the minimum supported lunation.
|
static MoonPhase |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static MoonPhase[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final MoonPhase NEW_MOON
Phase of new moon.
public static final MoonPhase FIRST_QUARTER
Marks the first quarter moon.
public static final MoonPhase FULL_MOON
Marks the full moon.
public static final MoonPhase LAST_QUARTER
Marks the last quarter moon.
public static MoonPhase[] values()
for (MoonPhase c : MoonPhase.values()) System.out.println(c);
public static MoonPhase valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic Moment after(Moment moment)
Obtains the first moon phase which is after given moment.
moment - the moment to be compared withIllegalArgumentException - if the associated year is not in the range -2000 <= year <= 3000public Moment atOrAfter(Moment moment)
Obtains the first moon phase which is at or after given moment.
moment - the moment to be compared withIllegalArgumentException - if the associated year is not in the range -2000 <= year <= 3000public Moment before(Moment moment)
Obtains the last moon phase which is still before given moment.
moment - the moment to be compared withIllegalArgumentException - if the associated year is not in the range -2000 <= year <= 3000public static int minLunation()
Obtains the minimum supported lunation.
atLunation(int)public static int maxLunation()
Obtains the maximum supported lunation.
atLunation(int)public Moment atLunation(int n)
Obtains the time of n-th lunation based on this type of phase.
The parameter value n = 0 will determine the first phase after the calendar date 2000-01-01.
For example, the expression NEW_MOON.atLunation(0) calculates the first new moon in year 2000
which is on the date 2000-01-06 (UTC). The lunation parameter should be chosen within the range
minLunation() <= n <= maxLunation().
n - count of lunations (distance between two consecutive moon phases of same type)IllegalArgumentException - if the associated year is not in the range -2000 <= year <= 3000minLunation(),
maxLunation()public static double getIllumination(Moment moment)
Determines the degree of illumination of the moon at given moment.
The precision is limited to percent values (two digits after decimal point).
moment - universal time0.00 <= i <= 1.00public static double getIllumination(Moment moment, int precision)
Determines the degree of illumination of the moon at given moment.
The accuracy is limited to percent values (two digits after decimal point)
if specified as 0. For promille values, specify 1 etc. However,
an increased precision does not imply more accuracy but is only suitable to
show some vague tendencies. Percent precision is usually the best choice.
moment - universal timeprecision - desired count of fractional digits of percent values (in range 0-3)0.00 <= i <= 1.00IndexOutOfBoundsException - if the precision is out of rangeCopyright © 2014–2021. All rights reserved.