Class Zodiac.Event

java.lang.Object
net.time4j.calendar.astro.Zodiac.Event
All Implemented Interfaces:
Predicate<Moment>, ChronoCondition<Moment>
Enclosing class:
Zodiac

public static class Zodiac.Event extends Object implements ChronoCondition<Moment>

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 Details

    • atMomentOfEntry

      public Moment atMomentOfEntry(Moment start)

      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

      public Moment atMomentOfExit(Moment start)

      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

      public 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.

      Specified by:
      test in interface ChronoCondition<Moment>
      Specified by:
      test in interface Predicate<Moment>
      Parameters:
      moment - the moment to be tested
      Returns:
      boolean