eu.limetri.client.mapviewer.layer.weather.tilefactory.CurrentWeatherData Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mapviewer-weather Show documentation
Show all versions of mapviewer-weather Show documentation
MapViewer Weather layer project
/**
* Copyright (C) 2008-2012 AgroSense Foundation.
*
* AgroSense is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
*
* There are special exceptions to the terms and conditions of the GPLv3 as it
* is applied to this software, see the FLOSS License Exception
* .
*
* AgroSense is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* AgroSense. If not, see .
*/
package eu.limetri.client.mapviewer.layer.weather.tilefactory;
import eu.limetri.client.mapviewer.layer.weather.data.CurrentWeatherDataObject;
/**
* @author Frantisek Post
*/
public class CurrentWeatherData {
private String cityName;
private long cityId;
private double longitude;
private double latitude;
private long timestamp;
private float temp;
private float temp_min;
private float temp_max;
private int pressure;
private int humidity;
private float wind_speed;
private float wind_dir;
private long weatherId;
private String weatherDescription;
private String weatherIcon;
private long time;
public CurrentWeatherData() {
time = System.currentTimeMillis();
}
public String getCityName() {
return cityName;
}
public void setCityName(String cityName) {
this.cityName = cityName;
}
public long getCityId() {
return cityId;
}
public void setCityId(long cityId) {
this.cityId = cityId;
}
public double getLongitude() {
return longitude;
}
public void setLongitude(double longitude) {
this.longitude = longitude;
}
public double getLatitude() {
return latitude;
}
public void setLatitude(double latitude) {
this.latitude = latitude;
}
public long getTimestamp() {
return timestamp;
}
public void setTimestamp(long timestamp) {
this.timestamp = timestamp;
}
public float getTemp() {
return temp;
}
public void setTemp(float temp) {
this.temp = temp;
}
public float getTemp_min() {
return temp_min;
}
public void setTemp_min(float temp_min) {
this.temp_min = temp_min;
}
public float getTemp_max() {
return temp_max;
}
public void setTemp_max(float temp_max) {
this.temp_max = temp_max;
}
public int getPressure() {
return pressure;
}
public void setPressure(int pressure) {
this.pressure = pressure;
}
public int getHumidity() {
return humidity;
}
public void setHumidity(int humidity) {
this.humidity = humidity;
}
public float getWind_speed() {
return wind_speed;
}
public void setWind_speed(float wind_speed) {
this.wind_speed = wind_speed;
}
public float getWind_dir() {
return wind_dir;
}
public void setWind_dir(float wind_dir) {
this.wind_dir = wind_dir;
}
public long getWeatherId() {
return weatherId;
}
public void setWeatherId(long weatherId) {
this.weatherId = weatherId;
}
public String getWeatherDescription() {
return weatherDescription;
}
public void setWeatherDescription(String weatherDescription) {
this.weatherDescription = weatherDescription;
}
public String getWeatherIcon() {
return weatherIcon;
}
public void setWeatherIcon(String weatherIcon) {
this.weatherIcon = weatherIcon;
}
@Override
public String toString() {
String t = cityName + " actual temp: " + temp + ", min temp: " + temp_min + ", max temp: " + temp_max;
return t;
}
public boolean isOutdated() {
long timeDelay = System.currentTimeMillis() - time;
return timeDelay >= CurrentWeatherDataObject.OUTDATED_TRESHOLD;
}
}