19 lines
429 B
Java
19 lines
429 B
Java
public class OrGate extends LogicGate {
|
|
public OrGate(final int inputnr) {
|
|
super(inputnr);
|
|
}
|
|
|
|
public OrGate(final DigitalInput... inputvals) {
|
|
super(inputvals);
|
|
}
|
|
|
|
@Override
|
|
public boolean getOutput() {
|
|
boolean state = getInput(0).getValue();
|
|
for (int i = 1; i < getInputNumber(); i++) {
|
|
state |= getInput(i).getValue();
|
|
}
|
|
return state;
|
|
}
|
|
}
|