提交 4debc8ed 编写于 作者: I Ilkka Seppala

Comments for state example.

上级 3bc005f4
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 )
......
package com.iluwatar;
/**
*
* Mammoth has internal state that defines its behavior.
*
*/
public class Mammoth {
private State state;
......
package com.iluwatar;
/**
*
* State interface.
*
*/
public interface State {
void onEnterState();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册