Mercurial > hg > Database > Alice
annotate src/main/java/alice/test/codesegment/local/TestCodeSegment.java @ 547:e91a574b69de dispose
remove index
author | Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 18 Aug 2015 16:15:17 +0900 |
parents | 15eeb439830c |
children | b44a2bf16eb3 |
rev | line source |
---|---|
345 | 1 package alice.test.codesegment.local; |
2 | |
3 import alice.codesegment.CodeSegment; | |
545
074c6716f906
add AliceDeamon on paramater. not working TestLocalAlice
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents:
523
diff
changeset
|
4 import alice.daemon.AliceDaemon; |
345 | 5 import alice.datasegment.CommandType; |
6 import alice.datasegment.Receiver; | |
7 import org.msgpack.type.Value; | |
8 | |
9 public class TestCodeSegment extends CodeSegment { | |
419 | 10 |
11 // create input datasegment arg1 | |
523
145c425db88d
add CompressedLDSM
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents:
419
diff
changeset
|
12 Receiver arg1 = ids.create(CommandType.PEEK);//peek用Receiverを生成 |
419 | 13 |
14 @Override | |
15 public void run() { | |
547 | 16 System.out.println("in TestCodeSegment"); |
419 | 17 System.out.println("type = " + arg1.type); |
547 | 18 //System.out.println("index = " + arg1.index); |
19 int num = arg1.asInteger(); | |
20 System.out.println("data = " + num); | |
523
145c425db88d
add CompressedLDSM
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents:
419
diff
changeset
|
21 System.out.println(((Value)arg1.getVal()).getType());//←伝統。なくてもいい。 |
419 | 22 |
547 | 23 if (num++ == 10) { |
419 | 24 System.exit(0); |
25 return; | |
26 } | |
27 | |
28 TestCodeSegment cs = new TestCodeSegment(); | |
546
15eeb439830c
setAliceDaemon in setKey
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents:
545
diff
changeset
|
29 //cs.ids.setAliceDaemon(this); |
547 | 30 cs.arg1.setKey("key1", this);//Receiverに値をpeekしてくる |
419 | 31 |
32 // DataSegment.get("local").update | |
547 | 33 ods.update("local", "key1", num); |
419 | 34 } |
345 | 35 |
36 } |