sophware.home.io
Class HomeCommand

java.lang.Object
  extended by sophware.home.io.HomeCommand
All Implemented Interfaces:
java.io.Serializable, MacroStep
Direct Known Subclasses:
InsteonCommand, PLCCommand, X10Command

public abstract class HomeCommand
extends java.lang.Object
implements MacroStep, java.io.Serializable

A HomeCommand is transmitted via a HomeTransmitter to a device on the home's network.

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

Field Summary
static long serialVersionUID
           
 
Constructor Summary
HomeCommand()
           
 
Method Summary
 void execute()
          Executes this command as part of a Macro
abstract  int getBytes(byte[] data)
          Gets the data transmission bytes
 HomeCommandListener getListener()
          Gets the HomeCommandListener to for this command.
 int getRequestID()
          Gets a request ID to for this command.
 void setListener(HomeCommandListener listener)
          Sets a HomeCommandListener to for this command.
 void setRequestID(int requestID)
          Assigns a request ID to this command.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

HomeCommand

public HomeCommand()
Method Detail

setRequestID

public void setRequestID(int requestID)
Assigns a request ID to this command. This value is assigned by the HomeTransmitter interface

Parameters:
requestID - the request identifier

getRequestID

public int getRequestID()
Gets a request ID to for this command. This value is assigned by the HomeTransmitter interface

Returns:
the request identifier

setListener

public void setListener(HomeCommandListener listener)
Sets a HomeCommandListener to for this command. This listener is notified when the command transmission completes.

Parameters:
listener - the HomeCommandListener

getListener

public HomeCommandListener getListener()
Gets the HomeCommandListener to for this command. This listener is notified when the command transmission completes.

Returns:
the HomeCommandListener

execute

public void execute()
Executes this command as part of a Macro

Specified by:
execute in interface MacroStep
See Also:
MacroStep

getBytes

public abstract int getBytes(byte[] data)
Gets the data transmission bytes

Parameters:
data - output buffer for efficiency (length is protocol dependent)
Returns:
the length of the data transmission