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 Inverter extends Gate {
	private Gate			input;
	
	public Inverter() {
	}
	
	public Inverter(Gate input) {
		this.setInputGate(input);
	}
	
	public void setInputGate(Gate input) {
		this.input = input;
	}

	public void update() {
		Message m = this.input.getValue();
		this.setResult(new Message(m.getP(1),m.getP(0)));
	}	
}
