annotate src/test/java/alice/jungle/log/example/codesement/operation/ShowAttribute.java @ 82:60d28fedcbf2

Remove unnecessary files and move some files
author one
date Wed, 16 Oct 2013 20:53:44 +0900
parents src/jungle/test/codesegment/operation/ShowAttribute.java@29127ac788a6
children f9e29a52efd3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
82
60d28fedcbf2 Remove unnecessary files and move some files
one
parents: 66
diff changeset
1 package test.java.alice.jungle.log.example.codesement.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;
66
29127ac788a6 move some files
one
parents: 45
diff changeset
13 import jungle.app.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
45
bf3dc481cc9b modified JungleManager to singleton
one
parents: 39
diff changeset
29 Jungle jungle = JungleManager.getJungle();
21
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 }