Mercurial > hg > Members > shoshi > jungle > jungle-core
changeset 177:75422f82e6b6 oldCommit
miner change
author | tatsuki |
---|---|
date | Sun, 15 Mar 2015 14:57:26 +0900 |
parents | 550f51183d8a |
children | 169c501fe3a9 |
files | src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/JungleTree.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/logger/DefaultTreeOperationLog.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/traverser/InterfaceTraverser.java src/test/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/core/nodeeditor/ReplaceRootNodeAt.java |
diffstat | 4 files changed, 11 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/JungleTree.java Fri Mar 06 10:59:34 2015 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/JungleTree.java Sun Mar 15 14:57:26 2015 +0900 @@ -14,7 +14,7 @@ { public JungleTreeEditor getTreeEditor(); public JungleTreeEditor getLocalTreeEditor(); - public TreeNode getRootNode(); + public TreeNode getRootNode(); public long revision(); public Either<Error, JungleTree> getOldTree(long revision); public TreeMap<String, TreeMap<String, TreeMap<TreeNode, TreeNode>>> getIndex();
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/logger/DefaultTreeOperationLog.java Fri Mar 06 10:59:34 2015 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/logger/DefaultTreeOperationLog.java Sun Mar 15 14:57:26 2015 +0900 @@ -3,7 +3,6 @@ import java.util.Iterator; import com.google.common.collect.Iterables; - import fj.data.List; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.NodePath;
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/traverser/InterfaceTraverser.java Fri Mar 06 10:59:34 2015 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/traverser/InterfaceTraverser.java Sun Mar 15 14:57:26 2015 +0900 @@ -4,6 +4,7 @@ import fj.Ord; import fj.P2; +import fj.data.List; import fj.data.Option; import fj.data.TreeMap; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.NulIterator; @@ -17,7 +18,7 @@ public class InterfaceTraverser { TreeNode node; - TreeMap<String, TreeMap<String, TreeMap<TreeNode, TreeNode>>> index; + TreeMap<String, TreeMap<String, TreeMap<TreeNode, TreeNode>>> indexList; ParentIndex parentIndex; boolean parentUpdateFlag; IndexManager indexManager; @@ -30,7 +31,7 @@ public InterfaceTraverser(TreeNode root, TreeMap<String, TreeMap<String, TreeMap<TreeNode, TreeNode>>> index, ParentIndex parentIndex, IndexManager indexManager, boolean useIndex) { this.node = root; - this.index = index; + this.indexList = index; this.indexManager = indexManager; this.parentIndex = parentIndex; if (parentIndex.isEmpty()) @@ -41,12 +42,12 @@ } public TreeMap<String, TreeMap<String, TreeMap<TreeNode, TreeNode>>> getIndex() { - return index; + return indexList; } public void commit() { parentUpdateFlag = false; - indexManager.commit(index, parentIndex); + indexManager.commit(indexList, parentIndex); } public ParentIndex getParentIndex() { @@ -54,7 +55,7 @@ } public void setIndex(TreeMap<String, TreeMap<String, TreeMap<TreeNode, TreeNode>>> index) { - this.index = index; + this.indexList = index; } public void createIndex() { @@ -62,7 +63,7 @@ IndexCreater creater = new IndexCreater(node); // long t2 = System.currentTimeMillis(); // System.out.println("createIndex time = " + (t2 - t1)); - index = creater.getIndex(); + indexList = creater.getIndex(); parentIndex = creater.getParentIndex(); } @@ -212,7 +213,7 @@ public Iterator<TreeNode> find(final Query query, final String key, String searchValue) { Iterator<TreeNode> nodeIterator = get(key, searchValue); - if (nodeIterator.hasNext() && useIndex) { + if (nodeIterator != null && useIndex) { return nodeIterator; } else { @@ -323,9 +324,9 @@ public Iterator<TreeNode> get(String key, String value) { - Option<TreeMap<String, TreeMap<TreeNode, TreeNode>>> indexOp = index.get(key); + Option<TreeMap<String, TreeMap<TreeNode, TreeNode>>> indexOp = indexList.get(key); if (indexOp.isNone()) - return new NulIterator<TreeNode>(); + return null; TreeMap<String, TreeMap<TreeNode, TreeNode>> index = indexOp.some(); Option<TreeMap<TreeNode, TreeNode>> nodeMapOp = index.get(value);
--- a/src/test/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/core/nodeeditor/ReplaceRootNodeAt.java Fri Mar 06 10:59:34 2015 +0900 +++ b/src/test/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/core/nodeeditor/ReplaceRootNodeAt.java Sun Mar 15 14:57:26 2015 +0900 @@ -17,7 +17,6 @@ @Test public void ReplaceRootNodeAtTest() { - System.out.println("start"); Jungle jungle = new DefaultJungle(null, "hogehoge", new DefaultTreeEditor(new DefaultTraverser())); jungle.createNewTree("tree"); JungleTree tree = jungle.getTreeByName("tree");