Mercurial > hg > Members > shoshi > jungle > jungle-core
changeset 264:6167451e8d35 Implementation_of_communication
add DifferenceTreeContext
add new field variable to TreeContext
author | tatsuki |
---|---|
date | Tue, 13 Dec 2016 00:25:29 +0900 |
parents | cac88cf813f1 |
children | b3a04bc21b23 |
files | src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/TreeContext.java src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/DefaultTreeContext.java src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/DifferenceTreeContext.java src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/persistent/PersistentTreeContext.java |
diffstat | 4 files changed, 103 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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();
--- 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; }
--- /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<TreeOperation> getOperations() { + return changeList; + } + + @Override + public TreeMap<String, TreeMap<String, List<TreeNode>>> getIndex() { + return traverser.getIndex(); + } + + @Override + public ParentIndex getParentIndex() { + return traverser.getParentIndex(); + } + + @Override + public InterfaceTraverser getTraverser() { + return traverser; + } +}
--- 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; }