Comments for state example.
This commit is contained in:
@ -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 )
|
||||
|
@ -1,5 +1,10 @@
|
||||
package com.iluwatar;
|
||||
|
||||
/**
|
||||
*
|
||||
* Mammoth has internal state that defines its behavior.
|
||||
*
|
||||
*/
|
||||
public class Mammoth {
|
||||
|
||||
private State state;
|
||||
|
@ -1,5 +1,10 @@
|
||||
package com.iluwatar;
|
||||
|
||||
/**
|
||||
*
|
||||
* State interface.
|
||||
*
|
||||
*/
|
||||
public interface State {
|
||||
|
||||
void onEnterState();
|
||||
|
Reference in New Issue
Block a user