- if (bit == Bit.ONE)
- switchOn();
- else if (bit == Bit.ZERO)
- switchOff();
- else
- throw new IllegalArgumentException("Cannot set ManualSwitch to the value of Bit " + bit);
+ if (bits.length() != output.width())
+ throw new IllegalArgumentException("Incorrect bit vector length");
+ if (bits.equals(output.getInputValues()))
+ return;
+ output.feedSignals(bits);
+ notifyObservers();