Class DigitalComponent_std

java.lang.Object
  |
  +--DigitalComponent_std
Direct Known Subclasses:
DigitalAnalyser, MatricialKeyboard, PIC_std, RemotedTI, TcpIpComponent

public class DigitalComponent_std
extends java.lang.Object
implements DigitalComponent

This class can be the super class of all DigitalComponents implementing DigitalComponent and implements all the required services (which can be redefined for the daughter). An instance of this class can be used to avoid leaving unconnecting pins on a DigitalComponent.
You can read the source of this class here.


Constructor Summary
DigitalComponent_std(int n)
           
DigitalComponent_std(int n, DigitalComponentUI dui)
           
 
Method Summary
 boolean connectPin(int LocalPin, DigitalComponent c, int RemotePin, boolean InitialState)
          Connects pin LocalPin of the component to pin RemotePin of an other component.
 java.lang.String getState()
          Returns the state of the component.
 boolean isPinConnected(int p)
          Returns true if the pin p is already connected on the component.
 void notifyOneCycle()
          This method is called by a PIC at each instruction execution if the component asked so.
 void refreshDisplay()
           
 void setPinState(int p, boolean state)
          Sets pin p of the component to the requested state.
 void setPinStateDontNotify(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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DigitalComponent_std

public DigitalComponent_std(int n)

DigitalComponent_std

public DigitalComponent_std(int n,
                            DigitalComponentUI dui)
Method Detail

connectPin

public boolean connectPin(int LocalPin,
                          DigitalComponent c,
                          int RemotePin,
                          boolean InitialState)
Description copied from interface: DigitalComponent
Connects pin LocalPin of the component to pin RemotePin of an other component.
Specified by:
connectPin in interface DigitalComponent
Tags copied from interface: DigitalComponent
Returns:
false if the requested pin is already connected on one of the components.

setPinStateDontNotify

public void setPinStateDontNotify(int p,
                                  boolean state)
Description copied from interface: DigitalComponent
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.
Specified by:
setPinStateDontNotify in interface DigitalComponent

setPinState

public void setPinState(int p,
                        boolean state)
Description copied from interface: DigitalComponent
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.
Specified by:
setPinState in interface DigitalComponent

isPinConnected

public boolean isPinConnected(int p)
Description copied from interface: DigitalComponent
Returns true if the pin p is already connected on the component.
Specified by:
isPinConnected in interface DigitalComponent

getState

public java.lang.String getState()
Description copied from interface: DigitalComponent
Returns the state of the component.
Specified by:
getState in interface DigitalComponent

notifyOneCycle

public void notifyOneCycle()
Description copied from interface: DigitalComponent
This method is called by a PIC at each instruction execution if the component asked so.
Specified by:
notifyOneCycle in interface DigitalComponent

refreshDisplay

public void refreshDisplay()