Package at.jku.ssw.fp.sect10_3
Class WeatherData
- java.lang.Object
-
- at.jku.ssw.fp.sect10_3.WeatherData
-
public class WeatherData extends Object
Class representing weather data retrieved from the internet.- Author:
- Herbert Praehofer
-
-
Constructor Summary
Constructors Modifier Constructor Description private
WeatherData(double temp, double humidity, double pressure, double speed, String clouds)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static int
findDataStart(String data, String key)
static WeatherData
fromJSON(String data)
Creates an weather data object from a JSON string.private static double
getDoubleValue(String data, String key)
private static String
getStringValue(String data, String key)
String
toString()
-
-
-
Field Detail
-
temp
public final double temp
The temperature value
-
humidity
public final double humidity
The humidity value
-
pressure
public final double pressure
The pressure value
-
speed
public final double speed
The wind speed
-
clouds
public final String clouds
The cloud value
-
-
Constructor Detail
-
WeatherData
private WeatherData(double temp, double humidity, double pressure, double speed, String clouds)
Constructor.- Parameters:
temp
- the temperature valuehumidity
- the humidity valuepressure
- the pressure valuespeed
- the wind speedclouds
- the clouding
-
-
Method Detail
-
fromJSON
public static WeatherData fromJSON(String data)
Creates an weather data object from a JSON string.- Parameters:
data
- the JSON string- Returns:
- the weather data object
-
-