Class WeatherDataBean
java.lang.Object
org.deltava.beans.wx.WeatherDataBean
- All Implemented Interfaces:
Serializable, Comparable<WeatherDataBean>, GeoLocation, MapEntry, MarkerMapEntry, Cacheable
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:
- 12.3
- Author:
- Luke
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumAn enumeration to store valid weather data types. -
Field Summary
Fields inherited from interface GeoLocation
ALL, DEGREE_FEET, DEGREE_MILES, FEET_MILES, LAT_DIRECTIONS, LATITUDE, LON_DIRECTIONS, LONGITUDE, RADIAN_MILESModifier and TypeFieldDescriptionstatic final intFormat the Longitude and Latitude.static final doubleSize of a degree in feet.static final doubleSize of a degree in miles.static final intSize of a mile in feet.static final String[]Latitude directions.static final intFormat the Latitude only.static final String[]Longitude directions.static final intFormat the Longitude only.static final intRadius of the Earth in miles.Fields inherited from interface MapEntry
BLUE, BROWN, COLORS, GREEN, GREY, ORANGE, PURPLE, RED, WHITE, YELLOWModifier and TypeFieldDescriptionstatic final StringBlue Google Maps icon, displayed as $static/img/maps/point_blue.pngstatic final StringBrown Google Maps icon, displayed as $static/img/maps/point_brown.pngstatic final String[]All Google Maps icon colors.static final StringGreen Google Maps icon, displayed as $static/img/maps/point_green.pngstatic final StringGrey Google Maps icon, displayed as $static/img/maps/point_grey.pngstatic final StringOrange Google Maps icon, displayed as $static/img/maps/point_orange.pngstatic final StringPurple Google Maps icon, displayed as $static/img/maps/point_purple.pngstatic final StringRed Google Maps icon, displayed as $static/img/maps/point_red.pngstatic final StringWhite Google Maps icon, displayed as $static/img/maps/point_white.pngstatic final StringYellow Google Maps icon, displayed as $static/img/maps/point_yellow.png -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncacheKey()Returns the cache key for this object.intCompares two beans by comparing their effectve dates, creation dates and data types.static WeatherDataBeanCreates an arbitrary weather bean type.booleangetCode()Returns the observation station code.Returns the creation date of this weather object.getData()Returns the weather data.getDate()Returns the effective date of this weather data.Returns the text to display in this marker's infobox if displayed in a Google Map.doubleReturns the latitude of this observation.doubleReturns the longitude of this observation.getName()Returns the observation station name.abstract WeatherDataBean.TypegetType()Returns the data type.inthashCode()voidSets the geographic location of this Observation station.voidSets the geographic location of this Observation station.voidUpdates the weather data.voidSets the effective date of this weather data.toString()Methods inherited from interface GeoLocation
distanceFeet, distanceToModifier and TypeMethodDescriptiondefault intCalculates the distance between two points in feet.default intCalculates the distance between two GeoLocations.Methods inherited from interface MarkerMapEntry
getIconColorModifier and TypeMethodDescriptionReturns the icon color for this entry if displayed in a Google Map.
-
Constructor Details
-
WeatherDataBean
public WeatherDataBean()
-
-
Method Details
-
create
Creates an arbitrary weather bean type.- Parameters:
t- the bean type- Returns:
- a WeatherDataBean, or null if unknown
-
getDate
Returns the effective date of this weather data.- Returns:
- the effective date/time
-
getCode
-
getName
-
getCreatedOn
Returns the creation date of this weather object.- Returns:
- the creation date/time
-
getData
-
getLatitude
public double getLatitude()Returns the latitude of this observation.- Specified by:
getLatitudein interfaceGeoLocation- Returns:
- the latitude in degrees
-
getLongitude
public double getLongitude()Returns the longitude of this observation.- Specified by:
getLongitudein interfaceGeoLocation- Returns:
- the longitude in degrees
-
getType
-
setDate
Sets the effective date of this weather data.- Parameters:
dt- the effective date/time
-
setAirport
Sets the geographic location of this Observation station.- Parameters:
a- an Airport bean
-
setData
-
getInfoBox
Description copied from interface:MapEntryReturns the text to display in this marker's infobox if displayed in a Google Map.- Specified by:
getInfoBoxin interfaceMapEntry- Returns:
- the infobox HTML text, or null if no infobox to be displayed
-
cacheKey
-
compareTo
Compares two beans by comparing their effectve dates, creation dates and data types.- Specified by:
compareToin interfaceComparable<WeatherDataBean>
-
hashCode
-
equals
-
toString
-