Skip to content

Commit 27a2759

Browse files
committed
Improved comments for state pattern.
1 parent 742f837 commit 27a2759

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

state/src/main/java/com/iluwatar/AngryState.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
package com.iluwatar;
22

3+
/**
4+
*
5+
* Angry state.
6+
*
7+
*/
38
public class AngryState implements State {
49

510
private Mammoth mammoth;

state/src/main/java/com/iluwatar/App.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
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
*/
1012
public class App {
1113

state/src/main/java/com/iluwatar/PeacefulState.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
package com.iluwatar;
22

3+
/**
4+
*
5+
* Peaceful state.
6+
*
7+
*/
38
public class PeacefulState implements State {
49

510
private Mammoth mammoth;

0 commit comments

Comments
 (0)