Hi mates..
I have a small question..
I have now 3 different classes, sounds ok?
this is the 1st class, called "Wire"
public class Wire
{
private boolean Value;
public boolean isValue() {
return Value;
}
public void setValue(boolean value) {
Value = value;
}
}
This is the 2nd class, called "SingleInputGate"
public abstract class SingleInputGate implements LogicComponent
{
private Wire Input;
private Wire Output;
public Wire getInput() {
return Input;
}
public void setInput(Wire input) {
Input = input;
}
public Wire getOutput() {
return Output;
}
public void setOutput(Wire output) {
Output = output;
}
public SingleInputGate( Wire input, Wire output)
{
setInput( input );
setOutput( output );
}
public abstract void evaluate();
}
this is the last one, called "NotGate"
public class NotGate extends SingleInputGate
{
public NotGate( Wire input, Wire output )
{
super( input, output );
}
public void evaluate()
{
if( super.getInput() ) // HOW TO COMPARE!!!
{
}
}
}
As you can see, in the last class I've wrote a comment said "HOW TO COMPARE"!!
I want to compare the "super.getInput()" if it is "true" then the output will be "false", and if it is "false" the output will be "true".
Anyone can give tips on doing that?
Thanks..