412
|
1 package alice.test.reflection;
|
|
2
|
|
3 import org.msgpack.type.Value;
|
|
4
|
|
5 import alice.codesegment.CodeSegment;
|
|
6 import alice.datasegment.CommandType;
|
|
7 import alice.datasegment.Receiver;
|
|
8
|
|
9 public class MetaCodeSegment extends CodeSegment {
|
417
|
10
|
|
11 // create input datasegment arg1
|
|
12 Receiver arg1 = ids.create(CommandType.TAKE);
|
|
13
|
|
14 public MetaCodeSegment(){
|
547
|
15 arg1.setKey("key1", this);
|
417
|
16 }
|
|
17
|
547
|
18 int num = 0;
|
|
19
|
417
|
20 @Override
|
|
21 public void run() {
|
|
22 System.out.println("type = " + arg1.type);
|
547
|
23 //System.out.println("index = " + arg1.index);
|
417
|
24 System.out.println("data = " + arg1.getVal());
|
|
25 System.out.println(((Value)arg1.getVal()).getType());
|
467
|
26 System.out.println(MetaCodeSegment.class);
|
417
|
27
|
547
|
28 if (num++ == 10) {
|
417
|
29 System.exit(0);
|
|
30 return;
|
|
31 }
|
|
32
|
|
33 // DataSegment.get("local").update
|
|
34 ods.update("local", "key1", "String data");
|
|
35 //this.recycle();
|
|
36 }
|
412
|
37
|
|
38 } |