comparison src/main/java/jp/ac/u_ryukyu/ie/cr/tatsuki/jungle/store/index/AddNewChildrenIndexEditor.java @ 139:ec166c8ff079

add findAll and findInSubTreeAll
author one
date Tue, 28 Oct 2014 06:35:34 +0900
parents 6e9a8d26e0cf
children afbe19c98f53 72f454eb04ec
comparison
equal deleted inserted replaced
138:b998fdc99bc0 139:ec166c8ff079
56 56
57 for (String innerIndexKey : innerIndexKeyList) { 57 for (String innerIndexKey : innerIndexKeyList) {
58 List<Pair<TreeNode, NodePath>> pairList = innerIndex.get(innerIndexKey).some(); 58 List<Pair<TreeNode, NodePath>> pairList = innerIndex.get(innerIndexKey).some();
59 List<Pair<TreeNode, NodePath>> list = checkPath(pairList); 59 List<Pair<TreeNode, NodePath>> list = checkPath(pairList);
60 if (!list.isEmpty()){ 60 if (!list.isEmpty()){
61 System.out.println(new String(list.head().left().getAttributes().get("KEY").array())); 61 //System.out.println(new String(list.head().left().getAttributes().get("KEY").array()));
62 newInnerIndex = newInnerIndex.set(innerIndexKey, list); 62 newInnerIndex = newInnerIndex.set(innerIndexKey, list);
63 } 63 }
64 } 64 }
65 newIndex = newIndex.set(indexKey, newInnerIndex); 65 newIndex = newIndex.set(indexKey, newInnerIndex);
66 } 66 }
74 74
75 List<Pair<TreeNode, NodePath>> list = List.nil(); 75 List<Pair<TreeNode, NodePath>> list = List.nil();
76 for (Pair<TreeNode, NodePath> pair : pairList) { 76 for (Pair<TreeNode, NodePath> pair : pairList) {
77 77
78 NodePath path = pair.right(); 78 NodePath path = pair.right();
79 System.out.println("oldPath = " + path.toString()); 79 //System.out.println("oldPath = " + path.toString());
80 NodePath newPath = new DefaultNodePath(); 80 NodePath newPath = new DefaultNodePath();
81 81
82 82
83 if (editNodePath.size() > path.size()) { 83 if (editNodePath.size() > path.size()) {
84 list = list.cons(pair); 84 list = list.cons(pair);
110 110
111 newPath = newPath.add(pathInt); 111 newPath = newPath.add(pathInt);
112 112
113 } 113 }
114 114
115 System.out.println("newPath = " + newPath.toString()); 115 //System.out.println("newPath = " + newPath.toString());
116 Pair<TreeNode, NodePath> newPair = new Pair<TreeNode, NodePath>(pair.left(), newPath); 116 Pair<TreeNode, NodePath> newPair = new Pair<TreeNode, NodePath>(pair.left(), newPath);
117 list = list.cons(newPair); 117 list = list.cons(newPair);
118 } 118 }
119 119
120 return list; 120 return list;