Mercurial > hg > Database > Alice
annotate src/alice/test/codesegment/local/TestCodeSegment.java @ 57:7fa9ddb31f64
add comment
author | one |
---|---|
date | Wed, 08 Feb 2012 16:07:33 +0900 |
parents | ca079a730d0b |
children | a3a2605e16a2 |
rev | line source |
---|---|
22
2ca2d961a8d2
implements outline of TopologyManager
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
19
diff
changeset
|
1 package alice.test.codesegment.local; |
3 | 2 |
3 import alice.codesegment.CodeSegment; | |
18
72dd27d952b0
change InputDataSegment API
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
16
diff
changeset
|
4 import alice.datasegment.CommandType; |
33
20c67f673224
change name of DataSegmentReceiver
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
5 import alice.datasegment.Receiver; |
3 | 6 |
7 public class TestCodeSegment extends CodeSegment { | |
8 | |
57 | 9 // create input datasegment arg1 |
33
20c67f673224
change name of DataSegmentReceiver
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
10 Receiver arg1 = ids.create(CommandType.PEEK); |
16 | 11 |
3 | 12 @Override |
13 public void run() { | |
18
72dd27d952b0
change InputDataSegment API
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
16
diff
changeset
|
14 System.out.println("index = " + arg1.index); |
72dd27d952b0
change InputDataSegment API
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
16
diff
changeset
|
15 System.out.println("data = " + arg1.val); |
72dd27d952b0
change InputDataSegment API
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
16
diff
changeset
|
16 System.out.println(arg1.val.getType()); |
9 | 17 |
18
72dd27d952b0
change InputDataSegment API
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
16
diff
changeset
|
18 if (arg1.index == 10) { |
12 | 19 System.exit(0); |
20 return; | |
21 } | |
9 | 22 |
18
72dd27d952b0
change InputDataSegment API
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
16
diff
changeset
|
23 TestCodeSegment cs = new TestCodeSegment(); |
72dd27d952b0
change InputDataSegment API
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
16
diff
changeset
|
24 cs.arg1.setKey("local", "key1", arg1.index); |
9 | 25 |
57 | 26 // DataSegment.get("local").update |
34
ca079a730d0b
added method to OutputDataSegment and Receiver, to convert type from Value to Class<?> without MessagePack
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
33
diff
changeset
|
27 ods.update("local", "key1", "String data"); |
3 | 28 } |
29 | |
30 } |