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(){
|
|
15 arg1.setKey("key1", arg1.index);
|
|
16 }
|
|
17
|
|
18 @Override
|
|
19 public void run() {
|
|
20 System.out.println("type = " + arg1.type);
|
|
21 System.out.println("index = " + arg1.index);
|
|
22 System.out.println("data = " + arg1.getVal());
|
|
23 System.out.println(((Value)arg1.getVal()).getType());
|
418
|
24 System.out.println(MetaCodeSegment.class);
|
417
|
25
|
|
26 if (arg1.index == 10) {
|
|
27 System.exit(0);
|
|
28 return;
|
|
29 }
|
|
30
|
|
31 // DataSegment.get("local").update
|
|
32 ods.update("local", "key1", "String data");
|
|
33 //this.recycle();
|
|
34 }
|
412
|
35
|
|
36 } |