Completely changed the structure and switched to Eclipse Plugin.
[Mograsim.git] / net.mograsim.logic.core / src / net / mograsim / logic / core / components / ManualSwitch.java
index e3ae372..83842dd 100644 (file)
@@ -56,6 +56,16 @@ public class ManualSwitch extends Component implements LogicObservable
                notifyObservers();
        }
 
+       public void setToValueOf(Bit bit)
+       {
+               if (bit == Bit.ONE)
+                       switchOn();
+               else if (bit == Bit.ZERO)
+                       switchOff();
+               else
+                       throw new IllegalArgumentException("Cannot set ManualSwitch to the value of Bit " + bit);
+       }
+
        public boolean isOn()
        {
                return isOn;