Mercurial > hg > Members > tatsuki > jungle-bench
changeset 1:358d1797a35a
second commit
author | one |
---|---|
date | Tue, 04 Mar 2014 01:58:37 +0900 |
parents | 81d5bb6831b2 |
children | f716298e440a |
files | src/main/java/example/SimpleJungle.java |
diffstat | 1 files changed, 34 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/example/SimpleJungle.java Tue Mar 04 01:32:38 2014 +0900 +++ b/src/main/java/example/SimpleJungle.java Tue Mar 04 01:58:37 2014 +0900 @@ -6,6 +6,7 @@ import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.Jungle; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.JungleTree; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.JungleTreeEditor; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Children; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Node; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.DefaultNodePath; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.DefaultTreeEditor; @@ -39,5 +40,38 @@ ByteBuffer v = node.getAttributes().get(key); System.out.println(new String(v.array())); + editor1 = tree.getTreeEditor(); + either = editor1.addNewChildAt(root,0); + if(either.isA()){ + Assert.fail(); + } + + editor1 = either.b(); + either = editor1.success(); + if(either.isA()){ + Assert.fail(); + } + + editor1 = tree.getTreeEditor(); + DefaultNodePath childPath = root.add(0); + either = editor1.putAttribute(childPath,key,value); + if(either.isA()){ + Assert.fail(); + } + + editor1 = either.b(); + either = editor1.success(); + if(either.isA()){ + Assert.fail(); + } + node = tree.getRootNode(); + Children<Node> children = node.getChildren(); + Either<Error,Node> either2 = children.at(0); + if(either2.isA()){ + Assert.fail(); + } + Node childNode = either2.b(); + ByteBuffer v2 = childNode.getAttributes().get(key); + System.out.println(new String(v2.array())); } }