Mercurial > hg > Members > shoshi > jungle > jungle-core
changeset 106:3e75124550e9
Merge with 3d88bad21bc47e3a624f09ca6badbb5508a744aa
author | one |
---|---|
date | Fri, 12 Sep 2014 19:49:00 +0900 |
parents | 78ef456c98a0 (current diff) 3d88bad21bc4 (diff) |
children | 5b7e45464bb8 69bbf08894aa |
files | src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/traverser/InterfaceTraverser.java src/main/java/jp/ac/u_ryukyu/ie/cr/tatsuki/jungle/query/PathNodeIterator.java |
diffstat | 3 files changed, 7 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/tatsuki/jungle/query/PathNodeIterator.java Fri Sep 12 19:47:25 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/tatsuki/jungle/query/PathNodeIterator.java Fri Sep 12 19:49:00 2014 +0900 @@ -40,7 +40,7 @@ public Pair<TreeNode, NodePath> next() { TreeNode now = node; NodePath currentPath = path; - if (node.getChildren().size() > 0) { + if (node.getChildren().size() > 0) { // nodeStack.push(node); path = path.add(0); children = node.getChildren();
--- a/src/test/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/traverse/BruteForceTraverserTest.java Fri Sep 12 19:47:25 2014 +0900 +++ b/src/test/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/traverse/BruteForceTraverserTest.java Fri Sep 12 19:49:00 2014 +0900 @@ -42,10 +42,6 @@ Pair<TreeNode, NodePath> test = null; TreeNode root = createTree(0,0,maxHeight,new DefaultNodePath()); InterfaceTraverser traverser = instance(root); - Iterator<Pair<TreeNode, NodePath>> itNode = traverser.find(new SearchQuery("KEY","<-1,0,0>")); - for(;itNode.hasNext(); ){ - test = itNode.next(); - } JungleTreeEditor editor = traverser.update(new UpdateQuery("KEY", "<-1,0,0>", "tatsuki")); traverser.set(editor.getRoot()); Iterator<Pair<TreeNode, NodePath>> checkNode = traverser.find(new SearchQuery("KEY","tatsuki"));
--- a/src/test/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/traverse/DefaultTraverserTest.java Fri Sep 12 19:47:25 2014 +0900 +++ b/src/test/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/traverse/DefaultTraverserTest.java Fri Sep 12 19:49:00 2014 +0900 @@ -1,8 +1,7 @@ package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.traverse; -import java.util.Iterator; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.NodePath; +import fj.data.TreeMap; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.DefaultTreeEditor; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNode; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.DefaultJungleTreeEditor; @@ -41,7 +40,11 @@ @Override public InterfaceTraverser instance(TreeNode root) { - return new InterfaceTraverser(root, new Pair(null,null),new DefaultJungleTreeEditor(root,null,new DefaultTreeEditor(new DefaultTraverser()),null)); + Pair<TreeMap<String, TreeNode>, TreeMap<String, String>> index = new Pair<TreeMap<String, TreeNode>, TreeMap<String, String>>(null,null); + DefaultTraverser traverser = new DefaultTraverser(); + DefaultTreeEditor treeEditor = new DefaultTreeEditor(traverser); + DefaultJungleTreeEditor editor = new DefaultJungleTreeEditor(root,null,treeEditor,null); + return new InterfaceTraverser(root,index,editor); } }