org.deltava.beans.wx
Class WeatherDataBean

java.lang.Object
  extended by 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>, Serializable

A bean to store weather data for a particular location.

Since:
2.2
Version:
3.0
Author:
Luke
See Also:
Serialized Form

Nested Class Summary
static class WeatherDataBean.Type
          An enumeration to store valid weather data types.
 
Field Summary
 
Fields inherited from interface org.deltava.beans.MapEntry
BLUE, BROWN, COLORS, GREEN, GREY, LINECOLORS, ORANGE, PURPLE, RED, WHITE, YELLOW
 
Fields inherited from interface org.deltava.beans.GeoLocation
ALL, DEGREE_MILES, LAT_DIRECTIONS, LATITUDE, LON_DIRECTIONS, LONGITUDE
 
Constructor Summary
WeatherDataBean()
          Initializes the bean.
 
Method Summary
 Object cacheKey()
          Returns the cache key for this object.
 int compareTo(WeatherDataBean o)
          Compares two beans by comparing their effectve dates, creation dates and data types.
static WeatherDataBean create(WeatherDataBean.Type t)
          Creates an arbitrary weather bean type.
 boolean equals(Object o)
           
 String getCode()
          Returns the observation station code.
 Date getCreatedOn()
          Returns the creation date of this weather object.
 String getData()
          Returns the weather data.
 Date getDate()
          Returns the effective date of this weather data.
 String getInfoBox()
          Returns the text to display in this marker's infobox if displayed in a Google Map.
 double getLatitude()
          Returns the latitude of this observation.
 double getLongitude()
          Returns the longitude of this observation.
 String getName()
          Returns the observation station name.
abstract  WeatherDataBean.Type getType()
          Returns the data type.
 int hashCode()
           
 void setAirport(Airport a)
          Sets the geographic location of this Observation station.
 void setAirport(AirportLocation al)
          Sets the geographic location of this Observation station.
 void setData(String data)
          Updates the weather data.
 void setDate(Date dt)
          Sets the effective date of this weather data.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.deltava.beans.MarkerMapEntry
getIconColor
 

Constructor Detail

WeatherDataBean

public WeatherDataBean()
Initializes the bean.

Throws:
NullPointerException - if code is null
Method Detail

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 Date 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 Date 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(Date 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


Copyright © 2004-2009 Global Virtual Airlines Group. All Rights Reserved.