Update Thread.java

Added preliminary stuff for on/off state detection