Memento.java
上传用户:hensond
上传日期:2021-12-27
资源大小:817k
文件大小:1k
- package com.company.section7;
- import java.util.HashMap;
- /**
- * @author cbf4Life cbf4life@126.com
- * I'm glad to share my knowledge with you all.
- */
- public class Memento {
-
- //接受HashMap作为状态
- private HashMap<String,Object> stateMap;
-
- //接受一个对象,建立一个备份
- public Memento(HashMap<String,Object> map){
- this.stateMap = map;
- }
- public HashMap<String,Object> getStateMap() {
- return stateMap;
- }
- public void setStateMap(HashMap<String,Object> stateMap) {
- this.stateMap = stateMap;
- }
-
-
-
- }