345
|
1 package alice.codesegment;
|
|
2
|
|
3 import java.util.ArrayList;
|
|
4
|
|
5 import alice.codesegment.InputDataSegment;
|
|
6 import alice.datasegment.Receiver;
|
|
7
|
|
8 public abstract class CodeSegment implements Runnable {
|
|
9
|
|
10 public InputDataSegment ids = new InputDataSegment(this);
|
|
11 public OutputDataSegment ods = new OutputDataSegment();
|
|
12 public ArrayList<Receiver> list = new ArrayList<Receiver>();
|
|
13
|
|
14 public void execute() {
|
|
15 ids.receive();
|
|
16 }
|
|
17
|
|
18 public void recycle(){
|
|
19 ids.init();
|
|
20 ids.setCounter(list.size());
|
|
21 for (Receiver receiver : list) {
|
|
22 ids.recommand(receiver);
|
|
23 }
|
|
24 }
|
|
25
|
|
26 }
|