File tree Expand file tree Collapse file tree 3 files changed +18
-0
lines changed
state/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+ * In State pattern the object (Mammoth) has internal
6+ * state object (State) that defines the current
7+ * behavior. The state object can be changed
8+ * to alter the behavior.
9+ *
10+ */
311public class App
412{
513 public static void main ( String [] args )
Original file line number Diff line number Diff line change 11package com .iluwatar ;
22
3+ /**
4+ *
5+ * Mammoth has internal state that defines its behavior.
6+ *
7+ */
38public class Mammoth {
49
510 private State state ;
Original file line number Diff line number Diff line change 11package com .iluwatar ;
22
3+ /**
4+ *
5+ * State interface.
6+ *
7+ */
38public interface State {
49
510 void onEnterState ();
You can’t perform that action at this time.
0 commit comments