package ps6;
/*
 * Created on Apr 3, 2005
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
/**
 * @author knorton
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class Probe extends Gate {
	private Gate			input;
	private String		name;
	
	public Probe(String name) {
		this.name  = name;
	}
	
	public Probe(Gate input, String name) {
		this.name = name;
		this.input = input;
	}
	
	public void setInputGate(Gate input) {
		this.input = input;
	}
	
	public void update() {
		this.setResult(new Message(this.input.getValue()));
	}

	public void commit() {
		super.commit();
		System.out.println(this.name+" = "+this.getValue());
	}

}
