view src/alice/codesegment/CodeSegment.java @ 313:4b99234c88d4

add init method for ids.
author sugi
date Tue, 03 Dec 2013 21:34:42 +0900
parents 26006214cf3b
children f1f0638861ab
line wrap: on
line source

package alice.codesegment;

import java.util.ArrayList;

import alice.codesegment.InputDataSegment;
import alice.datasegment.Receiver;

public abstract class CodeSegment implements Runnable {
	
	public InputDataSegment ids = new InputDataSegment(this);
	public OutputDataSegment ods = new OutputDataSegment();
	public ArrayList<Receiver> list = new ArrayList<Receiver>();
	
	public void execute() {
		ids.receive();
	}
	
	public void recycle(){
		ids.initCounter();
		ids.setCounter(list.size());
		for (Receiver receiver : list) {
			ids.recommand(receiver);
		}
	}

}