Class Logic
java.lang.Object
|
+--Logic
- class Logic
- extends java.lang.Object
Logic is the main class for handling the logical portion of GateBuilder,
it will handle all calculations done with the logic gate constructs
Field Summary |
(package private) java.util.Vector |
allGates
|
(package private) java.util.Vector |
inputGates
|
Constructor Summary |
(package private) |
Logic()
|
Method Summary |
void |
addObject(java.lang.Object target)
target is a graphical gate - check it's type, then make a new logic
gate of the equivalent type and add it to the apropriate vectors. |
boolean |
calculate()
calculate is the primary method in the logic class. |
void |
clear()
|
void |
connect(java.lang.Object source,
java.lang.Object destination)
|
void |
disconnect(java.lang.Object source,
java.lang.Object destination)
|
void |
removeObject(java.lang.Object target)
|
void |
toggleInput(java.lang.Object input)
|
Methods inherited from class java.lang.Object |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
inputGates
java.util.Vector inputGates
allGates
java.util.Vector allGates
Logic
Logic()
clear
public void clear()
calculate
public boolean calculate()
- calculate is the primary method in the logic class. It goes through
all the gates and has them calculate their values. Basically it
calls calculate on all the basic input gates, these gates will call
calculate on all the gates they output to, and so on down the line.
addObject
public void addObject(java.lang.Object target)
- target is a graphical gate - check it's type, then make a new logic
gate of the equivalent type and add it to the apropriate vectors.
removeObject
public void removeObject(java.lang.Object target)
connect
public void connect(java.lang.Object source,
java.lang.Object destination)
disconnect
public void disconnect(java.lang.Object source,
java.lang.Object destination)
toggleInput
public void toggleInput(java.lang.Object input)