Class WeatherDataBean

java.lang.Object
org.deltava.beans.wx.WeatherDataBean
All Implemented Interfaces:
Serializable, Comparable<WeatherDataBean>, GeoLocation, MapEntry, MarkerMapEntry, Cacheable
Direct Known Subclasses:
METAR, TAF

public abstract class WeatherDataBean extends Object implements MarkerMapEntry, Cacheable, Comparable<WeatherDataBean>
A bean to store weather data for a particular location.
Since:
2.2
Version:
11.0
Author:
Luke
See Also:
  • Constructor Details

    • WeatherDataBean

      public WeatherDataBean()
  • Method Details

    • create

      public static WeatherDataBean create(WeatherDataBean.Type t)
      Creates an arbitrary weather bean type.
      Parameters:
      t - the bean type
      Returns:
      a WeatherDataBean, or null if unknown
    • getDate

      public Instant getDate()
      Returns the effective date of this weather data.
      Returns:
      the effective date/time
    • getCode

      public String getCode()
      Returns the observation station code.
      Returns:
      the code
    • getName

      public String getName()
      Returns the observation station name.
      Returns:
      the name
    • getCreatedOn

      public Instant getCreatedOn()
      Returns the creation date of this weather object.
      Returns:
      the creation date/time
    • getData

      public String getData()
      Returns the weather data.
      Returns:
      the data
    • getLatitude

      public double getLatitude()
      Returns the latitude of this observation.
      Specified by:
      getLatitude in interface GeoLocation
      Returns:
      the latitude in degrees
    • getLongitude

      public double getLongitude()
      Returns the longitude of this observation.
      Specified by:
      getLongitude in interface GeoLocation
      Returns:
      the longitude in degrees
    • getType

      public abstract WeatherDataBean.Type getType()
      Returns the data type.
      Returns:
      the data type
    • setDate

      public void setDate(Instant dt)
      Sets the effective date of this weather data.
      Parameters:
      dt - the effective date/time
    • setAirport

      public void setAirport(AirportLocation al)
      Sets the geographic location of this Observation station.
      Parameters:
      al - an AirportLocation bean
    • setAirport

      public void setAirport(Airport a)
      Sets the geographic location of this Observation station.
      Parameters:
      a - an Airport bean
    • setData

      public void setData(String data)
      Updates the weather data.
      Parameters:
      data - the data
    • getInfoBox

      public String getInfoBox()
      Description copied from interface: MapEntry
      Returns the text to display in this marker's infobox if displayed in a Google Map.
      Specified by:
      getInfoBox in interface MapEntry
      Returns:
      the infobox HTML text, or null if no infobox to be displayed
    • cacheKey

      public Object cacheKey()
      Description copied from interface: Cacheable
      Returns the cache key for this object. Caches call this method when adding the object.
      Specified by:
      cacheKey in interface Cacheable
      Returns:
      the cache key for the object
    • compareTo

      public int compareTo(WeatherDataBean o)
      Compares two beans by comparing their effectve dates, creation dates and data types.
      Specified by:
      compareTo in interface Comparable<WeatherDataBean>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object