Mercurial > hg > Members > shoshi > jungle > jungle-core
changeset 76:2fc0b0313dc0
Move to Bullet in Board
but has worning
line wrap: on
line diff
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/JungleTree.java Wed Aug 27 05:52:46 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/JungleTree.java Fri Aug 29 03:16:27 2014 +0900 @@ -1,10 +1,11 @@ package jp.ac.u_ryukyu.ie.cr.shoshi.jungle; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Node; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNode; -public interface JungleTree<T extends TreeNode<T>> +public interface JungleTree<T> { public JungleTreeEditor getTreeEditor(); public JungleTreeEditor getLocalTreeEditor(); - public TreeNode<T> getRootNode(); + public Node<T> getRootNode(); }
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/JungleTreeEditor.java Wed Aug 27 05:52:46 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/JungleTreeEditor.java Fri Aug 29 03:16:27 2014 +0900 @@ -2,6 +2,7 @@ import java.nio.ByteBuffer; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Node; 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.trasnformer.NodeEditor; @@ -10,7 +11,7 @@ public interface JungleTreeEditor<T extends TreeNode<T>> { - public TreeNode<T> getRoot(); + public Node<T> getRoot(); public Either<Error,JungleTreeEditor<T>> addNewChildAt(NodePath _path,int _pos); public Either<Error,JungleTreeEditor<T>> deleteChildAt(NodePath _path,int _pos);
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/core/App.java Wed Aug 27 05:52:46 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/core/App.java Fri Aug 29 03:16:27 2014 +0900 @@ -34,7 +34,7 @@ e.success(); - TreeNode<T> root = tree.getRootNode(); + Node<T> root = tree.getRootNode(); ByteBuffer v = root.getAttributes().get(key); String str = new String(v.array()); System.out.println(str);
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/core/Node.java Wed Aug 27 05:52:46 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/core/Node.java Fri Aug 29 03:16:27 2014 +0900 @@ -1,6 +1,6 @@ package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core; -public interface Node extends AttributesContainer , Parent<Node> +public interface Node<T> extends AttributesContainer , Parent<T> { } \ No newline at end of file
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/DefaultTreeEditor.java Wed Aug 27 05:52:46 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/DefaultTreeEditor.java Fri Aug 29 03:16:27 2014 +0900 @@ -63,7 +63,7 @@ T child = newNode; for(Direction<T> parentDirection : path.tail()){ TreeNodeChildren<T> chs = parentDirection.getTarget().getChildren(); - + Either<Error,T> ret = chs.replaceNode(pos,child); if(ret.isA()){ return DefaultEither.newA(ret.a());
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/EditableNodeWrapper.java Wed Aug 27 05:52:46 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/EditableNodeWrapper.java Fri Aug 29 03:16:27 2014 +0900 @@ -16,9 +16,9 @@ { private final T wrap; - public EditableNodeWrapper(T _wrap) + public EditableNodeWrapper(T target) { - wrap = _wrap; + wrap = target; } @Override @@ -42,7 +42,7 @@ { private final TreeNodeAttributes<T> attributes; - public EditableAttributesWrapper(T _wrap) + public EditableAttributesWrapper(TreeNode<T> _wrap) { attributes = _wrap.getAttributes(); }
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/TreeNode.java Wed Aug 27 05:52:46 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/TreeNode.java Fri Aug 29 03:16:27 2014 +0900 @@ -1,9 +1,10 @@ package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.AttributesContainer; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Node; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Parent; -public interface TreeNode<T extends TreeNode<T>> extends Parent<T> , AttributesContainer +public interface TreeNode<T extends TreeNode<T>> extends Parent<T> , AttributesContainer , Node<T> { @Override public TreeNodeChildren<T> getChildren();
--- a/src/test/java/DefaultJungleTreeTest.java Wed Aug 27 05:52:46 2014 +0900 +++ b/src/test/java/DefaultJungleTreeTest.java Fri Aug 29 03:16:27 2014 +0900 @@ -46,7 +46,7 @@ editor1.success(); // check the value ; - TreeNode<T> node = tree.getRootNode(); + Node<T> node = tree.getRootNode(); ByteBuffer v = node.getAttributes().get(key); Assert.assertEquals(0,v.compareTo(value));