public static class Zodiac.Event extends Object implements ChronoCondition<Moment>
Represents the event when the sun or moon enters or exits a zodiac.
SunPosition.inSignOf(Zodiac),
MoonPosition.inSignOf(Zodiac),
SunPosition.inConstellationOf(Zodiac),
MoonPosition.inConstellationOf(Zodiac)| Modifier and Type | Method and Description |
|---|---|
Moment |
atMomentOfEntry(Moment start)
Calculates the moment when the celestial body enters the associated zodiac.
|
Moment |
atMomentOfExit(Moment start)
Calculates the moment when the celestial body leaves the associated zodiac.
|
boolean |
test(Moment moment)
Tests if this event happens at given moment.
|
public Moment atMomentOfEntry(Moment start)
Calculates the moment when the celestial body enters the associated zodiac.
The accuracy is limited to roughly minute precision.
start - the moment when to start the searchIllegalArgumentException - if the Julian day of moment is not in supported rangepublic Moment atMomentOfExit(Moment start)
Calculates the moment when the celestial body leaves the associated zodiac.
The accuracy is limited to roughly minute precision.
start - the moment when to start the searchIllegalArgumentException - if the Julian day of moment is not in supported rangepublic boolean test(Moment moment)
Tests if this event happens at given moment.
Example of usage:
Moment moment = PlainTimestamp.of(2000, 4, 18, 13, 16).atUTC();
System.out.println(moment.matches(SunPosition.inConstellationOf(Zodiac.ARIES))); // true
Note: Due to precessional effects, Aries is nowadays passed by sun in April and not around vernal equinox as 2000 years ago.
Copyright © 2014–2021. All rights reserved.