File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed
state/src/main/java/com/iluwatar Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 11package com .iluwatar ;
22
3+ /**
4+ *
5+ * Angry state.
6+ *
7+ */
38public class AngryState implements State {
49
510 private Mammoth mammoth ;
Original file line number Diff line number Diff line change 22
33/**
44 *
5- * In State pattern the object (Mammoth) has internal state object (State) that
5+ * In State pattern the container object (Mammoth) has an internal state object (State) that
66 * defines the current behavior. The state object can be changed to alter the
77 * behavior.
88 *
9+ * In this example the mammoth changes its behavior as time passes by.
10+ *
911 */
1012public class App {
1113
Original file line number Diff line number Diff line change 11package com .iluwatar ;
22
3+ /**
4+ *
5+ * Peaceful state.
6+ *
7+ */
38public class PeacefulState implements State {
49
510 private Mammoth mammoth ;
You can’t perform that action at this time.
0 commit comments