Datasets:
ArXiv:
License:
Stack-Repo / data /test /Hugo-Gao /Design-pattern /Observer /src /weatherstationex /WeatherDataObservable.java
Download data/test/Hugo-Gao/Design-pattern/Observer/src/weatherstationex/WeatherDataObservable.java from RepoFusion/Stack-Repo: direct link, hf CLI and curl.
- Browser
- Download file 850 Bytes
-
https://huggingface.co/datasets/RepoFusion/Stack-Repo/resolve/main/data/test/Hugo-Gao/Design-pattern/Observer/src/weatherstationex/WeatherDataObservable.java
- Command line
-
hf download hf://datasets/RepoFusion/Stack-Repo/data/test/Hugo-Gao/Design-pattern/Observer/src/weatherstationex/WeatherDataObservable.java
-
curl -L -o WeatherDataObservable.java https://huggingface.co/datasets/RepoFusion/Stack-Repo/resolve/main/data/test/Hugo-Gao/Design-pattern/Observer/src/weatherstationex/WeatherDataObservable.java
850 Bytes
| package weatherstationex; | |
| import java.util.Observable; | |
| /** | |
| * Created by Administrator on 2017/6/14. | |
| */ | |
| public class WeatherDataObservable extends Observable | |
| { | |
| private float temperature; | |
| private float humidity; | |
| private float pressure; | |
| public WeatherDataObservable() | |
| { | |
| } | |
| public void setMeasurements( float temperature, float humidity, float pressure) | |
| { | |
| this.temperature = temperature; | |
| this.humidity=humidity; | |
| this.pressure = pressure; | |
| measurementsChanged(); | |
| } | |
| private void measurementsChanged() | |
| { | |
| setChanged(); | |
| notifyObservers(); | |
| } | |
| public float getTemperature() | |
| { | |
| return temperature; | |
| } | |
| public float getHumidity() | |
| { | |
| return humidity; | |
| } | |
| public float getPressure() | |
| { | |
| return pressure; | |
| } | |
| } | |