Mercurial > hg > Members > shoshi > jungle > jungle-core
changeset 128:9c46e5c2ffac
edit PutIndexEditor
author | one |
---|---|
date | Tue, 14 Oct 2014 15:06:02 +0900 |
parents | b2c1fd513feb |
children | 8067fec660ab |
files | src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/transaction/IndexJungleTreeEditor.java 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/store/index/DefaultIndexEditor.java src/main/java/jp/ac/u_ryukyu/ie/cr/tatsuki/jungle/store/index/DeleteChildIndexEditor.java src/main/java/jp/ac/u_ryukyu/ie/cr/tatsuki/jungle/store/index/IndexEditor.java src/main/java/jp/ac/u_ryukyu/ie/cr/tatsuki/jungle/store/index/LoggingNode.java src/main/java/jp/ac/u_ryukyu/ie/cr/tatsuki/jungle/store/index/PutIndexEditor.java src/test/java/ip/ac/u_ryukyu/ie/cr/tatsuki/jungle/index/IndexFormTest.java src/test/java/ip/ac/u_ryukyu/ie/cr/tatsuki/jungle/index/IndexTest.java |
diffstat | 9 files changed, 238 insertions(+), 153 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/transaction/IndexJungleTreeEditor.java Mon Oct 13 03:22:16 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/transaction/IndexJungleTreeEditor.java Tue Oct 14 15:06:02 2014 +0900 @@ -25,6 +25,8 @@ import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Error; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.IterableConverter; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Pair; +import jp.ac.u_ryukyu.ie.cr.tatsuki.jungle.store.index.DefaultIndexEditor; +import jp.ac.u_ryukyu.ie.cr.tatsuki.jungle.store.index.DeleteChildIndexEditor; import jp.ac.u_ryukyu.ie.cr.tatsuki.jungle.store.index.DeleteIndexEditor; import jp.ac.u_ryukyu.ie.cr.tatsuki.jungle.store.index.IndexEditor; import jp.ac.u_ryukyu.ie.cr.tatsuki.jungle.store.index.PutIndexEditor; @@ -65,7 +67,7 @@ this.index = index; } - private Either<Error,IndexJungleTreeEditor> _edit(final NodePath _path,NodeEditor _e) + private Either<Error,IndexJungleTreeEditor> _edit(final NodePath _path,NodeEditor _e, IndexEditor indexEditor) { Either<Error,LoggingNode> either = editor.edit(root,_path,_e); if(either.isA()){ @@ -95,9 +97,9 @@ public Either<Error,JungleTreeEditor> addNewChildAt(NodePath _path, int _pos) { AppendChildAt appendChildAt = new AppendChildAt(_pos); - Either<Error,IndexJungleTreeEditor> either = _edit(_path,appendChildAt); - JungleTreeEditor editor = either.b(); - Either<Error,JungleTreeEditor> newEither = DefaultEither.newB(editor); + DefaultIndexEditor indexEditor = new DefaultIndexEditor(); + Either<Error,IndexJungleTreeEditor> either = _edit(_path,appendChildAt,indexEditor); + Either<Error,JungleTreeEditor> newEither = DefaultEither.newB(either.b()); return newEither; } @@ -105,7 +107,8 @@ public Either<Error,JungleTreeEditor> deleteChildAt(NodePath _path, int _pos) { DeleteChildAt deleteChildAt = new DeleteChildAt(_pos); - Either<Error,IndexJungleTreeEditor> either = _edit(_path,deleteChildAt); + DeleteChildIndexEditor indexEditor = new DeleteChildIndexEditor(); + Either<Error,IndexJungleTreeEditor> either = _edit(_path,deleteChildAt, indexEditor); JungleTreeEditor editor = either.b(); Either<Error,JungleTreeEditor> newEither = DefaultEither.newB(editor); return newEither; @@ -115,9 +118,10 @@ public Either<Error,JungleTreeEditor> putAttribute(NodePath _path,String _key,ByteBuffer _value) { PutAttribute putAttribute = new PutAttribute(_key,_value); - Either<Error,IndexJungleTreeEditor> either = _edit(_path,putAttribute); - PutIndexEditor indexEditor = new PutIndexEditor(); - Either<Error,JungleTreeEditor> newEither = indexEditor.edit(either.b()); + PutIndexEditor indexEditor = new PutIndexEditor(_key,_value,_path); + Either<Error,IndexJungleTreeEditor> either = _edit(_path,putAttribute,indexEditor); + JungleTreeEditor editor = either.b(); + Either<Error,JungleTreeEditor> newEither = DefaultEither.newB(editor); return newEither; } @@ -125,8 +129,8 @@ public Either<Error,JungleTreeEditor> deleteAttribute(NodePath _path, String _key) { DeleteAttribute deleteAttribute = new DeleteAttribute(_key); - Either<Error,IndexJungleTreeEditor> either = _edit(_path,deleteAttribute); DeleteIndexEditor indexEditor = new DeleteIndexEditor(); + Either<Error,IndexJungleTreeEditor> either = _edit(_path,deleteAttribute,indexEditor); Either<Error,JungleTreeEditor> newEither = indexEditor.edit(either.b()); return newEither; } @@ -134,7 +138,8 @@ @Override public Either<Error,JungleTreeEditor> edit(NodePath _path,NodeEditor _editor) { - Either<Error,IndexJungleTreeEditor> either = _edit(_path,_editor); + DefaultIndexEditor indexEditor = new DefaultIndexEditor(); + Either<Error,IndexJungleTreeEditor> either = _edit(_path,_editor,indexEditor); JungleTreeEditor editor = either.b(); Either<Error,JungleTreeEditor> newEither = DefaultEither.newB(editor); return newEither;
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/traverser/InterfaceTraverser.java Mon Oct 13 03:22:16 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/traverser/InterfaceTraverser.java Tue Oct 14 15:06:02 2014 +0900 @@ -104,7 +104,6 @@ } else { TreeMap<String, List<Pair<TreeNode, NodePath>>> innerIndex = innerIndexOp.some(); - innerIndex.set(value, null); Option<List<Pair<TreeNode, NodePath>>> opList = innerIndex.get(value); if (opList.isNone()) {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/tatsuki/jungle/store/index/DefaultIndexEditor.java Tue Oct 14 15:06:02 2014 +0900 @@ -0,0 +1,16 @@ +package jp.ac.u_ryukyu.ie.cr.tatsuki.jungle.store.index; + +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.JungleTreeEditor; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.IndexJungleTreeEditor; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Either; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Error; + +public class DefaultIndexEditor implements IndexEditor { + + @Override + public Either<Error, JungleTreeEditor> edit(IndexJungleTreeEditor e) { + // TODO Auto-generated method stub + return null; + } + +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/tatsuki/jungle/store/index/DeleteChildIndexEditor.java Tue Oct 14 15:06:02 2014 +0900 @@ -0,0 +1,16 @@ +package jp.ac.u_ryukyu.ie.cr.tatsuki.jungle.store.index; + +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.JungleTreeEditor; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.IndexJungleTreeEditor; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Either; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Error; + +public class DeleteChildIndexEditor implements IndexEditor { + + @Override + public Either<Error, JungleTreeEditor> edit(IndexJungleTreeEditor e) { + // TODO Auto-generated method stub + return null; + } + +}
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/tatsuki/jungle/store/index/IndexEditor.java Mon Oct 13 03:22:16 2014 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -package jp.ac.u_ryukyu.ie.cr.tatsuki.jungle.store.index; - -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.JungleTreeEditor; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.NodePath; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNode; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.IndexJungleTreeEditor; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Either; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Error; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Pair; -import fj.data.List; -import fj.data.TreeMap; - -public interface IndexEditor { - public Either<Error,JungleTreeEditor> edit(IndexJungleTreeEditor e); -}
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/tatsuki/jungle/store/index/LoggingNode.java Mon Oct 13 03:22:16 2014 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -package jp.ac.u_ryukyu.ie.cr.tatsuki.jungle.store.index; - -import fj.data.List; -import fj.data.TreeMap; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.NodePath; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNode; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.logger.LoggingAttributes; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.logger.LoggingChildren; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.logger.OperationLog; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Pair; - -public interface LoggingNode { - - public LoggingAttributes getAttributes(); - public LoggingChildren getChildren(); - public OperationLog getOperationLog(); - public TreeNode getWrap(); - public TreeMap<String, TreeMap<String, List<Pair<TreeNode, NodePath>>>> getIndex(); -}
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/tatsuki/jungle/store/index/PutIndexEditor.java Mon Oct 13 03:22:16 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/tatsuki/jungle/store/index/PutIndexEditor.java Tue Oct 14 15:06:02 2014 +0900 @@ -1,16 +1,99 @@ package jp.ac.u_ryukyu.ie.cr.tatsuki.jungle.store.index; + +import fj.Ord; +import fj.data.List; +import fj.data.Option; +import fj.data.TreeMap; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.JungleTreeEditor; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.NodePath; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.TreeEditor; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.logger.TreeOperationLog; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.IndexJungleTreeEditor; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.TransactionManager; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.DefaultEither; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Either; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Error; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Pair; +import jp.ac.u_ryukyu.ie.cr.tatsuki.jungle.query.PathNodeIndexIterator; + +import java.nio.ByteBuffer; public class PutIndexEditor implements IndexEditor { + String key; + String attribute; + NodePath path; + TransactionManager txManager; + TreeNode root; + TreeEditor editor; + TreeOperationLog log; + + public PutIndexEditor(String key, ByteBuffer attribute,NodePath path) { + this.key = key; + this.attribute = new String(attribute.array()); + this.path = path; + } + @Override - public Either<Error,JungleTreeEditor> edit(IndexJungleTreeEditor e) { - // TODO Auto-generated method stub - return null; + public Either<Error, JungleTreeEditor> edit(TreeNode root,TransactionManager txManager,TreeEditor editor,TreeOperationLog log,TreeMap<String, TreeMap<String, List<Pair<TreeNode, NodePath>>>> index) { + TreeNode target = getTarget(root, path); + TreeMap<String, TreeMap<String, List<Pair<TreeNode, NodePath>>>> newIndex = editIndex(target, path, key, attribute,index); + IndexJungleTreeEditor newEditor = new IndexJungleTreeEditor(root,txManager,editor,log, newIndex); + Either<Error, JungleTreeEditor> either = DefaultEither.newB(newEditor); + return either; } + + public TreeMap<String, TreeMap<String, List<Pair<TreeNode, NodePath>>>> editIndex(TreeNode target, NodePath path, String key, String attribute,TreeMap<String, TreeMap<String, List<Pair<TreeNode, NodePath>>>> index){ + + Option<TreeMap<String, List<Pair<TreeNode, NodePath>>>> innerIndexOp = index.get(key); + Pair<TreeNode, NodePath> pathNode = new Pair<TreeNode, NodePath>(target,path); + + if (attribute != null) { + if (innerIndexOp.isNone()) { + + TreeMap<String, List<Pair<TreeNode, NodePath>>> innerIndex = TreeMap.empty(Ord.stringOrd); + List<Pair<TreeNode, NodePath>> list = List.nil(); + list = list.cons(pathNode); + innerIndex = innerIndex.set(attribute, list); + TreeMap<String, TreeMap<String, List<Pair<TreeNode, NodePath>>>> newIndex = index.set(key, innerIndex); + return newIndex; + } else { + + TreeMap<String, List<Pair<TreeNode, NodePath>>> innerIndex = innerIndexOp.some(); + innerIndex.set(attribute, null); + Option<List<Pair<TreeNode, NodePath>>> opList = innerIndex.get(attribute); + + if (opList.isNone()) { + + List<Pair<TreeNode, NodePath>> list = List.nil(); + list = list.cons(pathNode); + innerIndex = innerIndex.set(attribute, list); + + } else { + + List<Pair<TreeNode, NodePath>> list = opList.some(); + list = list.cons(pathNode); + innerIndex = innerIndex.set(attribute, list); + + } + TreeMap<String, TreeMap<String, List<Pair<TreeNode, NodePath>>>> newIndex = index.set(key, innerIndex); + return newIndex; + } + } + return index; + } + + public TreeNode getTarget(TreeNode node , NodePath path){ + Pair<Integer, NodePath> pathNode = path.pop(); + Either<Error, TreeNode> either = node.getChildren().at(pathNode.left()); + if (either.isA()) + return node; + TreeNode child = either.b(); + TreeNode target = getTarget(child,pathNode.right()); + return target; + } + }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/test/java/ip/ac/u_ryukyu/ie/cr/tatsuki/jungle/index/IndexFormTest.java Tue Oct 14 15:06:02 2014 +0900 @@ -0,0 +1,105 @@ +package ip.ac.u_ryukyu.ie.cr.tatsuki.jungle.index; + +import java.nio.ByteBuffer; + +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.NodePath; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.DefaultNodePath; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNodeAttributes; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.DefaultTreeNode; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Either; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Error; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Pair; + +import org.junit.Assert; +import org.junit.Test; + +import fj.Ord; +import fj.data.List; +import fj.data.Option; +import fj.data.TreeMap; + +public class IndexFormTest { + + TreeMap<String, TreeMap<String, List<Pair<TreeNode, NodePath>>>> index = TreeMap + .empty(Ord.stringOrd); + + @Test + public void IndexFormTest() { + + NodePath path = new DefaultNodePath(); + TreeNode node = createTree(3, 0, 3, path); + TreeMap<String, List<Pair<TreeNode, NodePath>>> map = index.get(key).some(); + Option<List<Pair<TreeNode, NodePath>>> opList = map.get("<-1,0,0,2>"); + List<Pair<TreeNode, NodePath>> list = opList.some(); + Pair<TreeNode, NodePath> Pair = list.head(); + NodePath newPath = Pair.right(); + String pathStr = newPath.toString(); + Assert.assertEquals(pathStr,"<-1,0,0,2>"); + System.out.println("aaa"); + } + + public static String key = "KEY"; + public static ByteBuffer value = ByteBuffer.wrap(key.getBytes()); + public static DefaultTreeNode factory = new DefaultTreeNode(); + + public TreeNode createTree(int _curX, int _curY, int _maxHeight, + NodePath _address) { + TreeNode parent = factory.createNewNode(); + Either<Error, TreeNode> either = parent.getAttributes().put(key,ByteBuffer.wrap(_address.toString().getBytes())); + if (either.isA()) { + Assert.fail(); + } + editIndex(parent, _address, _address.toString(), key); + parent = either.b(); + + if (_curY == _maxHeight) { + return parent; + } + + for (int i = 0; i < _curY + 1; i++) { + TreeNode ch = createTree(i, _curY + 1, _maxHeight, _address.add(i)); + either = parent.getChildren().addNewChildAt(i, ch); + if (either.isA()) { + Assert.fail(); + } + + parent = either.b(); + } + + return parent; + } + + + public void editIndex(TreeNode node, NodePath path, String attribute,String key) { + + Pair<TreeNode, NodePath> pair = new Pair<TreeNode, NodePath>(node, path); + Option<TreeMap<String, List<Pair<TreeNode, NodePath>>>> opAttributeList = index.get(key); + + if (opAttributeList.isNone()) { + TreeMap<String, List<Pair<TreeNode, NodePath>>> nodeIndex = TreeMap.empty(Ord.stringOrd); + List<Pair<TreeNode, NodePath>> list = List.nil(); + list = list.cons(pair); + nodeIndex = nodeIndex.set(attribute, list); + index = index.set(key, nodeIndex); + } else { + TreeMap<String, List<Pair<TreeNode, NodePath>>> indexMap = opAttributeList.some(); + Option<List<Pair<TreeNode, NodePath>>> opNodeIndex = indexMap.get(attribute); + + if (opNodeIndex.isNone()) { + List<Pair<TreeNode, NodePath>> pairList = List.nil(); + pairList = pairList.cons(pair); + indexMap = indexMap.set(attribute, pairList); + + } else { + List<Pair<TreeNode, NodePath>> pairList = opNodeIndex.some(); + pairList = pairList.cons(pair); + indexMap = indexMap.set(attribute, pairList); + } + index = index.set(key, indexMap); + } + System.out.println(attribute); + + } + +}
--- a/src/test/java/ip/ac/u_ryukyu/ie/cr/tatsuki/jungle/index/IndexTest.java Mon Oct 13 03:22:16 2014 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,105 +0,0 @@ -package ip.ac.u_ryukyu.ie.cr.tatsuki.jungle.index; - -import java.nio.ByteBuffer; - -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.NodePath; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.DefaultNodePath; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNode; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNodeAttributes; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.DefaultTreeNode; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Either; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Error; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Pair; - -import org.junit.Assert; -import org.junit.Test; - -import fj.Ord; -import fj.data.List; -import fj.data.Option; -import fj.data.TreeMap; - -public class IndexTest { - - TreeMap<String, TreeMap<String, List<Pair<TreeNode, NodePath>>>> index = TreeMap - .empty(Ord.stringOrd); - - @Test - public void IndexTest() { - - NodePath path = new DefaultNodePath(); - TreeNode node = createTree(3, 0, 3, path); - TreeMap<String, List<Pair<TreeNode, NodePath>>> map = index.get(key).some(); - Option<List<Pair<TreeNode, NodePath>>> opList = map.get("<-1,0,0,2>"); - List<Pair<TreeNode, NodePath>> list = opList.some(); - Pair<TreeNode, NodePath> Pair = list.head(); - NodePath newPath = Pair.right(); - String pathStr = newPath.toString(); - Assert.assertEquals(pathStr,"<-1,0,0,2>"); - System.out.println("aaa"); - } - - public static String key = "KEY"; - public static ByteBuffer value = ByteBuffer.wrap(key.getBytes()); - public static DefaultTreeNode factory = new DefaultTreeNode(); - - public TreeNode createTree(int _curX, int _curY, int _maxHeight, - NodePath _address) { - TreeNode parent = factory.createNewNode(); - Either<Error, TreeNode> either = parent.getAttributes().put(key,ByteBuffer.wrap(_address.toString().getBytes())); - if (either.isA()) { - Assert.fail(); - } - editIndex(parent, _address, _address.toString(), key); - parent = either.b(); - - if (_curY == _maxHeight) { - return parent; - } - - for (int i = 0; i < _curY + 1; i++) { - TreeNode ch = createTree(i, _curY + 1, _maxHeight, _address.add(i)); - either = parent.getChildren().addNewChildAt(i, ch); - if (either.isA()) { - Assert.fail(); - } - - parent = either.b(); - } - - return parent; - } - - - public void editIndex(TreeNode node, NodePath path, String attribute,String key) { - - Pair<TreeNode, NodePath> pair = new Pair<TreeNode, NodePath>(node, path); - Option<TreeMap<String, List<Pair<TreeNode, NodePath>>>> opAttributeList = index.get(key); - - if (opAttributeList.isNone()) { - TreeMap<String, List<Pair<TreeNode, NodePath>>> nodeIndex = TreeMap.empty(Ord.stringOrd); - List<Pair<TreeNode, NodePath>> list = List.nil(); - list = list.cons(pair); - nodeIndex = nodeIndex.set(attribute, list); - index = index.set(key, nodeIndex); - } else { - TreeMap<String, List<Pair<TreeNode, NodePath>>> indexMap = opAttributeList.some(); - Option<List<Pair<TreeNode, NodePath>>> opNodeIndex = indexMap.get(attribute); - - if (opNodeIndex.isNone()) { - List<Pair<TreeNode, NodePath>> pairList = List.nil(); - pairList = pairList.cons(pair); - indexMap = indexMap.set(attribute, pairList); - - } else { - List<Pair<TreeNode, NodePath>> pairList = opNodeIndex.some(); - pairList = pairList.cons(pair); - indexMap = indexMap.set(attribute, pairList); - } - index = index.set(key, indexMap); - } - System.out.println(attribute); - - } - -}