13 lines
392 B
Java
Raw Normal View History

2015-06-15 17:47:35 -07:00
//: exceptions/Switch.java
// <20>2015 MindView LLC: see Copyright.txt
import static com.mindviewinc.util.Print.*;
public class Switch {
private boolean state = false;
public boolean read() { return state; }
public void on() { state = true; print(this); }
public void off() { state = false; print(this); }
@Override
public String toString() { return state ? "on" : "off"; }
} ///:~