sophware.home.lang
Class BinaryObject

java.lang.Object
  extended by sophware.home.lang.StateObject
      extended by sophware.home.lang.BinaryObject
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
BinaryGroup, Condition, HomeDevice, TimePeriod, Timer

public class BinaryObject
extends StateObject
implements java.io.Serializable

BinaryObject represents an object that has on/off states.

Version:
1.0, 02/17/07
Author:
Russell Soph
See Also:
StateChangeListener, Serialized Form

Field Summary
static java.lang.Boolean OFF
           
static java.lang.Boolean ON
           
 
Constructor Summary
BinaryObject()
          Creats an BinaryObject
BinaryObject(boolean on)
          Creats an BinarDevice with the given value
 
Method Summary
 boolean isOn()
          Gets the current state of this Device.
 void setOn(boolean on)
          Sets the current state of this Device.
 boolean stateEquals(java.lang.Object o)
          compares state of the object
 
Methods inherited from class sophware.home.lang.StateObject
addStateChangeListener, fireStateChange, removeStateChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ON

public static final java.lang.Boolean ON

OFF

public static final java.lang.Boolean OFF
Constructor Detail

BinaryObject

public BinaryObject()
Creats an BinaryObject


BinaryObject

public BinaryObject(boolean on)
Creats an BinarDevice with the given value

Parameters:
on - initial value
Method Detail

isOn

public boolean isOn()
Gets the current state of this Device.

Returns:
current state

setOn

public void setOn(boolean on)
Sets the current state of this Device.

Parameters:
on - current state

stateEquals

public boolean stateEquals(java.lang.Object o)
compares state of the object

Specified by:
stateEquals in class StateObject
Parameters:
o - value to be compared to current state
Returns:
returns whether or boolean object equals this state
See Also:
StateObject.stateEquals(Object)