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