/*
 * Created on Apr 4, 2005
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package ps6.v2;

import ps6.Message;

/**
 * @author knorton
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class Evidence extends Gate {
	
	private Message		message;
	
	public Evidence(Message m) {
		this.message = m;
	}
	
	public void connect(Connector c) {
	    super.connect(c);
	    c.send(this,this.message);
	}
	
	public void update() {
		int n = this.connects.size();
		Message[] r = new Message[n];
		
		for (int i=0;i<n;i++)
			r[i] = this.message;
		
		this.setResult(r);
	}

}
