提交 3bc005f4 编写于 作者: I Ilkka Seppala

Comments for observer example.

上级 8ddcdac3
package com.iluwatar;
/**
*
* Observer pattern defines one-to-many relationship
* between objects. The target object sends change
* notifications to its registered observers.
*
*/
public class App
{
public static void main( String[] args )
......
......@@ -3,6 +3,12 @@ package com.iluwatar;
import java.util.ArrayList;
import java.util.List;
/**
*
* Weather can be observed by implementing WeatherObserver
* interface and registering as listener.
*
*/
public class Weather {
private WeatherType currentWeather;
......
package com.iluwatar;
/**
*
* Observer interface.
*
*/
public interface WeatherObserver {
void update(WeatherType currentWeather);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册