|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--LogicGate
Field Summary | |
protected boolean |
calculated
True if the gate has been calculated since the last time it was reset |
protected GraphicGate |
equivGate
reference to the equivalent graphics gate |
protected int |
gateType
Stores the type of Gate. |
protected int |
id
the id number of the gate. |
protected LogicGate |
inputOne
reference to gates providing input |
protected LogicGate |
inputTwo
|
protected boolean |
lastOutputValue
|
protected java.util.Vector |
outputs
vector of all the gates output to |
protected boolean |
outputValue
holds the output of the gate |
protected boolean |
sequential
If true the gate is sequential, that is that it is in a loop from its output to its input. |
Constructor Summary | |
(package private) |
LogicGate()
basic constructor will not be used |
(package private) |
LogicGate(java.lang.Object linkGate)
Constructor that will always be used, it takes a graphical gate as its only argument which it will use as its equivalent gate |
Method Summary | |
void |
addInput(LogicGate newIn)
Add an input to the gate |
void |
addOutput(LogicGate newOut)
add a reference to a gate to output to |
void |
calcOutputs()
This is basically a helper function for the extended classes when they calculate. |
(package private) void |
calculate()
defined in each extended class will calculate the gate's output value |
(package private) void |
determineSequential(LogicGate checkGate)
This method determines whether the gate sent to it as checkGate is is part of an input output loop which would mean that it is a sequential gate. |
(package private) abstract void |
evaluate()
|
boolean |
getOutputValue()
|
(package private) void |
printInfo()
|
void |
removeInput(LogicGate oldIn)
removes oldIn from the gate |
void |
removeOutput(LogicGate oldOut)
remove a gate from the outputs of a gate. |
void |
resetCalculated()
resets the calculated variable to false |
boolean |
returnOutput(LogicGate callingGate)
returns the last output the gate calculated. |
void |
unlinkGates()
unlinkGate takes all the gates that link to the gate as an input or an output and removes those links |
Methods inherited from class java.lang.Object |
|
Field Detail |
protected int id
protected boolean outputValue
protected boolean lastOutputValue
protected GraphicGate equivGate
protected java.util.Vector outputs
protected LogicGate inputOne
protected LogicGate inputTwo
protected boolean calculated
protected int gateType
protected boolean sequential
Constructor Detail |
LogicGate()
LogicGate(java.lang.Object linkGate)
Method Detail |
void calculate()
abstract void evaluate()
public void addOutput(LogicGate newOut)
public void removeOutput(LogicGate oldOut)
public void addInput(LogicGate newIn)
public void removeInput(LogicGate oldIn)
public void unlinkGates()
public boolean returnOutput(LogicGate callingGate)
public boolean getOutputValue()
public void resetCalculated() throws calculateException
public void calcOutputs()
void determineSequential(LogicGate checkGate)
void printInfo()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |