annotate paper/source/MulticastIncrement.java @ 6:3c415702fab0

modify chapter3
author sugi
date Tue, 06 Jan 2015 12:47:49 +0900
parents
children cefaf86da446
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6
3c415702fab0 modify chapter3
sugi
parents:
diff changeset
1 public class MulticastIncrement extends CodeSegment {
3c415702fab0 modify chapter3
sugi
parents:
diff changeset
2
3c415702fab0 modify chapter3
sugi
parents:
diff changeset
3 private Receiver num = ids.create(CommandType.TAKE);
3c415702fab0 modify chapter3
sugi
parents:
diff changeset
4
3c415702fab0 modify chapter3
sugi
parents:
diff changeset
5 public MutlicastIncrement() {
3c415702fab0 modify chapter3
sugi
parents:
diff changeset
6 num.setKey("multicast", "num");
3c415702fab0 modify chapter3
sugi
parents:
diff changeset
7 }
3c415702fab0 modify chapter3
sugi
parents:
diff changeset
8
3c415702fab0 modify chapter3
sugi
parents:
diff changeset
9 @Override
3c415702fab0 modify chapter3
sugi
parents:
diff changeset
10 public void run() {
3c415702fab0 modify chapter3
sugi
parents:
diff changeset
11 int num = this.num.asInteger();
3c415702fab0 modify chapter3
sugi
parents:
diff changeset
12 System.out.println("[CodeSegment] " + num);
3c415702fab0 modify chapter3
sugi
parents:
diff changeset
13 if (num == 10) System.exit(0);
3c415702fab0 modify chapter3
sugi
parents:
diff changeset
14
3c415702fab0 modify chapter3
sugi
parents:
diff changeset
15 new MulticastIncrement();
3c415702fab0 modify chapter3
sugi
parents:
diff changeset
16
3c415702fab0 modify chapter3
sugi
parents:
diff changeset
17 ods.put("multicast", "num", ++num);
3c415702fab0 modify chapter3
sugi
parents:
diff changeset
18 }
3c415702fab0 modify chapter3
sugi
parents:
diff changeset
19
3c415702fab0 modify chapter3
sugi
parents:
diff changeset
20 }