12345678910111213141516171819202122232425262728293031323334353637 |
- package classes;
- public class HolonSwitch extends CpsObject {
- /*
- * True, if this wire is working (capable of carrying electricity), else
- * false
- */
- boolean isActive;
- public HolonSwitch(String ObjName) {
- super(ObjName);
- setState(false);
- }
- public HolonSwitch(String ObjName, String obj) {
- super(ObjName);
- super.setName(obj);
- setState(false);
- }
- public HolonSwitch(CpsObject obj) {
- super(obj);
- setState(((HolonSwitch)obj).getState());
- }
- public void switchState() {
- this.isActive = !isActive;
- }
- public boolean getState() {
- return this.isActive;
- }
-
- public void setState(boolean state){
- this.isActive = state;
- }
- }
|