Mercurial > hg > Database > jungle-network
diff src/jungle/test/codesegment/operation/ShowAttribute.java @ 27:0493340583ab
move some files
author | one |
---|---|
date | Mon, 01 Jul 2013 04:27:11 +0900 |
parents | src/jungle/test/codesegment/practice/ShowAttribute.java@1d7f52c3b3d9 |
children | 10359a815068 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jungle/test/codesegment/operation/ShowAttribute.java Mon Jul 01 04:27:11 2013 +0900 @@ -0,0 +1,43 @@ +package jungle.test.codesegment.operation; + +import java.nio.ByteBuffer; + +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.util.Either; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Error; +import alice.codesegment.CodeSegment; +import alice.datasegment.CommandType; +import alice.datasegment.Receiver; + +public class ShowAttribute extends CodeSegment { + + Receiver arg1 = ids.create(CommandType.TAKE); + + public ShowAttribute() { + arg1.setKey("show"); + } + + public void run() { + System.out.println("--ShowAttribute--"); + + Jungle jungle = new JungleManager().getJungle(); + JungleTree tree = jungle.getTreeByName("tree"); + Node node = tree.getRootNode(); + Children<Node> chs = node.getChildren(); + System.out.println("children size : "+chs.size()); + for(Node n : chs) { + ByteBuffer b = n.getAttributes().get("key1"); + System.out.println(new String(b.array())); + } + + System.exit(0); + + + } + +}