# HG changeset patch # User tatsuki # Date 1481566572 -32400 # Node ID b3a04bc21b23049ea656e6d32046dc753876c822 # Parent 6167451e8d356729afc5a6359974a9725ddb4464 add UnDefineNode diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/benchMark/JungleBenchMark.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/benchMark/JungleBenchMark.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/benchMark/JungleBenchMark.java Tue Dec 13 03:16:12 2016 +0900 @@ -3,8 +3,8 @@ import jp.ac.u_ryukyu.ie.cr.jungle.DefaultJungle; import jp.ac.u_ryukyu.ie.cr.jungle.store.nodepath.NodePath; import jp.ac.u_ryukyu.ie.cr.jungle.store.nodepath.DefaultNodePath; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNodeAttributes; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNodeAttributes; import jp.ac.u_ryukyu.ie.cr.jungle.transaction.editor.jungleTreeEditor.JungleTreeEditor; import jp.ac.u_ryukyu.ie.cr.jungle.traverser.DefaultTraverser; import jp.ac.u_ryukyu.ie.cr.jungle.traverser.InterfaceTraverser; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/DefaultJungle.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/DefaultJungle.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/DefaultJungle.java Tue Dec 13 03:16:12 2016 +0900 @@ -10,12 +10,12 @@ import jp.ac.u_ryukyu.ie.cr.jungle.transaction.editor.treeEditor.TreeEditor; import jp.ac.u_ryukyu.ie.cr.jungle.store.nodepath.DefaultNodePath; import jp.ac.u_ryukyu.ie.cr.jungle.transaction.editor.treeEditor.DefaultTreeEditor; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.DefaultTreeOperationLog; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.TreeOperationLog; import jp.ac.u_ryukyu.ie.cr.jungle.store.operations.TreeOperation; import jp.ac.u_ryukyu.ie.cr.jungle.transaction.DefaultTreeContext; -import jp.ac.u_ryukyu.ie.cr.jungle.transaction.DefaultTreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.DefaultTreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.transaction.editor.jungleTreeEditor.JungleTreeEditor; import jp.ac.u_ryukyu.ie.cr.jungle.traverser.DefaultTraverser; import jp.ac.u_ryukyu.ie.cr.jungle.traverser.InterfaceTraverser; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/Jungle.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/Jungle.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/Jungle.java Tue Dec 13 03:16:12 2016 +0900 @@ -1,7 +1,7 @@ package jp.ac.u_ryukyu.ie.cr.jungle; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.tree.JungleTree; import java.util.Iterator; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/commandline/commandline.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/commandline/commandline.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/commandline/commandline.java Tue Dec 13 03:16:12 2016 +0900 @@ -4,7 +4,7 @@ import jp.ac.u_ryukyu.ie.cr.jungle.Jungle; import jp.ac.u_ryukyu.ie.cr.jungle.store.nodepath.NodePath; import jp.ac.u_ryukyu.ie.cr.jungle.store.nodepath.DefaultNodePath; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.omnigraffle.OmniGraffleCreater; import jp.ac.u_ryukyu.ie.cr.jungle.transaction.editor.jungleTreeEditor.JungleTreeEditor; import jp.ac.u_ryukyu.ie.cr.jungle.traverser.DefaultTraverser; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/core/App.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/core/App.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/core/App.java Tue Dec 13 03:16:12 2016 +0900 @@ -2,7 +2,7 @@ import jp.ac.u_ryukyu.ie.cr.jungle.DefaultJungle; import jp.ac.u_ryukyu.ie.cr.jungle.store.nodepath.DefaultNodePath; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.transaction.editor.jungleTreeEditor.JungleTreeEditor; import jp.ac.u_ryukyu.ie.cr.jungle.traverser.DefaultTraverser; import jp.ac.u_ryukyu.ie.cr.jungle.tree.JungleTree; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/core/Children.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/core/Children.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/core/Children.java Tue Dec 13 03:16:12 2016 +0900 @@ -1,6 +1,6 @@ package jp.ac.u_ryukyu.ie.cr.jungle.core; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/data/list/List.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/data/list/List.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/data/list/List.java Tue Dec 13 03:16:12 2016 +0900 @@ -42,11 +42,11 @@ } - public T index(int num) { + public T get(int index) { int count = 0; Node currentNode = head.getNext(); while (currentNode != null) { - if (count == num) return currentNode.getAttribute(); + if (count == index) return currentNode.getAttribute(); currentNode = currentNode.getNext(); count++; } @@ -106,11 +106,11 @@ } public T tail() { - return index(length() - 1); + return get(length() - 1); } public T head() { - return index(0); + return get(0); } public List deleteLast() { diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/query/JungleNodeIterator.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/query/JungleNodeIterator.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/query/JungleNodeIterator.java Tue Dec 13 03:16:12 2016 +0900 @@ -1,7 +1,7 @@ package jp.ac.u_ryukyu.ie.cr.jungle.query; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNodeChildren; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNodeChildren; import java.util.Iterator; import java.util.Stack; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/query/Query.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/query/Query.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/query/Query.java Tue Dec 13 03:16:12 2016 +0900 @@ -1,6 +1,6 @@ package jp.ac.u_ryukyu.ie.cr.jungle.query; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; public interface Query { boolean condition(TreeNode node); diff -r 6167451e8d35 -r b3a04bc21b23 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:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/TreeContext.java Tue Dec 13 03:16:12 2016 +0900 @@ -3,7 +3,7 @@ import jp.ac.u_ryukyu.ie.cr.jungle.data.list.List; import jp.ac.u_ryukyu.ie.cr.jungle.persistent.ChangeList; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.operations.TreeOperation; import jp.ac.u_ryukyu.ie.cr.jungle.traverser.InterfaceTraverser; import jp.ac.u_ryukyu.ie.cr.jungle.store.index.ParentIndex; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/impl/TreeNode.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/impl/TreeNode.java Tue Dec 13 00:25:29 2016 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -package jp.ac.u_ryukyu.ie.cr.jungle.store.impl; - -import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; -import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; - - -public interface TreeNode extends Comparable { - public TreeNodeChildren getChildren(); - - public TreeNodeAttributes getAttributes(); - - public TreeNode createNewNode(); - - public Either appendRootNode(); -} diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/impl/TreeNodeAttributes.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/impl/TreeNodeAttributes.java Tue Dec 13 00:25:29 2016 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -package jp.ac.u_ryukyu.ie.cr.jungle.store.impl; - -import jp.ac.u_ryukyu.ie.cr.jungle.core.Attributes; -import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; -import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; -import jp.ac.u_ryukyu.ie.cr.jungle.data.treemap.TreeMap; - -import java.nio.ByteBuffer; -import java.util.Iterator; - -public interface TreeNodeAttributes extends Attributes -{ - public Either delete(String key); - public Either put(String key,ByteBuffer value); - public TreeMap getAttributesAsRawMap(); - public Iterator getKeys(); - public boolean contain(String key); - public Iterator getFilteringKey(java.util.List filter); -} diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/impl/TreeNodeChildren.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/impl/TreeNodeChildren.java Tue Dec 13 00:25:29 2016 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ -package jp.ac.u_ryukyu.ie.cr.jungle.store.impl; - -import jp.ac.u_ryukyu.ie.cr.jungle.core.Children; -import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; -import jp.ac.u_ryukyu.ie.cr.jungle.data.list.List; -import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; - -public interface TreeNodeChildren extends Children -{ - public Either addNewChildAt(int pos); - public Either deleteChildAt(int pos); - public Either addNewChildAt(int pos,TreeNode newChild); - public Either replaceNode(int pos,TreeNode replacement); - Either moveChild(int pos, String move); - public List getChildrenAsRawList(); -} \ No newline at end of file diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/index/IndexCreater.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/index/IndexCreater.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/index/IndexCreater.java Tue Dec 13 03:16:12 2016 +0900 @@ -2,8 +2,8 @@ import jp.ac.u_ryukyu.ie.cr.jungle.data.list.List; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNodeChildren; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNodeChildren; import jp.ac.u_ryukyu.ie.cr.jungle.data.treemap.TreeMap; import java.util.Iterator; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/index/ParentIndex.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/index/ParentIndex.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/index/ParentIndex.java Tue Dec 13 03:16:12 2016 +0900 @@ -1,8 +1,8 @@ package jp.ac.u_ryukyu.ie.cr.jungle.store.index; import jp.ac.u_ryukyu.ie.cr.jungle.data.treemap.TreeMap; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNodeChildren; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNodeChildren; import java.util.Iterator; import java.util.Optional; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/logger/LoggingAttributes.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/logger/LoggingAttributes.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/logger/LoggingAttributes.java Tue Dec 13 03:16:12 2016 +0900 @@ -1,7 +1,7 @@ package jp.ac.u_ryukyu.ie.cr.jungle.store.logger; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNodeAttributes; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNodeAttributes; import jp.ac.u_ryukyu.ie.cr.jungle.store.operations.DeleteAttributeOperation; import jp.ac.u_ryukyu.ie.cr.jungle.store.operations.NodeOperation; import jp.ac.u_ryukyu.ie.cr.jungle.store.operations.PutAttributeOperation; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/logger/LoggingChildren.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/logger/LoggingChildren.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/logger/LoggingChildren.java Tue Dec 13 03:16:12 2016 +0900 @@ -2,7 +2,7 @@ import jp.ac.u_ryukyu.ie.cr.jungle.core.Children; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.operations.AppendChildAtOperation; import jp.ac.u_ryukyu.ie.cr.jungle.store.operations.ChildMoveOperation; import jp.ac.u_ryukyu.ie.cr.jungle.store.operations.DeleteChildAtOperation; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/logger/LoggingNode.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/logger/LoggingNode.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/logger/LoggingNode.java Tue Dec 13 03:16:12 2016 +0900 @@ -2,7 +2,7 @@ import jp.ac.u_ryukyu.ie.cr.jungle.store.operations.NodeOperation; import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.operations.ReplaceRootNodeOperation; import jp.ac.u_ryukyu.ie.cr.jungle.util.DefaultEither; import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/nodepath/DefaultNodePath.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/nodepath/DefaultNodePath.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/nodepath/DefaultNodePath.java Tue Dec 13 03:16:12 2016 +0900 @@ -52,6 +52,11 @@ } @Override + public int get(int index) { + return path.get(index); + } + + @Override public DefaultNodePath add(int pos) { List newPath = path.addLast(pos); return new DefaultNodePath(newPath); diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/nodepath/NodePath.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/nodepath/NodePath.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/nodepath/NodePath.java Tue Dec 13 03:16:12 2016 +0900 @@ -4,6 +4,7 @@ public interface NodePath extends Iterable { + public int get(int index); public NodePath add(int pos); public Pair pop(); public NodePath tail(); diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/omnigraffle/InsertNodePositionData.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/omnigraffle/InsertNodePositionData.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/omnigraffle/InsertNodePositionData.java Tue Dec 13 03:16:12 2016 +0900 @@ -2,8 +2,8 @@ import jp.ac.u_ryukyu.ie.cr.jungle.tree.JungleTree; import jp.ac.u_ryukyu.ie.cr.jungle.query.JungleNodeIterator; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNodeChildren; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNodeChildren; import jp.ac.u_ryukyu.ie.cr.jungle.store.index.ParentIndex; import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/omnigraffle/OmniGraffleCreater.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/omnigraffle/OmniGraffleCreater.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/omnigraffle/OmniGraffleCreater.java Tue Dec 13 03:16:12 2016 +0900 @@ -2,9 +2,9 @@ import jp.ac.u_ryukyu.ie.cr.jungle.tree.JungleTree; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNodeAttributes; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNodeChildren; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNodeAttributes; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNodeChildren; import jp.ac.u_ryukyu.ie.cr.jungle.util.Pair; import org.w3c.dom.DOMImplementation; import org.w3c.dom.Document; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/operations/AppendChildAtOperation.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/operations/AppendChildAtOperation.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/operations/AppendChildAtOperation.java Tue Dec 13 03:16:12 2016 +0900 @@ -4,7 +4,7 @@ import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; import jp.ac.u_ryukyu.ie.cr.jungle.store.Command; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/operations/ChildMoveOperation.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/operations/ChildMoveOperation.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/operations/ChildMoveOperation.java Tue Dec 13 03:16:12 2016 +0900 @@ -1,7 +1,7 @@ package jp.ac.u_ryukyu.ie.cr.jungle.store.operations; import jp.ac.u_ryukyu.ie.cr.jungle.store.Command; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/operations/DeleteAttributeOperation.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/operations/DeleteAttributeOperation.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/operations/DeleteAttributeOperation.java Tue Dec 13 03:16:12 2016 +0900 @@ -3,7 +3,7 @@ import java.nio.ByteBuffer; import jp.ac.u_ryukyu.ie.cr.jungle.store.Command; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/operations/DeleteChildAtOperation.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/operations/DeleteChildAtOperation.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/operations/DeleteChildAtOperation.java Tue Dec 13 03:16:12 2016 +0900 @@ -3,7 +3,7 @@ import java.nio.ByteBuffer; import jp.ac.u_ryukyu.ie.cr.jungle.store.Command; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/operations/NodeOperation.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/operations/NodeOperation.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/operations/NodeOperation.java Tue Dec 13 03:16:12 2016 +0900 @@ -3,7 +3,7 @@ import java.nio.ByteBuffer; import jp.ac.u_ryukyu.ie.cr.jungle.store.Command; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/operations/PutAttributeOperation.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/operations/PutAttributeOperation.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/operations/PutAttributeOperation.java Tue Dec 13 03:16:12 2016 +0900 @@ -4,7 +4,7 @@ import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; import jp.ac.u_ryukyu.ie.cr.jungle.store.Command; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/operations/ReplaceRootNodeOperation.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/operations/ReplaceRootNodeOperation.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/operations/ReplaceRootNodeOperation.java Tue Dec 13 03:16:12 2016 +0900 @@ -4,7 +4,7 @@ import jp.ac.u_ryukyu.ie.cr.jungle.store.Command; import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; public class ReplaceRootNodeOperation implements NodeOperation { diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/trasnformer/AppendChildAt.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/trasnformer/AppendChildAt.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/trasnformer/AppendChildAt.java Tue Dec 13 03:16:12 2016 +0900 @@ -1,6 +1,6 @@ package jp.ac.u_ryukyu.ie.cr.jungle.store.trasnformer; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.LoggingNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.OperationLog; import jp.ac.u_ryukyu.ie.cr.jungle.util.DefaultEither; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/trasnformer/DeleteAttribute.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/trasnformer/DeleteAttribute.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/trasnformer/DeleteAttribute.java Tue Dec 13 03:16:12 2016 +0900 @@ -2,7 +2,7 @@ import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.LoggingNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.OperationLog; import jp.ac.u_ryukyu.ie.cr.jungle.util.DefaultEither; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/trasnformer/DeleteChildAt.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/trasnformer/DeleteChildAt.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/trasnformer/DeleteChildAt.java Tue Dec 13 03:16:12 2016 +0900 @@ -4,7 +4,7 @@ import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.LoggingNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.OperationLog; import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.util.DefaultEither; import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/trasnformer/MoveChild.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/trasnformer/MoveChild.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/trasnformer/MoveChild.java Tue Dec 13 03:16:12 2016 +0900 @@ -1,7 +1,7 @@ package jp.ac.u_ryukyu.ie.cr.jungle.store.trasnformer; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.LoggingNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.OperationLog; import jp.ac.u_ryukyu.ie.cr.jungle.util.DefaultEither; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/trasnformer/NodeEditor.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/trasnformer/NodeEditor.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/trasnformer/NodeEditor.java Tue Dec 13 03:16:12 2016 +0900 @@ -2,7 +2,7 @@ import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.LoggingNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.OperationLog; import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/trasnformer/PutAttribute.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/trasnformer/PutAttribute.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/trasnformer/PutAttribute.java Tue Dec 13 03:16:12 2016 +0900 @@ -2,7 +2,7 @@ import java.nio.ByteBuffer; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.LoggingNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.OperationLog; import jp.ac.u_ryukyu.ie.cr.jungle.util.DefaultEither; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/trasnformer/replaceRootNodeAt.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/trasnformer/replaceRootNodeAt.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/trasnformer/replaceRootNodeAt.java Tue Dec 13 03:16:12 2016 +0900 @@ -3,7 +3,7 @@ import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.LoggingNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.OperationLog; import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.util.DefaultEither; import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/DefaultTransactionManager.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/DefaultTransactionManager.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/DefaultTransactionManager.java Tue Dec 13 03:16:12 2016 +0900 @@ -6,7 +6,7 @@ import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.TreeOperationLog; import jp.ac.u_ryukyu.ie.cr.jungle.store.operations.TreeOperation; import jp.ac.u_ryukyu.ie.cr.jungle.persistent.ChangeList; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.traverser.InterfaceTraverser; import jp.ac.u_ryukyu.ie.cr.jungle.util.DefaultEither; import jp.ac.u_ryukyu.ie.cr.jungle.util.DefaultError; diff -r 6167451e8d35 -r b3a04bc21b23 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:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/DefaultTreeContext.java Tue Dec 13 03:16:12 2016 +0900 @@ -4,7 +4,7 @@ import jp.ac.u_ryukyu.ie.cr.jungle.data.list.List; 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.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.operations.TreeOperation; import jp.ac.u_ryukyu.ie.cr.jungle.traverser.InterfaceTraverser; import jp.ac.u_ryukyu.ie.cr.jungle.store.index.ParentIndex; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/DefaultTreeNode.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/DefaultTreeNode.java Tue Dec 13 00:25:29 2016 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -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.store.impl.TreeNode; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNodeChildren; -import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; -import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; -import jp.ac.u_ryukyu.ie.cr.jungle.data.treemap.TreeMap; - -import java.nio.ByteBuffer; -import java.rmi.dgc.VMID; - -public class DefaultTreeNode implements TreeNode { - private List children; - private TreeMap attrs; - final String nodeId = new VMID().toString(); - - private static final List NIL_LIST = new List<>(); - - public DefaultTreeNode() { - this(NIL_LIST, new TreeMap<>()); - } - - public DefaultTreeNode(List _children, TreeMap _attrs) { - attrs = _attrs; - children = _children; - } - - @Override - public DefaultTreeNodeChildren getChildren() { - return new DefaultTreeNodeChildren(children, attrs); - } - - @Override - public DefaultTreeNodeAttribute getAttributes() { - return new DefaultTreeNodeAttribute(children, attrs); - } - - @Override - public DefaultTreeNode createNewNode() { - return new DefaultTreeNode(); - } - - public DefaultTreeNode clone() { - return new DefaultTreeNode(children, attrs); - } - - @Override - public Either appendRootNode() { - TreeNodeChildren newRootChildren = new DefaultTreeNodeChildren(NIL_LIST, new TreeMap<>()); - Either either = newRootChildren.addNewChildAt(0,this); - return either; - } - - @Override - public int compareTo(TreeNode o) { - return this.hashCode() - o.hashCode(); - } -} diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/DefaultTreeNodeAttribute.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/DefaultTreeNodeAttribute.java Tue Dec 13 00:25:29 2016 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,118 +0,0 @@ -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.store.impl.TreeNode; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNodeAttributes; -import jp.ac.u_ryukyu.ie.cr.jungle.store.trasnformer.NodeEditorError; -import jp.ac.u_ryukyu.ie.cr.jungle.util.DefaultEither; -import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; -import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; -import jp.ac.u_ryukyu.ie.cr.jungle.data.treemap.TreeMap; - -import java.nio.ByteBuffer; -import java.util.Iterator; -import java.util.Optional; - -public class DefaultTreeNodeAttribute implements TreeNodeAttributes { - public List children; - public TreeMap attrs; - - - public DefaultTreeNodeAttribute(List _children, TreeMap _attrs) { - children = _children; - attrs = _attrs; - } - - @Override - public TreeMap getAttributesAsRawMap() { - return attrs; - } - - @Override - public Either delete(String _key) { - if (_key == null) { - return DefaultEither.newA(NodeEditorError.NULL_VALUE_NOT_ALLOWED); - } - - if (null == attrs.get(_key)) { - return DefaultEither.newA(NodeEditorError.DELETE_KEY_NOT_FOUND); - } - - TreeMap newMap = attrs.delete(_key); - TreeNode newNode = new DefaultTreeNode(children, newMap); - return DefaultEither.newB(newNode); - } - - @Override - public Either put(String _key, ByteBuffer _value) { - if (_key == null || _value == null) { - return DefaultEither.newA(NodeEditorError.NULL_VALUE_NOT_ALLOWED); - } - - TreeMap newMap = attrs.put(_key, _value); - TreeNode newNode = new DefaultTreeNode(children, newMap); - return DefaultEither.newB(newNode); - } - - @Override - public ByteBuffer get(String _key) { - if (_key == null) { - return null; - } - Optional op = attrs.get(_key); - if (op.isPresent()) { - return op.get(); - } - return null; - } - - @Override - public String getString(String key) { - ByteBuffer attribute = get(key); - if (attribute != null) - return new String(attribute.array()); - return null; - } - - @Override - public Iterator getKeys() { - return attrs.keys(); - } - - @Override - public Iterator getFilteringKey(java.util.List filter) { - - return new Iterator() { - private Iterator keys = attrs.keys(); - private String next = init(); - - private String init() { - while (keys.hasNext()) { - String key = keys.next(); - if (filter.contains(key)) - continue; - return key; - } - return null; - } - - @Override - public boolean hasNext() { - return next != null; - } - - @Override - public String next() { - String tmp = next; - next = init(); - return tmp; - } - }; - } - - - @Override - public boolean contain(String key) { - return attrs.get(key) != null; - } -} diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/DefaultTreeNodeChildren.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/DefaultTreeNodeChildren.java Tue Dec 13 00:25:29 2016 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,127 +0,0 @@ -package jp.ac.u_ryukyu.ie.cr.jungle.transaction; - - -import jp.ac.u_ryukyu.ie.cr.jungle.store.trasnformer.NodeEditorError; -import jp.ac.u_ryukyu.ie.cr.jungle.util.DefaultError; -import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; -import jp.ac.u_ryukyu.ie.cr.jungle.data.list.List; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNodeChildren; -import jp.ac.u_ryukyu.ie.cr.jungle.util.DefaultEither; -import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; -import jp.ac.u_ryukyu.ie.cr.jungle.data.treemap.TreeMap; - -import java.nio.ByteBuffer; -import java.util.Iterator; - -public class DefaultTreeNodeChildren implements TreeNodeChildren { - - public List children; - public TreeMap attrs; - - public DefaultTreeNodeChildren(List _children, TreeMap _attrs) { - children = _children; - attrs = _attrs; - } - - private boolean boundaryCheck(int _pos) { - int size = children.length(); - if (size < _pos) { - return false; - } - - return true; - } - - @Override - public List getChildrenAsRawList() { - return children; - } - - @Override - public Either addNewChildAt(int _pos) { - if (!boundaryCheck(_pos) || _pos < 0) { - return DefaultEither.newA(NodeEditorError.INDEX_OUT_OF_BOUNDS); - } - - List newChildren = children.add(_pos, new DefaultTreeNode()); - TreeNode newNode = new DefaultTreeNode(newChildren, attrs); - return DefaultEither.newB(newNode); - } - - @Override - public Either deleteChildAt(int _pos) { - if (!boundaryCheck(_pos) || _pos < 0 || size() == 0) { - return DefaultEither.newA(NodeEditorError.INDEX_OUT_OF_BOUNDS); - } - - List newChildren = children.delete(_pos); - TreeNode newNode = new DefaultTreeNode(newChildren, attrs); - - return DefaultEither.newB(newNode); - } - - @Override - public int size() { - return children.length(); - } - - @Override - public Iterator iterator() { - return children.iterator(); - } - - @Override - public Either replaceNode(int _pos, TreeNode _replacement) { - int size = children.length(); - if (!(0 <= _pos && _pos < size)) { - return DefaultEither.newA(NodeEditorError.INDEX_OUT_OF_BOUNDS); - } - TreeNode replacement = _replacement; - - List newChildren = children.replace(_pos, replacement); - TreeNode node = new DefaultTreeNode(newChildren, attrs); - return DefaultEither.newB(node); - } - - @Override - public Either moveChild(int pos, String move) { - int size = children.length(); - TreeNode child = children.index(pos); - List newChildren; - if (move.equals("up") && pos != 0) { - children = children.delete(pos); - newChildren = children.add((pos - 1), child); - } else if (move.equals("down") && pos < size - 1) { //sizeは0から始まるため -1する - children = children.delete(pos); - newChildren = children.add((pos + 1), child); - } else { - return DefaultEither.newA(new DefaultError()); - } - TreeNode newNode = new DefaultTreeNode(newChildren, attrs); - return DefaultEither.newB(newNode); - } - - @Override - public Either at(int _pos) { - if (children.length() < _pos + 1) { - return DefaultEither.newA(NodeEditorError.INDEX_OUT_OF_BOUNDS); - } - - TreeNode Node = children.index(_pos); - - return DefaultEither.newB(Node); - } - - @Override - public Either addNewChildAt(int _pos, TreeNode _newChild) { - if (!boundaryCheck(_pos) || _pos < 0) { - return DefaultEither.newA(NodeEditorError.INDEX_OUT_OF_BOUNDS); - } - List newChildren = children.add(_pos, _newChild); - TreeNode newNode = new DefaultTreeNode(newChildren, attrs); - - return DefaultEither.newB(newNode); - } - -} diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/DifferenceTreeContext.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/DifferenceTreeContext.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/DifferenceTreeContext.java Tue Dec 13 03:16:12 2016 +0900 @@ -4,7 +4,7 @@ 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.transaction.node.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; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/TransactionManager.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/TransactionManager.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/TransactionManager.java Tue Dec 13 03:16:12 2016 +0900 @@ -3,7 +3,7 @@ import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.TreeOperationLog; import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; public interface TransactionManager diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/editor/jungleTreeEditor/DefaultDifferenceJungleTreeEditor.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/editor/jungleTreeEditor/DefaultDifferenceJungleTreeEditor.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/editor/jungleTreeEditor/DefaultDifferenceJungleTreeEditor.java Tue Dec 13 03:16:12 2016 +0900 @@ -1,10 +1,14 @@ package jp.ac.u_ryukyu.ie.cr.jungle.transaction.editor.jungleTreeEditor; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.DefaultTreeOperationLog; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.LoggingNode; +import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.OperationLog; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.TreeOperationLog; import jp.ac.u_ryukyu.ie.cr.jungle.store.nodepath.NodePath; +import jp.ac.u_ryukyu.ie.cr.jungle.store.operations.DefaultTreeOperation; +import jp.ac.u_ryukyu.ie.cr.jungle.store.operations.NodeOperation; +import jp.ac.u_ryukyu.ie.cr.jungle.store.operations.TreeOperation; import jp.ac.u_ryukyu.ie.cr.jungle.store.trasnformer.AppendChildAt; import jp.ac.u_ryukyu.ie.cr.jungle.store.trasnformer.NodeEditor; import jp.ac.u_ryukyu.ie.cr.jungle.transaction.TransactionManager; @@ -12,6 +16,7 @@ import jp.ac.u_ryukyu.ie.cr.jungle.util.DefaultEither; import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; +import jp.ac.u_ryukyu.ie.cr.jungle.util.IterableConverter; import java.nio.ByteBuffer; @@ -41,7 +46,27 @@ private Either _edit(final NodePath _path, NodeEditor _e) { Either either = editor.edit(root, _path, _e); - return null; + if(either.isA()){ + return DefaultEither.newA(either.a()); + } + + LoggingNode newLogging = either.b(); + OperationLog newLog = newLogging.getOperationLog(); + TreeNode newNode = newLogging.getWrap(); + + IterableConverter.Converter converter = new IterableConverter.Converter(){ + @Override + public TreeOperation conv(NodeOperation _b){ + return new DefaultTreeOperation(_path,_b); + } + }; + + Iterable iterable = new IterableConverter<>(newLog,converter); + DefaultTreeOperationLog treeOperationLog = new DefaultTreeOperationLog(iterable,newLog.length()); + TreeOperationLog newTreeOpLog = log.append(treeOperationLog); + + JungleTreeEditor newEditor = new DefaultDifferenceJungleTreeEditor(newNode,txManager,editor,newTreeOpLog); + return DefaultEither.newB(newEditor); } diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/editor/jungleTreeEditor/DefaultJungleTreeEditor.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/editor/jungleTreeEditor/DefaultJungleTreeEditor.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/editor/jungleTreeEditor/DefaultJungleTreeEditor.java Tue Dec 13 03:16:12 2016 +0900 @@ -2,7 +2,7 @@ import jp.ac.u_ryukyu.ie.cr.jungle.store.nodepath.NodePath; import jp.ac.u_ryukyu.ie.cr.jungle.store.nodepath.DefaultNodePath; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.DefaultTreeOperationLog; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.LoggingNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.OperationLog; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/editor/treeEditor/DefaultDifferenceTreeEditor.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/editor/treeEditor/DefaultDifferenceTreeEditor.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/editor/treeEditor/DefaultDifferenceTreeEditor.java Tue Dec 13 03:16:12 2016 +0900 @@ -1,10 +1,13 @@ package jp.ac.u_ryukyu.ie.cr.jungle.transaction.editor.treeEditor; -import jp.ac.u_ryukyu.ie.cr.jungle.store.nodepath.NodePath; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.data.list.List; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNodeChildren; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.LoggingNode; +import jp.ac.u_ryukyu.ie.cr.jungle.store.nodepath.NodePath; import jp.ac.u_ryukyu.ie.cr.jungle.store.trasnformer.NodeEditor; -import jp.ac.u_ryukyu.ie.cr.jungle.traverser.Traverser; +import jp.ac.u_ryukyu.ie.cr.jungle.traverser.*; +import jp.ac.u_ryukyu.ie.cr.jungle.util.DefaultEither; import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; @@ -13,12 +16,65 @@ */ public class DefaultDifferenceTreeEditor implements TreeEditor { private Traverser traverser; + public DefaultDifferenceTreeEditor(Traverser traverser) { - this. traverser = traverser; + this.traverser = traverser; } @Override - public Either edit(TreeNode root, NodePath path, NodeEditor transformer) { - return null; + public Either edit(TreeNode root, NodePath path, NodeEditor editor) { + Evaluator evalutor ; + if (path.get(0) == -2) + evalutor = new LastNodeEvaluator(); + else + evalutor = new DefaultEvaluator(path); + Either either = traverser.traverse(root, evalutor); + + if (either.isA()) { + return DefaultEither.newA(either.a()); + } + Traversal t = either.b(); + return clone(t, editor); + } + + private Either clone(Traversal t, NodeEditor editor) { + // copying nodes from bottom to root + + List> path = new List<>(); + for (Direction direction : t) { + path = path.addLast(direction); + } + + // target + Direction targetDirection = path.head(); + TreeNode target = targetDirection.getTarget(); + Either either = editor.edit(target); + if (either.isA()) { + return DefaultEither.newA(either.a()); + } + + LoggingNode newWrap = either.b(); + + // top + int pos = targetDirection.getPosition(); + TreeNode child = newWrap.getWrap(); + + + for (Direction parentDirection : path.deleteHead()) { + + TreeNodeChildren chs = parentDirection.getTarget().getChildren(); + + Either ret = chs.replaceNode(pos, child); + if (ret.isA()) { + return DefaultEither.newA(ret.a()); + } + + child = ret.b(); + pos = parentDirection.getPosition(); + } + + TreeNode newRoot = child; + LoggingNode logNode = editor.wrap(newRoot, newWrap.getOperationLog()); + return DefaultEither.newB(logNode); } } diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/editor/treeEditor/DefaultTreeEditor.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/editor/treeEditor/DefaultTreeEditor.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/editor/treeEditor/DefaultTreeEditor.java Tue Dec 13 03:16:12 2016 +0900 @@ -3,8 +3,8 @@ import jp.ac.u_ryukyu.ie.cr.jungle.data.list.List; import jp.ac.u_ryukyu.ie.cr.jungle.store.nodepath.NodePath; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNodeChildren; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNodeChildren; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.LoggingNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.trasnformer.NodeEditor; import jp.ac.u_ryukyu.ie.cr.jungle.traverser.DefaultEvaluator; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/editor/treeEditor/TreeEditor.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/editor/treeEditor/TreeEditor.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/editor/treeEditor/TreeEditor.java Tue Dec 13 03:16:12 2016 +0900 @@ -2,7 +2,7 @@ import jp.ac.u_ryukyu.ie.cr.jungle.store.nodepath.NodePath; import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.LoggingNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.trasnformer.NodeEditor; import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/node/DefaultTreeNode.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/node/DefaultTreeNode.java Tue Dec 13 03:16:12 2016 +0900 @@ -0,0 +1,63 @@ +package jp.ac.u_ryukyu.ie.cr.jungle.transaction.node; + + +import jp.ac.u_ryukyu.ie.cr.jungle.data.list.List; +import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; +import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; +import jp.ac.u_ryukyu.ie.cr.jungle.data.treemap.TreeMap; + +import java.nio.ByteBuffer; +import java.rmi.dgc.VMID; + +public class DefaultTreeNode implements TreeNode { + private List children; + private TreeMap attrs; + final String nodeId = new VMID().toString(); + + private static final List NIL_LIST = new List<>(); + + public DefaultTreeNode() { + this(NIL_LIST, new TreeMap<>()); + } + + public DefaultTreeNode(List _children, TreeMap _attrs) { + attrs = _attrs; + children = _children; + } + + @Override + public DefaultTreeNodeChildren getChildren() { + return new DefaultTreeNodeChildren(children, attrs); + } + + @Override + public DefaultTreeNodeAttribute getAttributes() { + return new DefaultTreeNodeAttribute(children, attrs); + } + + @Override + public boolean isDefine() { + return false; + } + + @Override + public DefaultTreeNode createNewNode() { + return new DefaultTreeNode(); + } + + public DefaultTreeNode clone() { + return new DefaultTreeNode(children, attrs); + } + + @Override + public Either appendRootNode() { + TreeNodeChildren newRootChildren = new DefaultTreeNodeChildren(NIL_LIST, new TreeMap<>()); + Either either = newRootChildren.addNewChildAt(0,this); + return either; + } + + @Override + public int compareTo(TreeNode o) { + return this.hashCode() - o.hashCode(); + } +} diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/node/DefaultTreeNodeAttribute.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/node/DefaultTreeNodeAttribute.java Tue Dec 13 03:16:12 2016 +0900 @@ -0,0 +1,116 @@ +package jp.ac.u_ryukyu.ie.cr.jungle.transaction.node; + +import jp.ac.u_ryukyu.ie.cr.jungle.data.list.List; +import jp.ac.u_ryukyu.ie.cr.jungle.store.trasnformer.NodeEditorError; +import jp.ac.u_ryukyu.ie.cr.jungle.util.DefaultEither; +import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; +import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; +import jp.ac.u_ryukyu.ie.cr.jungle.data.treemap.TreeMap; + +import java.nio.ByteBuffer; +import java.util.Iterator; +import java.util.Optional; + +public class DefaultTreeNodeAttribute implements TreeNodeAttributes { + public List children; + public TreeMap attrs; + + + public DefaultTreeNodeAttribute(List _children, TreeMap _attrs) { + children = _children; + attrs = _attrs; + } + + @Override + public TreeMap getAttributesAsRawMap() { + return attrs; + } + + @Override + public Either delete(String _key) { + if (_key == null) { + return DefaultEither.newA(NodeEditorError.NULL_VALUE_NOT_ALLOWED); + } + + if (null == attrs.get(_key)) { + return DefaultEither.newA(NodeEditorError.DELETE_KEY_NOT_FOUND); + } + + TreeMap newMap = attrs.delete(_key); + TreeNode newNode = new DefaultTreeNode(children, newMap); + return DefaultEither.newB(newNode); + } + + @Override + public Either put(String _key, ByteBuffer _value) { + if (_key == null || _value == null) { + return DefaultEither.newA(NodeEditorError.NULL_VALUE_NOT_ALLOWED); + } + + TreeMap newMap = attrs.put(_key, _value); + TreeNode newNode = new DefaultTreeNode(children, newMap); + return DefaultEither.newB(newNode); + } + + @Override + public ByteBuffer get(String _key) { + if (_key == null) { + return null; + } + Optional op = attrs.get(_key); + if (op.isPresent()) { + return op.get(); + } + return null; + } + + @Override + public String getString(String key) { + ByteBuffer attribute = get(key); + if (attribute != null) + return new String(attribute.array()); + return null; + } + + @Override + public Iterator getKeys() { + return attrs.keys(); + } + + @Override + public Iterator getFilteringKey(java.util.List filter) { + + return new Iterator() { + private Iterator keys = attrs.keys(); + private String next = init(); + + private String init() { + while (keys.hasNext()) { + String key = keys.next(); + if (filter.contains(key)) + continue; + return key; + } + return null; + } + + @Override + public boolean hasNext() { + return next != null; + } + + @Override + public String next() { + String tmp = next; + next = init(); + return tmp; + } + }; + } + + + @Override + public boolean contain(String key) { + return attrs.get(key) != null; + } +} diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/node/DefaultTreeNodeChildren.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/node/DefaultTreeNodeChildren.java Tue Dec 13 03:16:12 2016 +0900 @@ -0,0 +1,125 @@ +package jp.ac.u_ryukyu.ie.cr.jungle.transaction.node; + + +import jp.ac.u_ryukyu.ie.cr.jungle.store.trasnformer.NodeEditorError; +import jp.ac.u_ryukyu.ie.cr.jungle.util.DefaultError; +import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; +import jp.ac.u_ryukyu.ie.cr.jungle.data.list.List; +import jp.ac.u_ryukyu.ie.cr.jungle.util.DefaultEither; +import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; +import jp.ac.u_ryukyu.ie.cr.jungle.data.treemap.TreeMap; + +import java.nio.ByteBuffer; +import java.util.Iterator; + +public class DefaultTreeNodeChildren implements TreeNodeChildren { + + public List children; + public TreeMap attrs; + + public DefaultTreeNodeChildren(List _children, TreeMap _attrs) { + children = _children; + attrs = _attrs; + } + + private boolean boundaryCheck(int _pos) { + int size = children.length(); + if (size < _pos) { + return false; + } + + return true; + } + + @Override + public List getChildrenAsRawList() { + return children; + } + + @Override + public Either addNewChildAt(int _pos) { + if (!boundaryCheck(_pos) || _pos < 0) { + return DefaultEither.newA(NodeEditorError.INDEX_OUT_OF_BOUNDS); + } + + List newChildren = children.add(_pos, new DefaultTreeNode()); + TreeNode newNode = new DefaultTreeNode(newChildren, attrs); + return DefaultEither.newB(newNode); + } + + @Override + public Either deleteChildAt(int _pos) { + if (!boundaryCheck(_pos) || _pos < 0 || size() == 0) { + return DefaultEither.newA(NodeEditorError.INDEX_OUT_OF_BOUNDS); + } + + List newChildren = children.delete(_pos); + TreeNode newNode = new DefaultTreeNode(newChildren, attrs); + + return DefaultEither.newB(newNode); + } + + @Override + public int size() { + return children.length(); + } + + @Override + public Iterator iterator() { + return children.iterator(); + } + + @Override + public Either replaceNode(int _pos, TreeNode _replacement) { + int size = children.length(); + if (!(0 <= _pos && _pos < size)) { + return DefaultEither.newA(NodeEditorError.INDEX_OUT_OF_BOUNDS); + } + TreeNode replacement = _replacement; + + List newChildren = children.replace(_pos, replacement); + TreeNode node = new DefaultTreeNode(newChildren, attrs); + return DefaultEither.newB(node); + } + + @Override + public Either moveChild(int pos, String move) { + int size = children.length(); + TreeNode child = children.get(pos); + List newChildren; + if (move.equals("up") && pos != 0) { + children = children.delete(pos); + newChildren = children.add((pos - 1), child); + } else if (move.equals("down") && pos < size - 1) { //sizeは0から始まるため -1する + children = children.delete(pos); + newChildren = children.add((pos + 1), child); + } else { + return DefaultEither.newA(new DefaultError()); + } + TreeNode newNode = new DefaultTreeNode(newChildren, attrs); + return DefaultEither.newB(newNode); + } + + @Override + public Either at(int _pos) { + if (children.length() < _pos + 1) { + return DefaultEither.newA(NodeEditorError.INDEX_OUT_OF_BOUNDS); + } + + TreeNode Node = children.get(_pos); + + return DefaultEither.newB(Node); + } + + @Override + public Either addNewChildAt(int _pos, TreeNode _newChild) { + if (!boundaryCheck(_pos) || _pos < 0) { + return DefaultEither.newA(NodeEditorError.INDEX_OUT_OF_BOUNDS); + } + List newChildren = children.add(_pos, _newChild); + TreeNode newNode = new DefaultTreeNode(newChildren, attrs); + + return DefaultEither.newB(newNode); + } + +} diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/node/TreeNode.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/node/TreeNode.java Tue Dec 13 03:16:12 2016 +0900 @@ -0,0 +1,17 @@ +package jp.ac.u_ryukyu.ie.cr.jungle.transaction.node; + +import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; +import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; + + +public interface TreeNode extends Comparable { + public TreeNodeChildren getChildren(); + + public TreeNodeAttributes getAttributes(); + + public boolean isDefine(); + + public TreeNode createNewNode(); + + public Either appendRootNode(); +} diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/node/TreeNodeAttributes.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/node/TreeNodeAttributes.java Tue Dec 13 03:16:12 2016 +0900 @@ -0,0 +1,19 @@ +package jp.ac.u_ryukyu.ie.cr.jungle.transaction.node; + +import jp.ac.u_ryukyu.ie.cr.jungle.core.Attributes; +import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; +import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; +import jp.ac.u_ryukyu.ie.cr.jungle.data.treemap.TreeMap; + +import java.nio.ByteBuffer; +import java.util.Iterator; + +public interface TreeNodeAttributes extends Attributes +{ + public Either delete(String key); + public Either put(String key,ByteBuffer value); + public TreeMap getAttributesAsRawMap(); + public Iterator getKeys(); + public boolean contain(String key); + public Iterator getFilteringKey(java.util.List filter); +} diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/node/TreeNodeChildren.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/node/TreeNodeChildren.java Tue Dec 13 03:16:12 2016 +0900 @@ -0,0 +1,16 @@ +package jp.ac.u_ryukyu.ie.cr.jungle.transaction.node; + +import jp.ac.u_ryukyu.ie.cr.jungle.core.Children; +import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; +import jp.ac.u_ryukyu.ie.cr.jungle.data.list.List; +import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; + +public interface TreeNodeChildren extends Children +{ + public Either addNewChildAt(int pos); + public Either deleteChildAt(int pos); + public Either addNewChildAt(int pos,TreeNode newChild); + public Either replaceNode(int pos,TreeNode replacement); + Either moveChild(int pos, String move); + public List getChildrenAsRawList(); +} \ No newline at end of file diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/node/UnDefineNode.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/transaction/node/UnDefineNode.java Tue Dec 13 03:16:12 2016 +0900 @@ -0,0 +1,65 @@ +package jp.ac.u_ryukyu.ie.cr.jungle.transaction.node; + +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.util.Either; +import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; + +import java.nio.ByteBuffer; +import java.rmi.dgc.VMID; + +/** + * Created by e115731 on 2016/12/13. + */ +public class UnDefineNode implements TreeNode { + private List children; + private TreeMap attrs; + final String nodeId = new VMID().toString(); + + private static final List NIL_LIST = new List<>(); + + public UnDefineNode() { + this(NIL_LIST, new TreeMap<>()); + } + + public UnDefineNode(List _children, TreeMap _attrs) { + attrs = _attrs; + children = _children; + } + + @Override + public DefaultTreeNodeChildren getChildren() { + return new DefaultTreeNodeChildren(children, attrs); + } + + @Override + public DefaultTreeNodeAttribute getAttributes() { + return new DefaultTreeNodeAttribute(children, attrs); + } + + @Override + public boolean isDefine() { + return false; + } + + @Override + public DefaultTreeNode createNewNode() { + return new DefaultTreeNode(); + } + + public DefaultTreeNode clone() { + return new DefaultTreeNode(children, attrs); + } + + @Override + public Either appendRootNode() { + TreeNodeChildren newRootChildren = new DefaultTreeNodeChildren(NIL_LIST, new TreeMap<>()); + Either either = newRootChildren.addNewChildAt(0,this); + return either; + } + + @Override + public int compareTo(TreeNode o) { + return this.hashCode() - o.hashCode(); + } +} diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/traverser/DefaultEvaluator.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/traverser/DefaultEvaluator.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/traverser/DefaultEvaluator.java Tue Dec 13 03:16:12 2016 +0900 @@ -2,7 +2,7 @@ import jp.ac.u_ryukyu.ie.cr.jungle.store.nodepath.NodePath; import jp.ac.u_ryukyu.ie.cr.jungle.util.Pair; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; public class DefaultEvaluator implements Evaluator { private final NodePath path; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/traverser/DefaultTraverser.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/traverser/DefaultTraverser.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/traverser/DefaultTraverser.java Tue Dec 13 03:16:12 2016 +0900 @@ -2,7 +2,7 @@ import jp.ac.u_ryukyu.ie.cr.jungle.data.list.List; import jp.ac.u_ryukyu.ie.cr.jungle.core.Children; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.trasnformer.NodeEditorError; import jp.ac.u_ryukyu.ie.cr.jungle.util.DefaultEither; import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/traverser/Evaluator.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/traverser/Evaluator.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/traverser/Evaluator.java Tue Dec 13 03:16:12 2016 +0900 @@ -1,6 +1,6 @@ package jp.ac.u_ryukyu.ie.cr.jungle.traverser; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; public interface Evaluator { diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/traverser/InterfaceTraverser.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/traverser/InterfaceTraverser.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/traverser/InterfaceTraverser.java Tue Dec 13 03:16:12 2016 +0900 @@ -1,7 +1,7 @@ package jp.ac.u_ryukyu.ie.cr.jungle.traverser; import jp.ac.u_ryukyu.ie.cr.jungle.store.NulIterator; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.data.list.List; import jp.ac.u_ryukyu.ie.cr.jungle.query.JungleNodeIterator; import jp.ac.u_ryukyu.ie.cr.jungle.query.Query; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/traverser/LastNodeEvaluator.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/traverser/LastNodeEvaluator.java Tue Dec 13 03:16:12 2016 +0900 @@ -0,0 +1,13 @@ +package jp.ac.u_ryukyu.ie.cr.jungle.traverser; + + +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; + +public class LastNodeEvaluator implements Evaluator { + + @Override + public Evaluation evaluate(TreeNode _current, int _pos) { + + return null; + } +} diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/traverser/Traversal.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/traverser/Traversal.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/traverser/Traversal.java Tue Dec 13 03:16:12 2016 +0900 @@ -1,6 +1,6 @@ package jp.ac.u_ryukyu.ie.cr.jungle.traverser; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; public interface Traversal extends Iterable> { diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/traverser/Traverser.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/traverser/Traverser.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/traverser/Traverser.java Tue Dec 13 03:16:12 2016 +0900 @@ -1,6 +1,6 @@ package jp.ac.u_ryukyu.ie.cr.jungle.traverser; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/tree/DefaultJungleTree.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/tree/DefaultJungleTree.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/tree/DefaultJungleTree.java Tue Dec 13 03:16:12 2016 +0900 @@ -8,8 +8,8 @@ import jp.ac.u_ryukyu.ie.cr.jungle.store.TreeContext; import jp.ac.u_ryukyu.ie.cr.jungle.transaction.editor.treeEditor.TreeEditor; import jp.ac.u_ryukyu.ie.cr.jungle.store.nodepath.DefaultNodePath; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNodeChildren; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNodeChildren; import jp.ac.u_ryukyu.ie.cr.jungle.store.index.ParentIndex; import jp.ac.u_ryukyu.ie.cr.jungle.transaction.editor.jungleTreeEditor.DefaultJungleTreeEditor; import jp.ac.u_ryukyu.ie.cr.jungle.transaction.DefaultTransactionManager; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/tree/DefferenceListJungleTree.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/tree/DefferenceListJungleTree.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/tree/DefferenceListJungleTree.java Tue Dec 13 03:16:12 2016 +0900 @@ -3,7 +3,7 @@ import jp.ac.u_ryukyu.ie.cr.jungle.persistent.ChangeListWriter; 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.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.transaction.DefaultTransactionManager; import jp.ac.u_ryukyu.ie.cr.jungle.transaction.editor.jungleTreeEditor.DefaultDifferenceJungleTreeEditor; import jp.ac.u_ryukyu.ie.cr.jungle.transaction.editor.jungleTreeEditor.JungleTreeEditor; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/tree/JungleTree.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/tree/JungleTree.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/tree/JungleTree.java Tue Dec 13 03:16:12 2016 +0900 @@ -4,7 +4,7 @@ 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.store.nodepath.NodePath; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.index.ParentIndex; import jp.ac.u_ryukyu.ie.cr.jungle.transaction.editor.jungleTreeEditor.JungleTreeEditor; import jp.ac.u_ryukyu.ie.cr.jungle.traverser.InterfaceTraverser; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/core/NetworkDefaultJungle.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/core/NetworkDefaultJungle.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/core/NetworkDefaultJungle.java Tue Dec 13 03:16:12 2016 +0900 @@ -8,12 +8,12 @@ import jp.ac.u_ryukyu.ie.cr.jungle.persistent.Journal; import jp.ac.u_ryukyu.ie.cr.jungle.store.TreeContext; import jp.ac.u_ryukyu.ie.cr.jungle.transaction.editor.treeEditor.TreeEditor; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.DefaultTreeOperationLog; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.TreeOperationLog; import jp.ac.u_ryukyu.ie.cr.jungle.store.operations.TreeOperation; import jp.ac.u_ryukyu.ie.cr.jungle.transaction.DefaultTreeContext; -import jp.ac.u_ryukyu.ie.cr.jungle.transaction.DefaultTreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.DefaultTreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.traverser.InterfaceTraverser; import jp.ac.u_ryukyu.ie.cr.jungleNetwork.transaction.NetworkDefaultJungleTree; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/operations/NetworkAppendChildAtOperation.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/operations/NetworkAppendChildAtOperation.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/operations/NetworkAppendChildAtOperation.java Tue Dec 13 03:16:12 2016 +0900 @@ -2,7 +2,7 @@ import jp.ac.u_ryukyu.ie.cr.jungle.store.Command; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.operations.NodeOperation; import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/operations/NetworkDeleteAttributeOperation.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/operations/NetworkDeleteAttributeOperation.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/operations/NetworkDeleteAttributeOperation.java Tue Dec 13 03:16:12 2016 +0900 @@ -2,7 +2,7 @@ import jp.ac.u_ryukyu.ie.cr.jungle.store.Command; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.operations.NodeOperation; import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/operations/NetworkDeleteChildAtOperation.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/operations/NetworkDeleteChildAtOperation.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/operations/NetworkDeleteChildAtOperation.java Tue Dec 13 03:16:12 2016 +0900 @@ -1,7 +1,7 @@ package jp.ac.u_ryukyu.ie.cr.jungleNetwork.operations; import jp.ac.u_ryukyu.ie.cr.jungle.store.Command; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.operations.NodeOperation; import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/operations/NetworkNodeOperation.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/operations/NetworkNodeOperation.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/operations/NetworkNodeOperation.java Tue Dec 13 03:16:12 2016 +0900 @@ -2,7 +2,7 @@ import jp.ac.u_ryukyu.ie.cr.jungle.store.Command; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.operations.NodeOperation; import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/operations/NetworkNodePath.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/operations/NetworkNodePath.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/operations/NetworkNodePath.java Tue Dec 13 03:16:12 2016 +0900 @@ -34,6 +34,11 @@ } @Override + public int get(int index) { + return path.get(index); + } + + @Override public NetworkNodePath add(int _pos) { LinkedList newPath = copyPath(); newPath.add(_pos); diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/operations/NetworkPutAttributeOperation.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/operations/NetworkPutAttributeOperation.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/operations/NetworkPutAttributeOperation.java Tue Dec 13 03:16:12 2016 +0900 @@ -3,7 +3,7 @@ import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; import jp.ac.u_ryukyu.ie.cr.jungle.store.Command; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.operations.NodeOperation; import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; import org.msgpack.annotation.Message; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/persistent/PersistentJungle.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/persistent/PersistentJungle.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/persistent/PersistentJungle.java Tue Dec 13 03:16:12 2016 +0900 @@ -7,11 +7,11 @@ 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.transaction.editor.treeEditor.TreeEditor; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.DefaultTreeOperationLog; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.TreeOperationLog; import jp.ac.u_ryukyu.ie.cr.jungle.store.operations.TreeOperation; -import jp.ac.u_ryukyu.ie.cr.jungle.transaction.DefaultTreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.DefaultTreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.traverser.InterfaceTraverser; import java.util.Enumeration; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/persistent/PersistentJungleTree.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/persistent/PersistentJungleTree.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/persistent/PersistentJungleTree.java Tue Dec 13 03:16:12 2016 +0900 @@ -12,8 +12,8 @@ import jp.ac.u_ryukyu.ie.cr.jungle.store.TreeContext; import jp.ac.u_ryukyu.ie.cr.jungle.transaction.editor.treeEditor.TreeEditor; import jp.ac.u_ryukyu.ie.cr.jungle.store.nodepath.DefaultNodePath; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNodeChildren; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNodeChildren; import jp.ac.u_ryukyu.ie.cr.jungle.store.index.ParentIndex; import jp.ac.u_ryukyu.ie.cr.jungle.traverser.InterfaceTraverser; import jp.ac.u_ryukyu.ie.cr.jungle.util.DefaultEither; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/persistent/PersistentJungleTreeEditor.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/persistent/PersistentJungleTreeEditor.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/persistent/PersistentJungleTreeEditor.java Tue Dec 13 03:16:12 2016 +0900 @@ -4,7 +4,7 @@ import jp.ac.u_ryukyu.ie.cr.jungle.store.nodepath.NodePath; import jp.ac.u_ryukyu.ie.cr.jungle.transaction.editor.treeEditor.TreeEditor; import jp.ac.u_ryukyu.ie.cr.jungle.store.nodepath.DefaultNodePath; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.DefaultTreeOperationLog; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.LoggingNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.OperationLog; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/persistent/PersistentTransactionManager.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/persistent/PersistentTransactionManager.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/persistent/PersistentTransactionManager.java Tue Dec 13 03:16:12 2016 +0900 @@ -3,7 +3,7 @@ import jp.ac.u_ryukyu.ie.cr.jungle.persistent.ChangeListWriter; 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.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.DefaultTreeOperationLog; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.TreeOperationLog; import jp.ac.u_ryukyu.ie.cr.jungle.transaction.TransactionManager; diff -r 6167451e8d35 -r b3a04bc21b23 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:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/persistent/PersistentTreeContext.java Tue Dec 13 03:16:12 2016 +0900 @@ -5,7 +5,7 @@ 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.transaction.node.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; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/transaction/NetworkDefaultJungleTree.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/transaction/NetworkDefaultJungleTree.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/transaction/NetworkDefaultJungleTree.java Tue Dec 13 03:16:12 2016 +0900 @@ -11,8 +11,8 @@ import jp.ac.u_ryukyu.ie.cr.jungle.store.TreeContext; import jp.ac.u_ryukyu.ie.cr.jungle.transaction.editor.treeEditor.TreeEditor; import jp.ac.u_ryukyu.ie.cr.jungle.store.nodepath.DefaultNodePath; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNodeChildren; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNodeChildren; import jp.ac.u_ryukyu.ie.cr.jungle.store.index.ParentIndex; import jp.ac.u_ryukyu.ie.cr.jungle.traverser.InterfaceTraverser; import jp.ac.u_ryukyu.ie.cr.jungle.util.DefaultEither; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/transaction/NetworkDefaultJungleTreeEditor.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/transaction/NetworkDefaultJungleTreeEditor.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/transaction/NetworkDefaultJungleTreeEditor.java Tue Dec 13 03:16:12 2016 +0900 @@ -5,7 +5,7 @@ import jp.ac.u_ryukyu.ie.cr.jungle.transaction.editor.jungleTreeEditor.JungleTreeEditor; import jp.ac.u_ryukyu.ie.cr.jungle.store.nodepath.NodePath; import jp.ac.u_ryukyu.ie.cr.jungle.transaction.editor.treeEditor.TreeEditor; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.DefaultTreeOperationLog; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.LoggingNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.OperationLog; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/transaction/NetworkTransactionManager.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/transaction/NetworkTransactionManager.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/transaction/NetworkTransactionManager.java Tue Dec 13 03:16:12 2016 +0900 @@ -4,7 +4,7 @@ import jp.ac.u_ryukyu.ie.cr.jungle.persistent.ChangeList; import jp.ac.u_ryukyu.ie.cr.jungle.persistent.ChangeListWriter; 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.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.TreeOperationLog; import jp.ac.u_ryukyu.ie.cr.jungle.store.operations.TreeOperation; import jp.ac.u_ryukyu.ie.cr.jungle.transaction.DefaultTreeContext; diff -r 6167451e8d35 -r b3a04bc21b23 src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/transformer/NetworkAppendChildAt.java --- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/transformer/NetworkAppendChildAt.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/transformer/NetworkAppendChildAt.java Tue Dec 13 03:16:12 2016 +0900 @@ -5,7 +5,7 @@ * This code same AppendChildAt. */ -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.LoggingNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.OperationLog; import jp.ac.u_ryukyu.ie.cr.jungle.store.trasnformer.NodeEditor; diff -r 6167451e8d35 -r b3a04bc21b23 src/test/java/DefaultJungleTreeTest.java --- a/src/test/java/DefaultJungleTreeTest.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/test/java/DefaultJungleTreeTest.java Tue Dec 13 03:16:12 2016 +0900 @@ -1,7 +1,7 @@ import jp.ac.u_ryukyu.ie.cr.jungle.DefaultJungle; import jp.ac.u_ryukyu.ie.cr.jungle.Jungle; import jp.ac.u_ryukyu.ie.cr.jungle.store.nodepath.DefaultNodePath; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.transaction.editor.jungleTreeEditor.JungleTreeEditor; import jp.ac.u_ryukyu.ie.cr.jungle.traverser.DefaultTraverser; import jp.ac.u_ryukyu.ie.cr.jungle.tree.JungleTree; diff -r 6167451e8d35 -r b3a04bc21b23 src/test/java/jp/ac/u_ryukyu/ie/cr/data/list/deleteTest.java --- a/src/test/java/jp/ac/u_ryukyu/ie/cr/data/list/deleteTest.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/test/java/jp/ac/u_ryukyu/ie/cr/data/list/deleteTest.java Tue Dec 13 03:16:12 2016 +0900 @@ -18,11 +18,11 @@ List newList = list.delete(5); Assert.assertEquals(newList.length(),9); newList = newList.deleteHead(); - int attribute = newList.index(1); + int attribute = newList.get(1); Assert.assertEquals(attribute,2); Assert.assertEquals(newList.length(),8); newList = newList.deleteLast(); - attribute = newList.index(6); + attribute = newList.get(6); Assert.assertEquals(attribute,8); Assert.assertEquals(list.length(),10); } diff -r 6167451e8d35 -r b3a04bc21b23 src/test/java/jp/ac/u_ryukyu/ie/cr/data/list/listAdd.java --- a/src/test/java/jp/ac/u_ryukyu/ie/cr/data/list/listAdd.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/test/java/jp/ac/u_ryukyu/ie/cr/data/list/listAdd.java Tue Dec 13 03:16:12 2016 +0900 @@ -21,15 +21,15 @@ } for (int count = 0; count < 10; count++) { - int num = list.index(count); - int num2 = list2.index(count); + int num = list.get(count); + int num2 = list2.get(count); Assert.assertEquals(num,count); Assert.assertEquals(num2,count); } List newList = list.add(5, 50); - int num = list.index(5); - int num2 = newList.index(5); + int num = list.get(5); + int num2 = newList.get(5); Assert.assertEquals(num,5); Assert.assertEquals(num2,50); diff -r 6167451e8d35 -r b3a04bc21b23 src/test/java/jp/ac/u_ryukyu/ie/cr/data/list/replaceTest.java --- a/src/test/java/jp/ac/u_ryukyu/ie/cr/data/list/replaceTest.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/test/java/jp/ac/u_ryukyu/ie/cr/data/list/replaceTest.java Tue Dec 13 03:16:12 2016 +0900 @@ -16,9 +16,9 @@ } List newList = list.replace(5, 15); Assert.assertEquals(list.length(), 10); - int attribute = list.index(5); + int attribute = list.get(5); Assert.assertEquals(attribute, 5); - attribute = newList.index(5); + attribute = newList.get(5); Assert.assertEquals(newList.length(), 10); Assert.assertEquals(attribute, 15); } diff -r 6167451e8d35 -r b3a04bc21b23 src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/core/ChildrenTest.java --- a/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/core/ChildrenTest.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/core/ChildrenTest.java Tue Dec 13 03:16:12 2016 +0900 @@ -1,7 +1,7 @@ package jp.ac.u_ryukyu.ie.cr.jungle.core; -import jp.ac.u_ryukyu.ie.cr.jungle.transaction.DefaultTreeNodeChildren; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.DefaultTreeNodeChildren; import junit.framework.Assert; import junit.framework.TestCase; diff -r 6167451e8d35 -r b3a04bc21b23 src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/core/GetNodeOfPathTest.java --- a/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/core/GetNodeOfPathTest.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/core/GetNodeOfPathTest.java Tue Dec 13 03:16:12 2016 +0900 @@ -3,7 +3,7 @@ import jp.ac.u_ryukyu.ie.cr.jungle.DefaultJungle; import jp.ac.u_ryukyu.ie.cr.jungle.Jungle; import jp.ac.u_ryukyu.ie.cr.jungle.store.nodepath.DefaultNodePath; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.transaction.editor.jungleTreeEditor.JungleTreeEditor; import jp.ac.u_ryukyu.ie.cr.jungle.traverser.DefaultTraverser; import jp.ac.u_ryukyu.ie.cr.jungle.traverser.InterfaceTraverser; diff -r 6167451e8d35 -r b3a04bc21b23 src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/core/GetOldTreeTest.java --- a/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/core/GetOldTreeTest.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/core/GetOldTreeTest.java Tue Dec 13 03:16:12 2016 +0900 @@ -4,7 +4,7 @@ import jp.ac.u_ryukyu.ie.cr.jungle.DefaultJungle; import jp.ac.u_ryukyu.ie.cr.jungle.Jungle; import jp.ac.u_ryukyu.ie.cr.jungle.store.nodepath.DefaultNodePath; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.transaction.editor.jungleTreeEditor.JungleTreeEditor; import jp.ac.u_ryukyu.ie.cr.jungle.traverser.DefaultTraverser; import jp.ac.u_ryukyu.ie.cr.jungle.tree.JungleTree; diff -r 6167451e8d35 -r b3a04bc21b23 src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/core/ParentTest.java --- a/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/core/ParentTest.java Tue Dec 13 00:25:29 2016 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -/*package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core; - -import org.junit.Ignore; -import org.junit.Test; - -import junit.framework.Assert; -import junit.framework.TestCase; - -@Ignore -public abstract class ParentTest> extends TestCase -{ - public abstract T instance(); - - @Test - public void testGetChildren() - { - T instance = instance(); - Children children = instance.getChildren(); - Assert.assertNotNull(children); - } -} -*/ \ No newline at end of file diff -r 6167451e8d35 -r b3a04bc21b23 src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/core/impl/treeeditor/DefaultTreeEditorTest.java --- a/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/core/impl/treeeditor/DefaultTreeEditorTest.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/core/impl/treeeditor/DefaultTreeEditorTest.java Tue Dec 13 03:16:12 2016 +0900 @@ -2,12 +2,12 @@ import jp.ac.u_ryukyu.ie.cr.jungle.store.nodepath.DefaultNodePath; import jp.ac.u_ryukyu.ie.cr.jungle.transaction.editor.treeEditor.DefaultTreeEditor; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.LoggingNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.trasnformer.AppendChildAt; import jp.ac.u_ryukyu.ie.cr.jungle.store.trasnformer.PutAttribute; import jp.ac.u_ryukyu.ie.cr.jungle.tests.util.TestUtil; -import jp.ac.u_ryukyu.ie.cr.jungle.transaction.DefaultTreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.DefaultTreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.traverser.DefaultEvaluator; import jp.ac.u_ryukyu.ie.cr.jungle.traverser.DefaultTraverser; import jp.ac.u_ryukyu.ie.cr.jungle.traverser.Traversal; diff -r 6167451e8d35 -r b3a04bc21b23 src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/core/nodeeditor/AppendChildAtTest.java --- a/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/core/nodeeditor/AppendChildAtTest.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/core/nodeeditor/AppendChildAtTest.java Tue Dec 13 03:16:12 2016 +0900 @@ -3,9 +3,9 @@ import jp.ac.u_ryukyu.ie.cr.jungle.store.trasnformer.AppendChildAt; import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.LoggingNode; -import jp.ac.u_ryukyu.ie.cr.jungle.transaction.DefaultTreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.DefaultTreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; import junit.framework.Assert; import junit.framework.TestCase; diff -r 6167451e8d35 -r b3a04bc21b23 src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/core/nodeeditor/DeleteAttributeAtTest.java --- a/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/core/nodeeditor/DeleteAttributeAtTest.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/core/nodeeditor/DeleteAttributeAtTest.java Tue Dec 13 03:16:12 2016 +0900 @@ -2,10 +2,10 @@ import java.nio.ByteBuffer; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.LoggingNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.trasnformer.DeleteAttribute; -import jp.ac.u_ryukyu.ie.cr.jungle.transaction.DefaultTreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.DefaultTreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; import junit.framework.Assert; diff -r 6167451e8d35 -r b3a04bc21b23 src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/core/nodeeditor/DeleteChildAtTest.java --- a/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/core/nodeeditor/DeleteChildAtTest.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/core/nodeeditor/DeleteChildAtTest.java Tue Dec 13 03:16:12 2016 +0900 @@ -1,9 +1,9 @@ package jp.ac.u_ryukyu.ie.cr.jungle.core.nodeeditor; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.LoggingNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.trasnformer.DeleteChildAt; -import jp.ac.u_ryukyu.ie.cr.jungle.transaction.DefaultTreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.DefaultTreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; import junit.framework.Assert; diff -r 6167451e8d35 -r b3a04bc21b23 src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/core/nodeeditor/PutAttributeTest.java --- a/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/core/nodeeditor/PutAttributeTest.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/core/nodeeditor/PutAttributeTest.java Tue Dec 13 03:16:12 2016 +0900 @@ -2,10 +2,10 @@ import java.nio.ByteBuffer; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.logger.LoggingNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.trasnformer.PutAttribute; -import jp.ac.u_ryukyu.ie.cr.jungle.transaction.DefaultTreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.DefaultTreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; import org.junit.Assert; diff -r 6167451e8d35 -r b3a04bc21b23 src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/core/nodeeditor/ReplaceRootNodeAt.java --- a/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/core/nodeeditor/ReplaceRootNodeAt.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/core/nodeeditor/ReplaceRootNodeAt.java Tue Dec 13 03:16:12 2016 +0900 @@ -2,7 +2,7 @@ import jp.ac.u_ryukyu.ie.cr.jungle.DefaultJungle; import jp.ac.u_ryukyu.ie.cr.jungle.Jungle; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.transaction.editor.jungleTreeEditor.JungleTreeEditor; import jp.ac.u_ryukyu.ie.cr.jungle.traverser.DefaultTraverser; import jp.ac.u_ryukyu.ie.cr.jungle.tree.JungleTree; diff -r 6167451e8d35 -r b3a04bc21b23 src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/impl/node/DefaultAttributesTest.java --- a/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/impl/node/DefaultAttributesTest.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/impl/node/DefaultAttributesTest.java Tue Dec 13 03:16:12 2016 +0900 @@ -1,11 +1,11 @@ package jp.ac.u_ryukyu.ie.cr.jungle.impl.node; import jp.ac.u_ryukyu.ie.cr.jungle.core.AttributesTest; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNodeAttributes; -import jp.ac.u_ryukyu.ie.cr.jungle.transaction.DefaultTreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNodeAttributes; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.DefaultTreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.util.Pair; import jp.ac.u_ryukyu.ie.cr.jungle.data.list.List; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.data.treemap.TreeMap; import org.junit.Assert; diff -r 6167451e8d35 -r b3a04bc21b23 src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/impl/node/DefaultChildrenTest.java --- a/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/impl/node/DefaultChildrenTest.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/impl/node/DefaultChildrenTest.java Tue Dec 13 03:16:12 2016 +0900 @@ -3,9 +3,9 @@ import jp.ac.u_ryukyu.ie.cr.jungle.core.ChildrenTest; import jp.ac.u_ryukyu.ie.cr.jungle.data.list.List; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; -import jp.ac.u_ryukyu.ie.cr.jungle.transaction.DefaultTreeNode; -import jp.ac.u_ryukyu.ie.cr.jungle.transaction.DefaultTreeNodeChildren; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.DefaultTreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.DefaultTreeNodeChildren; import jp.ac.u_ryukyu.ie.cr.jungle.data.treemap.TreeMap; import org.junit.Assert; diff -r 6167451e8d35 -r b3a04bc21b23 src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/impl/node/FilteringKeyTest.java --- a/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/impl/node/FilteringKeyTest.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/impl/node/FilteringKeyTest.java Tue Dec 13 03:16:12 2016 +0900 @@ -1,8 +1,8 @@ package jp.ac.u_ryukyu.ie.cr.jungle.impl.node; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNodeAttributes; -import jp.ac.u_ryukyu.ie.cr.jungle.transaction.DefaultTreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNodeAttributes; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.DefaultTreeNode; import org.junit.Assert; import org.junit.Test; diff -r 6167451e8d35 -r b3a04bc21b23 src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/impl/node/GetNodePath.java --- a/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/impl/node/GetNodePath.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/impl/node/GetNodePath.java Tue Dec 13 03:16:12 2016 +0900 @@ -5,8 +5,8 @@ import jp.ac.u_ryukyu.ie.cr.jungle.Jungle; import jp.ac.u_ryukyu.ie.cr.jungle.store.nodepath.NodePath; import jp.ac.u_ryukyu.ie.cr.jungle.store.nodepath.DefaultNodePath; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; -import jp.ac.u_ryukyu.ie.cr.jungle.transaction.DefaultTreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.DefaultTreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.transaction.editor.jungleTreeEditor.JungleTreeEditor; import jp.ac.u_ryukyu.ie.cr.jungle.traverser.DefaultTraverser; import jp.ac.u_ryukyu.ie.cr.jungle.traverser.InterfaceTraverser; diff -r 6167451e8d35 -r b3a04bc21b23 src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/index/parentIndexTest.java --- a/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/index/parentIndexTest.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/index/parentIndexTest.java Tue Dec 13 03:16:12 2016 +0900 @@ -3,7 +3,7 @@ import jp.ac.u_ryukyu.ie.cr.jungle.DefaultJungle; import jp.ac.u_ryukyu.ie.cr.jungle.Jungle; import jp.ac.u_ryukyu.ie.cr.jungle.store.nodepath.DefaultNodePath; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.store.index.ParentIndex; import jp.ac.u_ryukyu.ie.cr.jungle.transaction.editor.jungleTreeEditor.JungleTreeEditor; import jp.ac.u_ryukyu.ie.cr.jungle.traverser.DefaultTraverser; diff -r 6167451e8d35 -r b3a04bc21b23 src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/tests/util/TestUtil.java --- a/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/tests/util/TestUtil.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/tests/util/TestUtil.java Tue Dec 13 03:16:12 2016 +0900 @@ -6,8 +6,8 @@ import jp.ac.u_ryukyu.ie.cr.jungle.store.nodepath.NodePath; import jp.ac.u_ryukyu.ie.cr.jungle.store.nodepath.DefaultNodePath; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; -import jp.ac.u_ryukyu.ie.cr.jungle.transaction.DefaultTreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.DefaultTreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; diff -r 6167451e8d35 -r b3a04bc21b23 src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/traverse/InterfaceTraverserTest.java --- a/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/traverse/InterfaceTraverserTest.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/traverse/InterfaceTraverserTest.java Tue Dec 13 03:16:12 2016 +0900 @@ -5,8 +5,8 @@ import jp.ac.u_ryukyu.ie.cr.jungle.persistent.NullJournal; import jp.ac.u_ryukyu.ie.cr.jungle.store.nodepath.NodePath; import jp.ac.u_ryukyu.ie.cr.jungle.store.nodepath.DefaultNodePath; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; -import jp.ac.u_ryukyu.ie.cr.jungle.transaction.DefaultTreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.DefaultTreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.transaction.editor.jungleTreeEditor.JungleTreeEditor; import jp.ac.u_ryukyu.ie.cr.jungle.traverser.DefaultTraverser; import jp.ac.u_ryukyu.ie.cr.jungle.traverser.InterfaceTraverser; diff -r 6167451e8d35 -r b3a04bc21b23 src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/traverse/TraverserTest.java --- a/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/traverse/TraverserTest.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/test/java/jp/ac/u_ryukyu/ie/cr/jungle/traverse/TraverserTest.java Tue Dec 13 03:16:12 2016 +0900 @@ -4,8 +4,8 @@ import jp.ac.u_ryukyu.ie.cr.jungle.data.list.List; import jp.ac.u_ryukyu.ie.cr.jungle.store.nodepath.NodePath; import jp.ac.u_ryukyu.ie.cr.jungle.store.nodepath.DefaultNodePath; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; -import jp.ac.u_ryukyu.ie.cr.jungle.transaction.DefaultTreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.DefaultTreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.traverser.*; import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; diff -r 6167451e8d35 -r b3a04bc21b23 src/test/java/jp/ac/u_ryukyu/ie/cr/junglenetwork/DataWriteBufferTest.java --- a/src/test/java/jp/ac/u_ryukyu/ie/cr/junglenetwork/DataWriteBufferTest.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/test/java/jp/ac/u_ryukyu/ie/cr/junglenetwork/DataWriteBufferTest.java Tue Dec 13 03:16:12 2016 +0900 @@ -8,7 +8,7 @@ import jp.ac.u_ryukyu.ie.cr.jungle.persistent.ChangeListReader; import jp.ac.u_ryukyu.ie.cr.jungle.store.nodepath.NodePath; import jp.ac.u_ryukyu.ie.cr.jungle.transaction.editor.treeEditor.DefaultTreeEditor; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.traverser.DefaultTraverser; import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; import jp.ac.u_ryukyu.ie.cr.jungle.util.Error; diff -r 6167451e8d35 -r b3a04bc21b23 src/test/java/jp/ac/u_ryukyu/ie/cr/junglenetwork/PersistentJournalTest.java --- a/src/test/java/jp/ac/u_ryukyu/ie/cr/junglenetwork/PersistentJournalTest.java Tue Dec 13 00:25:29 2016 +0900 +++ b/src/test/java/jp/ac/u_ryukyu/ie/cr/junglenetwork/PersistentJournalTest.java Tue Dec 13 03:16:12 2016 +0900 @@ -8,7 +8,7 @@ import jp.ac.u_ryukyu.ie.cr.jungle.persistent.ChangeListReader; import jp.ac.u_ryukyu.ie.cr.jungle.store.nodepath.NodePath; import jp.ac.u_ryukyu.ie.cr.jungle.transaction.editor.treeEditor.DefaultTreeEditor; -import jp.ac.u_ryukyu.ie.cr.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.jungle.transaction.node.TreeNode; import jp.ac.u_ryukyu.ie.cr.jungle.traverser.DefaultTraverser; import jp.ac.u_ryukyu.ie.cr.jungle.util.Either; import jp.ac.u_ryukyu.ie.cr.jungle.util.Error;