#107 JavaDoc for State pattern
This commit is contained in:
parent
cec8e4f168
commit
9a866dfe34
@ -1,24 +1,24 @@
|
|||||||
package com.iluwatar.state;
|
package com.iluwatar.state;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* In State pattern the container object (Mammoth) has an internal state object (State) that
|
* In State pattern the container object ({@link Mammoth}) has an internal state object ({@link State}) that
|
||||||
* defines the current behavior. The state object can be changed to alter the
|
* defines the current behavior. The state object can be changed to alter the
|
||||||
* behavior.
|
* behavior.
|
||||||
*
|
* <p>
|
||||||
* In this example the mammoth changes its behavior as time passes by.
|
* In this example the {@link Mammoth} changes its behavior as time passes by.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class App {
|
public class App {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|
||||||
Mammoth mammoth = new Mammoth();
|
Mammoth mammoth = new Mammoth();
|
||||||
mammoth.observe();
|
mammoth.observe();
|
||||||
mammoth.timePasses();
|
mammoth.timePasses();
|
||||||
mammoth.observe();
|
mammoth.observe();
|
||||||
mammoth.timePasses();
|
mammoth.timePasses();
|
||||||
mammoth.observe();
|
mammoth.observe();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,19 @@
|
|||||||
package com.iluwatar.state;
|
package com.iluwatar.state;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import com.iluwatar.state.App;
|
import com.iluwatar.state.App;
|
||||||
|
|
||||||
public class AppTest {
|
/**
|
||||||
|
*
|
||||||
@Test
|
* Application test
|
||||||
public void test() {
|
*
|
||||||
String[] args = {};
|
*/
|
||||||
App.main(args);
|
public class AppTest {
|
||||||
}
|
|
||||||
}
|
@Test
|
||||||
|
public void test() {
|
||||||
|
String[] args = {};
|
||||||
|
App.main(args);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user