File tree Expand file tree Collapse file tree 3 files changed +18
-0
lines changed
observer/src/main/java/com/iluwatar Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Original file line number Diff line number Diff line change 11package com .iluwatar ;
22
3+ /**
4+ *
5+ * Observer pattern defines one-to-many relationship
6+ * between objects. The target object sends change
7+ * notifications to its registered observers.
8+ *
9+ */
310public class App
411{
512 public static void main ( String [] args )
Original file line number Diff line number Diff line change 33import java .util .ArrayList ;
44import java .util .List ;
55
6+ /**
7+ *
8+ * Weather can be observed by implementing WeatherObserver
9+ * interface and registering as listener.
10+ *
11+ */
612public class Weather {
713
814 private WeatherType currentWeather ;
Original file line number Diff line number Diff line change 11package com .iluwatar ;
22
3+ /**
4+ *
5+ * Observer interface.
6+ *
7+ */
38public interface WeatherObserver {
49
510 void update (WeatherType currentWeather );
You can’t perform that action at this time.
0 commit comments