annotate src/jungle/test/codesegment/operation/ShowAttribute.java @ 39:10359a815068

add alice.jungle.codesegment.remote
author one
date Tue, 09 Jul 2013 15:10:06 +0900
parents 0493340583ab
children bf3dc481cc9b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27
0493340583ab move some files
one
parents: 26
diff changeset
1 package jungle.test.codesegment.operation;
21
1abbfc8f11f2 add ShowAttribute
one
parents:
diff changeset
2
1abbfc8f11f2 add ShowAttribute
one
parents:
diff changeset
3 import java.nio.ByteBuffer;
1abbfc8f11f2 add ShowAttribute
one
parents:
diff changeset
4
1abbfc8f11f2 add ShowAttribute
one
parents:
diff changeset
5 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.Jungle;
1abbfc8f11f2 add ShowAttribute
one
parents:
diff changeset
6 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.JungleTree;
1abbfc8f11f2 add ShowAttribute
one
parents:
diff changeset
7 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.JungleTreeEditor;
1abbfc8f11f2 add ShowAttribute
one
parents:
diff changeset
8 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Children;
1abbfc8f11f2 add ShowAttribute
one
parents:
diff changeset
9 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Node;
1abbfc8f11f2 add ShowAttribute
one
parents:
diff changeset
10 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.DefaultNodePath;
1abbfc8f11f2 add ShowAttribute
one
parents:
diff changeset
11 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Either;
1abbfc8f11f2 add ShowAttribute
one
parents:
diff changeset
12 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Error;
39
10359a815068 add alice.jungle.codesegment.remote
one
parents: 27
diff changeset
13 import jungle.test.bbs.JungleManager;
21
1abbfc8f11f2 add ShowAttribute
one
parents:
diff changeset
14 import alice.codesegment.CodeSegment;
1abbfc8f11f2 add ShowAttribute
one
parents:
diff changeset
15 import alice.datasegment.CommandType;
1abbfc8f11f2 add ShowAttribute
one
parents:
diff changeset
16 import alice.datasegment.Receiver;
1abbfc8f11f2 add ShowAttribute
one
parents:
diff changeset
17
1abbfc8f11f2 add ShowAttribute
one
parents:
diff changeset
18 public class ShowAttribute extends CodeSegment {
1abbfc8f11f2 add ShowAttribute
one
parents:
diff changeset
19
1abbfc8f11f2 add ShowAttribute
one
parents:
diff changeset
20 Receiver arg1 = ids.create(CommandType.TAKE);
1abbfc8f11f2 add ShowAttribute
one
parents:
diff changeset
21
1abbfc8f11f2 add ShowAttribute
one
parents:
diff changeset
22 public ShowAttribute() {
1abbfc8f11f2 add ShowAttribute
one
parents:
diff changeset
23 arg1.setKey("show");
1abbfc8f11f2 add ShowAttribute
one
parents:
diff changeset
24 }
1abbfc8f11f2 add ShowAttribute
one
parents:
diff changeset
25
1abbfc8f11f2 add ShowAttribute
one
parents:
diff changeset
26 public void run() {
1abbfc8f11f2 add ShowAttribute
one
parents:
diff changeset
27 System.out.println("--ShowAttribute--");
1abbfc8f11f2 add ShowAttribute
one
parents:
diff changeset
28
1abbfc8f11f2 add ShowAttribute
one
parents:
diff changeset
29 Jungle jungle = new JungleManager().getJungle();
1abbfc8f11f2 add ShowAttribute
one
parents:
diff changeset
30 JungleTree tree = jungle.getTreeByName("tree");
1abbfc8f11f2 add ShowAttribute
one
parents:
diff changeset
31 Node node = tree.getRootNode();
1abbfc8f11f2 add ShowAttribute
one
parents:
diff changeset
32 Children<Node> chs = node.getChildren();
26
1d7f52c3b3d9 fix variables name
one
parents: 25
diff changeset
33 System.out.println("children size : "+chs.size());
21
1abbfc8f11f2 add ShowAttribute
one
parents:
diff changeset
34 for(Node n : chs) {
25
2232263d449b print message in ShowAttribute
one
parents: 21
diff changeset
35 ByteBuffer b = n.getAttributes().get("key1");
2232263d449b print message in ShowAttribute
one
parents: 21
diff changeset
36 System.out.println(new String(b.array()));
21
1abbfc8f11f2 add ShowAttribute
one
parents:
diff changeset
37 }
1abbfc8f11f2 add ShowAttribute
one
parents:
diff changeset
38
1abbfc8f11f2 add ShowAttribute
one
parents:
diff changeset
39 System.exit(0);
1abbfc8f11f2 add ShowAttribute
one
parents:
diff changeset
40
1abbfc8f11f2 add ShowAttribute
one
parents:
diff changeset
41
1abbfc8f11f2 add ShowAttribute
one
parents:
diff changeset
42 }
1abbfc8f11f2 add ShowAttribute
one
parents:
diff changeset
43
1abbfc8f11f2 add ShowAttribute
one
parents:
diff changeset
44 }