345
|
1 package alice.test.codesegment.remote;
|
|
2
|
|
3 import alice.codesegment.CodeSegment;
|
|
4 import alice.datasegment.CommandType;
|
|
5 import alice.datasegment.Receiver;
|
|
6
|
|
7 public class RemoteIncrement extends CodeSegment {
|
|
8
|
|
9 public Receiver num = ids.create(CommandType.TAKE);
|
|
10
|
|
11 /**
|
|
12 * Increment DataSegment value up to 10
|
|
13 */
|
|
14 @Override
|
|
15 public void run() {
|
|
16 int num = this.num.asInteger();
|
|
17 System.out.println("[CodeSegment] " + num++);
|
|
18 if (num == 10) System.exit(0);
|
|
19
|
|
20 RemoteIncrement cs = new RemoteIncrement();
|
|
21 cs.num.setKey("remote", "num");
|
|
22
|
|
23 ods.put("local", "num", num);
|
|
24 }
|
|
25
|
|
26 }
|