sophware.home.lang
Class DeviceGroup

java.lang.Object
  extended by sophware.home.lang.StateObject
      extended by sophware.home.lang.BinaryObject
          extended by sophware.home.lang.HomeDevice
              extended by sophware.home.lang.DeviceGroup
All Implemented Interfaces:
java.io.Serializable, Named

public class DeviceGroup
extends HomeDevice
implements java.io.Serializable

DeviceGroup is an addressable group of devices.

Version:
1.0, 03/19/07
Author:
Russell Soph
See Also:
Serialized Form

Field Summary
 
Fields inherited from class sophware.home.lang.BinaryObject
OFF, ON
 
Constructor Summary
DeviceGroup(DeviceAddress address)
          Creates a DeviceGroup with the given address
DeviceGroup(DeviceAddress address, java.lang.String name)
          Creates a DeviceGroup with the given address and name.
 
Method Summary
 void addDevice(HomeDevice device)
          Adds the device to the group
 void removeDevice(HomeDevice device)
          Remove the device from the group
 void update(Home home, HomeEvent event)
          Applies a HomeEvent to each device in this group.
 
Methods inherited from class sophware.home.lang.HomeDevice
equals, getAddress, getName, getProperties, sendHail, sendOff, sendOn, sendStatusRequest, setName, setProperties, toString
 
Methods inherited from class sophware.home.lang.BinaryObject
isOn, setOn, stateEquals
 
Methods inherited from class sophware.home.lang.StateObject
addStateChangeListener, fireStateChange, removeStateChangeListener
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DeviceGroup

public DeviceGroup(DeviceAddress address)
Creates a DeviceGroup with the given address

Parameters:
address - the DeviceAddress for this group

DeviceGroup

public DeviceGroup(DeviceAddress address,
                   java.lang.String name)
Creates a DeviceGroup with the given address and name.

Parameters:
address - the DeviceAddress for this group
name - of this device
Method Detail

addDevice

public void addDevice(HomeDevice device)
Adds the device to the group

Parameters:
device - the device

removeDevice

public void removeDevice(HomeDevice device)
Remove the device from the group

Parameters:
device - the device

update

public void update(Home home,
                   HomeEvent event)
Applies a HomeEvent to each device in this group.

Overrides:
update in class HomeDevice
Parameters:
home - the home
event - the event
See Also:
HomeDevice.update(Home,HomeEvent)