/**
 * An interface to describe which services a digital component must offer.
 * <BR>You can read the source of this class <A HREF="./DigitalComponent.java.html"> here</A>.
 */
public interface DigitalComponent {

	/**
	 * Connects pin LocalPin of the component to pin RemotePin of an other component.
	 * @return false if the requested pin is already connected on one of the components.
	 */
	public boolean connectPin(int LocalPin, DigitalComponent c, int RemotePin, boolean InitialState);


	/**
	 * Sets pin p of the component to the requested state.
	 * There is no use of a getPinState method because a component which changes the state of one of
	 * his pins immediatly tells the other component what it has just done.
	 */
	public void setPinState(int p, boolean state);

	/**
	 * Sets pin p of the component to the requested state without notifying the caller,
	 * this is used by the notifying routine of the Pin, so you should add here the code handling
	 * the response of the DigitalComponent to a change on its pins.
	 */
	public void setPinStateDontNotify(int p, boolean state);

	/**
	 * Returns true if the pin p is already connected on the component.
	 */
	public boolean isPinConnected(int p);

	/**
	 * This method is called by a PIC at each instruction execution if the component asked so.
	 */
	public void notifyOneCycle();

	/**
	 * Returns the state of the component.
	 */
	public String getState();
}