123456789101112131415161718192021222324252627282930313233343536373839 |
- package classes;
- public class HolonSwitch extends CpsObject {
- /*
- * True, if this wire is working (capable of carrying electricity), else
- * false
- */
-
-
- boolean active;
- 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.active = !active;
- }
- public boolean getState() {
- return this.active;
- }
-
- public void setState(boolean state){
- this.active = state;
- }
- }
|