Comments for state example.

This commit is contained in:
Ilkka Seppala
2014-08-31 11:20:02 +03:00
parent 3bc005f4b7
commit 4debc8eda4
3 changed files with 18 additions and 0 deletions

View File

@ -1,5 +1,13 @@
package com.iluwatar;
/**
*
* In State pattern the object (Mammoth) has internal
* state object (State) that defines the current
* behavior. The state object can be changed
* to alter the behavior.
*
*/
public class App
{
public static void main( String[] args )

View File

@ -1,5 +1,10 @@
package com.iluwatar;
/**
*
* Mammoth has internal state that defines its behavior.
*
*/
public class Mammoth {
private State state;

View File

@ -1,5 +1,10 @@
package com.iluwatar;
/**
*
* State interface.
*
*/
public interface State {
void onEnterState();