annotate src/alice/topology/node/Start.java @ 35:ac3b48c5f4da

share width each other with tree
author kazz <kazz@cr.ie.u-ryukyu.ac.jp>
date Fri, 20 Jan 2012 04:00:12 +0900
parents
children ae24d5d40c10
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
35
ac3b48c5f4da share width each other with tree
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 package alice.topology.node;
ac3b48c5f4da share width each other with tree
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2
ac3b48c5f4da share width each other with tree
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 import alice.codesegment.CodeSegment;
ac3b48c5f4da share width each other with tree
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 import alice.datasegment.CommandType;
ac3b48c5f4da share width each other with tree
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 import alice.datasegment.Receiver;
ac3b48c5f4da share width each other with tree
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6
ac3b48c5f4da share width each other with tree
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 public class Start extends CodeSegment {
ac3b48c5f4da share width each other with tree
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8
ac3b48c5f4da share width each other with tree
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 public Receiver done = ids.create(CommandType.PEEK);
ac3b48c5f4da share width each other with tree
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10
ac3b48c5f4da share width each other with tree
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 private Class<? extends CodeSegment> clazz;
ac3b48c5f4da share width each other with tree
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12
ac3b48c5f4da share width each other with tree
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 public Start(Class<? extends CodeSegment> clazz) {
ac3b48c5f4da share width each other with tree
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 this.clazz = clazz;
ac3b48c5f4da share width each other with tree
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 }
ac3b48c5f4da share width each other with tree
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16
ac3b48c5f4da share width each other with tree
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 @Override
ac3b48c5f4da share width each other with tree
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 public void run() {
ac3b48c5f4da share width each other with tree
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 System.out.println("Start!");
ac3b48c5f4da share width each other with tree
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 if (clazz == null)
ac3b48c5f4da share width each other with tree
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 return;
ac3b48c5f4da share width each other with tree
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 try {
ac3b48c5f4da share width each other with tree
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 clazz.newInstance().execute();
ac3b48c5f4da share width each other with tree
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 } catch (InstantiationException e) {
ac3b48c5f4da share width each other with tree
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 e.printStackTrace();
ac3b48c5f4da share width each other with tree
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 } catch (IllegalAccessException e) {
ac3b48c5f4da share width each other with tree
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 e.printStackTrace();
ac3b48c5f4da share width each other with tree
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 }
ac3b48c5f4da share width each other with tree
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
29
ac3b48c5f4da share width each other with tree
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 }
ac3b48c5f4da share width each other with tree
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
31
ac3b48c5f4da share width each other with tree
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 }