137
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1 package christie.example.OddEven;
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
2
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
3 import christie.annotation.Peek;
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
4 import christie.annotation.Take;
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
5 import christie.codegear.CodeGear;
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
6 import christie.codegear.CodeGearManager;
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
7
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
8 public class OddCodeGear extends CodeGear {
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
9 @Take
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
10 int odd;
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
11
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
12 @Peek
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
13 int finishCount;
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
14
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
15 @Override
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
16 protected void run(CodeGearManager cgm) {
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
17 System.out.println(odd + " : odd");
|
143
|
18 if (finishCount + 1 != odd) {
|
137
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
19 getDGM("even").put("even", odd + 1);
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
20 cgm.setup(new OddCodeGear());
|
143
|
21 }
|
137
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
22 }
|
ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
23 }
|