Class Astronomy

java.lang.Object
com.timeanddate.services.dataTypes.astro.Astronomy

public class Astronomy extends Object
Author:
Cato Auestad <cato@timeanddate.com>
  • Constructor Details

    • Astronomy

      public Astronomy()
  • Method Details

    • getName

      public AstronomyObjectType getName()
      Object name. Currently, the sun is the only supported astronomical object.
    • getEvents

      public List<AstronomyEvent> getEvents()
      Lists all sunrise/sunset events during the day.
    • getSpecial

      public AstronomySpecial getSpecial()
      This element is only present if there are no astronomical events. In this case it will indicate if the sun is up or down the whole day.
    • getSunset

      public AstronomyEvent getSunset() throws NullPointerException
      This returns the hour and minute of the sunrise in DateTime format. If there is no sunrise, null will be returned, but the Special-property will say whether or not the sun is up or down.
      Returns:
      Returns sunset or null if there is no sunset that day.
      Throws:
      NullPointerException
    • getSunrise

      public AstronomyEvent getSunrise()
      This returns the hour and minute of the sunrise in DateTime format. If there is no sunrise, null will be returned, but the Special-property will say whether or not the sun is up or down.
      Returns:
      Returns sunrise or null if there is no sunrise that day.
    • fromNode

      public static Astronomy fromNode(Node node)