/*
 * 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 Inverter extends Gate {
	public void update() {
		Message[] r = new Message[2];
		
		Message ma = this.getConnector(0).receive(this);
		Message mb = this.getConnector(1).receive(this);
		
		r[1] = new Message(ma.getP(1),ma.getP(0));
		r[0] = new Message(mb.getP(1),mb.getP(0));
		
		this.setResult(r);
	}
}
