Package net.time4j.calendar.astro
Class Zodiac.Event
java.lang.Object
net.time4j.calendar.astro.Zodiac.Event
- All Implemented Interfaces:
Predicate<Moment>
,ChronoCondition<Moment>
- Enclosing class:
- Zodiac
Represents the event when the sun or moon enters or exits a zodiac.
- Since:
- 4.37
- Author:
- Meno Hochschild
- See Also:
SunPosition.inSignOf(Zodiac)
,MoonPosition.inSignOf(Zodiac)
,SunPosition.inConstellationOf(Zodiac)
,MoonPosition.inConstellationOf(Zodiac)
-
Method Summary
Modifier and TypeMethodDescriptionatMomentOfEntry(Moment start)
Calculates the moment when the celestial body enters the associated zodiac.atMomentOfExit(Moment start)
Calculates the moment when the celestial body leaves the associated zodiac.boolean
Tests if this event happens at given moment.
-
Method Details
-
atMomentOfEntry
Calculates the moment when the celestial body enters the associated zodiac.
The accuracy is limited to roughly minute precision.
- Parameters:
start
- the moment when to start the search- Returns:
- moment of this event at or after given start
- Throws:
IllegalArgumentException
- if the Julian day of moment is not in supported range
-
atMomentOfExit
Calculates the moment when the celestial body leaves the associated zodiac.
The accuracy is limited to roughly minute precision.
- Parameters:
start
- the moment when to start the search- Returns:
- moment of this event at or after given start
- Throws:
IllegalArgumentException
- if the Julian day of moment is not in supported range
-
test
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.
-