提交 8ddcdac3 编写于 作者: I Ilkka Seppala

Comments for memento example.

上级 13306023
......@@ -2,6 +2,15 @@ package com.iluwatar;
import java.util.Stack;
/**
*
* Memento pattern is for storing and restoring object
* state. The object (Star) gives out a "memento"
* (StarMemento) that contains the state of the object.
* Later on the memento can be set back to the object
* restoring the state.
*
*/
public class App
{
public static void main( String[] args )
......
package com.iluwatar;
/**
*
* Star uses "mementos" to store and restore state.
*
*/
public class Star {
private StarType type;
......
package com.iluwatar;
/**
*
* External interface to memento.
*
*/
public interface StarMemento {
}
package com.iluwatar;
/**
*
* Internal interface to memento.
*
*/
public class StarMementoInternal implements StarMemento {
private StarType type;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册