Package com.visionarysoftwaresolutions.hfdpch2.bookstyle.weatherstation

Source Code of com.visionarysoftwaresolutions.hfdpch2.bookstyle.weatherstation.BookWeatherStationSingle

package com.visionarysoftwaresolutions.hfdpch2.bookstyle.weatherstation;

import com.visionarysoftwaresolutions.hfdpch2.bookstyle.weatherstation.CurrentConditions;
import com.visionarysoftwaresolutions.hfdpch2.bookstyle.weatherstation.WeatherData;

public class BookWeatherStationSingle {
 
  static WeatherData weatherData = new WeatherData();
 
  public static void main(String[] args){
   
    //And the books implementation of the Observer method is not as flexible as mine
    //You can't select what displays to show at runtime, it just displays what is programmed in
   
    CurrentConditions currentDisplay = new CurrentConditions(weatherData);
    weatherData.setMeasurements(80, 65, 30.4f);
    weatherData.setMeasurements(82, 70, 29.2f);
    weatherData.setMeasurements(78, 90, 29.2f);
   
    weatherData.deleteObserver(currentDisplay);
    weatherData.setMeasurements(90, 60, 32.5f);
    weatherData.setMeasurements(95, 75, 29.2f);
    weatherData.setMeasurements(100, 90, 18.5f);
   
    }

}
TOP

Related Classes of com.visionarysoftwaresolutions.hfdpch2.bookstyle.weatherstation.BookWeatherStationSingle

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.