# HG changeset patch # User tatsuki # Date 1481556329 -32400 # Node ID 6167451e8d356729afc5a6359974a9725ddb4464 # Parent cac88cf813f15387b16071f64f62f07520e43353 add DifferenceTreeContext add new field variable to TreeContext diff -r cac88cf813f1 -r 6167451e8d35 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/TreeContext.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/TreeContext.java Tue Dec 13 00:00:18 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/TreeContext.java Tue Dec 13 00:25:29 2016 +0900 @@ -12,6 +12,8 @@ public interface TreeContext { public TreeNode getRoot(); + public TreeNode getUnDefineNode(); + public TreeContext prev(); public ChangeList getChangeList(); diff -r cac88cf813f1 -r 6167451e8d35 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/DefaultTreeContext.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/DefaultTreeContext.java Tue Dec 13 00:00:18 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/DefaultTreeContext.java Tue Dec 13 00:25:29 2016 +0900 @@ -36,6 +36,11 @@ } @Override + public TreeNode getUnDefineNode(){ + return null; // no use + } + + @Override public TreeContext prev() { return previous; } diff -r cac88cf813f1 -r 6167451e8d35 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/DifferenceTreeContext.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/DifferenceTreeContext.java Tue Dec 13 00:25:29 2016 +0900 @@ -0,0 +1,91 @@ +package jp.ac.u_ryukyu.ie.cr.jungle.transaction; + +import jp.ac.u_ryukyu.ie.cr.jungle.data.list.List; +import jp.ac.u_ryukyu.ie.cr.jungle.data.treemap.TreeMap; +import jp.ac.u_ryukyu.ie.cr.jungle.persistent.ChangeList; +import jp.ac.u_ryukyu.ie.cr.jungle.store.TreeContext; +import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.store.index.ParentIndex; +import jp.ac.u_ryukyu.ie.cr.jungle.store.operations.TreeOperation; +import jp.ac.u_ryukyu.ie.cr.jungle.traverser.InterfaceTraverser; + +/** + * Created by e115731 on 2016/12/13. + */ +public class DifferenceTreeContext implements TreeContext { + private final TreeNode root; + private final TreeContext previous; + private final ChangeList changeList; + private final String uuid; + private final String treeName; + private final long revision; + private final InterfaceTraverser traverser; + private final TreeNode unDefineNode; + + public DifferenceTreeContext(TreeNode root, TreeNode unDefineNode, TreeContext _prev, ChangeList _log, String _uuid, String _treeName, long _revision, InterfaceTraverser traverser) { + this.root = root; + this.unDefineNode = unDefineNode; + this.previous = _prev; + this.changeList = _log; + this.uuid = _uuid; + this.treeName = _treeName; + this.revision = _revision; + this.traverser = traverser; + } + + + @Override + public TreeNode getRoot() { + return root; + } + + @Override + public TreeNode getUnDefineNode(){ + return unDefineNode; + } + + @Override + public TreeContext prev() { + return previous; + } + + @Override + public ChangeList getChangeList() { + return changeList; + } + + @Override + public String uuid() { + return uuid; + } + + @Override + public String getTreeName() { + return treeName; + } + + @Override + public long revision() { + return revision; + } + + @Override + public Iterable getOperations() { + return changeList; + } + + @Override + public TreeMap>> getIndex() { + return traverser.getIndex(); + } + + @Override + public ParentIndex getParentIndex() { + return traverser.getParentIndex(); + } + + @Override + public InterfaceTraverser getTraverser() { + return traverser; + } +} diff -r cac88cf813f1 -r 6167451e8d35 src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/persistent/PersistentTreeContext.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/persistent/PersistentTreeContext.java Tue Dec 13 00:00:18 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/persistent/PersistentTreeContext.java Tue Dec 13 00:25:29 2016 +0900 @@ -36,6 +36,11 @@ } @Override + public TreeNode getUnDefineNode() { + return null; // not use + } + + @Override public TreeContext prev() { return previous; }