86
|
1 package alice.jungle.persistence;
|
|
2
|
|
3 import java.util.Iterator;
|
|
4
|
|
5 import alice.jungle.operations.NetworkTreeOperationLog;
|
|
6
|
|
7 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.persistent.ChangeList;
|
87
|
8 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.logger.TreeOperationLog;
|
86
|
9 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.operations.TreeOperation;
|
|
10
|
|
11 public class PersistentChangeList implements ChangeList {
|
|
12
|
|
13 public NetworkTreeOperationLog log;
|
|
14 public String treeName;
|
|
15 public String uuid;
|
|
16
|
87
|
17 public PersistentChangeList(String _uuid, String _treeName, TreeOperationLog _log) {
|
|
18 uuid = _uuid;
|
|
19 treeName = _treeName;
|
|
20 log = new NetworkTreeOperationLog(_log);
|
|
21 }
|
|
22
|
86
|
23 public PersistentChangeList(NetworkTreeOperationLog _log) {
|
|
24 log = _log;
|
|
25 treeName = _log.getTreeName();
|
|
26 uuid = _log.getUUID();
|
|
27 }
|
|
28
|
|
29 public PersistentChangeList(PersistentChangeSet cs) {
|
|
30 treeName = cs.getTreeName();
|
|
31 uuid = cs.uuid();
|
|
32 log = new NetworkTreeOperationLog(cs.getChangeList());
|
|
33 }
|
|
34
|
|
35 @Override
|
|
36 public Iterator<TreeOperation> iterator() {
|
|
37 return log.iterator();
|
|
38 }
|
|
39
|
|
40 public NetworkTreeOperationLog getTreeOperationLog() {
|
|
41 return log;
|
|
42 }
|
|
43
|
|
44 public String getTreeName() {
|
|
45 return treeName;
|
|
46 }
|
|
47
|
87
|
48 public String uuid() {
|
86
|
49 return uuid;
|
|
50 }
|
|
51
|
|
52
|
|
53 }
|