public class WeatherData extends java.lang.Object implements Subject
Modifier and Type | Field and Description |
---|---|
private float |
humidity |
private java.util.ArrayList<Observer> |
observers |
private float |
pressure |
private float |
temperature |
Constructor and Description |
---|
WeatherData() |
Modifier and Type | Method and Description |
---|---|
float |
getHumidity() |
float |
getPressure() |
float |
getTemperature() |
void |
measurementsChanged() |
void |
notifyObservers() |
void |
registerObserver(Observer o) |
void |
removeObserver(Observer o) |
void |
setMeasurements(float temperature,
float humidity,
float pressure) |
private float temperature
private float humidity
private float pressure
public WeatherData()
public void registerObserver(Observer o)
registerObserver
in interface Subject
public void removeObserver(Observer o)
removeObserver
in interface Subject
public void notifyObservers()
notifyObservers
in interface Subject
public void measurementsChanged()
public void setMeasurements(float temperature, float humidity, float pressure)
public float getTemperature()
public float getHumidity()
public float getPressure()