com.oopitis.weather
Interface WeatherPropertyMap

All Known Subinterfaces:
FioData.DataBlock, FioData.DataPoint, FioData.Response
All Known Implementing Classes:
WeatherReport

public interface WeatherPropertyMap

Read-only access to weather data.


Method Summary
<T> T
get(WeatherProperty<T> property)
          Gets the data represented by a weather property.
<T> T
getStandardDeviation(WeatherProperty<T> property)
          Gets the variability of the data from which a property value is calculated.
 

Method Detail

get

<T> T get(WeatherProperty<T> property)
Gets the data represented by a weather property.

Type Parameters:
T - the type of the data
Parameters:
property - the property for which the data is to be returned
Returns:
the data represented by the weather property; null if no data is available or if the given property is not supported
Throws:
java.lang.NullPointerException - if the given property is null

getStandardDeviation

<T> T getStandardDeviation(WeatherProperty<T> property)
Gets the variability of the data from which a property value is calculated. If the value returned by get(WeatherProperty) is the average of all data collected, then the value returned by this method shows how much variation or dispersion exists from the average. Smaller variation implies higher confidence statistically.

Implementation note: While this method in general is only applicable to numeric property values, the standard deviation does not have to be an instance of java.lang.Number. The return object however must have the same type as that of the property value. When the comparison between the standard deviation (returned by this method) and the mean (returned by get(WeatherProperty)) is not obvious, a helper method may be provided to illustrate the confidence level in other ways such as the coefficient of variation in percentages.

Type Parameters:
T - the data type of the property value
Parameters:
property - the property for which the data variability is to be returned
Returns:
the variability of the data from which the property value is calculated; null if such information is unavailable or the given property is not supported
Throws:
java.lang.NullPointerException - if the given property is null
See Also:
get(WeatherProperty)