Skip to content

Commit 9a866df

Browse files
committed
iluwatar#107 JavaDoc for State pattern
1 parent cec8e4f commit 9a866df

File tree

2 files changed

+43
-38
lines changed

2 files changed

+43
-38
lines changed
Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
package com.iluwatar.state;
2-
3-
/**
4-
*
5-
* In State pattern the container object (Mammoth) has an internal state object (State) that
6-
* defines the current behavior. The state object can be changed to alter the
7-
* behavior.
8-
*
9-
* In this example the mammoth changes its behavior as time passes by.
10-
*
11-
*/
12-
public class App {
13-
14-
public static void main(String[] args) {
15-
16-
Mammoth mammoth = new Mammoth();
17-
mammoth.observe();
18-
mammoth.timePasses();
19-
mammoth.observe();
20-
mammoth.timePasses();
21-
mammoth.observe();
22-
23-
}
24-
}
1+
package com.iluwatar.state;
2+
3+
/**
4+
*
5+
* In State pattern the container object ({@link Mammoth}) has an internal state object ({@link State}) that
6+
* defines the current behavior. The state object can be changed to alter the
7+
* behavior.
8+
* <p>
9+
* In this example the {@link Mammoth} changes its behavior as time passes by.
10+
*
11+
*/
12+
public class App {
13+
14+
public static void main(String[] args) {
15+
16+
Mammoth mammoth = new Mammoth();
17+
mammoth.observe();
18+
mammoth.timePasses();
19+
mammoth.observe();
20+
mammoth.timePasses();
21+
mammoth.observe();
22+
23+
}
24+
}
Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1-
package com.iluwatar.state;
2-
3-
import org.junit.Test;
4-
5-
import com.iluwatar.state.App;
6-
7-
public class AppTest {
8-
9-
@Test
10-
public void test() {
11-
String[] args = {};
12-
App.main(args);
13-
}
14-
}
1+
package com.iluwatar.state;
2+
3+
import org.junit.Test;
4+
5+
import com.iluwatar.state.App;
6+
7+
/**
8+
*
9+
* Application test
10+
*
11+
*/
12+
public class AppTest {
13+
14+
@Test
15+
public void test() {
16+
String[] args = {};
17+
App.main(args);
18+
}
19+
}

0 commit comments

Comments
 (0)