sophware.home.x10
Class X10Address

java.lang.Object
  extended by sophware.home.lang.DeviceAddress
      extended by sophware.home.x10.X10Address
All Implemented Interfaces:
java.io.Serializable

public class X10Address
extends DeviceAddress
implements java.io.Serializable

X10Address uniquely identifies an X10Device or a house code broadcast address.

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

Constructor Summary
X10Address(char hc)
          Creates a X10Address with the given house code
X10Address(char hc, int unit)
          Creates a X10Address with the given house code, unit number.
X10Address(java.lang.String addr)
          Creates a X10Address with the given address
 
Method Summary
 int getAddress()
          Returns the raw X10 address byte
 HomeCommand getBrightCommand()
          Gets bright command for this address
 HomeCommand getDimCommand()
          Gets dim command for this address
 HomeCommand getHailCommand()
          Gets hail command for this address
 char getHouseCode()
          Gets the house code associated with this X10Address
 HomeCommand getOffCommand()
          Get off command for this address
 HomeCommand getOnCommand()
          Get on command for this address
 HomeCommand getOnCommand(int level)
          Get on command for this address
 HomeCommand getStatusRequestCommand()
          Get status request command for this address
 short getUnitNum()
          Gets the unit number associated with this X10Address.
 boolean isHouseCodeBroadcast()
          Returns true if this is a house code broadcast address.
 java.lang.String toString()
          Returns string representation of this address
 
Methods inherited from class sophware.home.lang.DeviceAddress
equals, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

X10Address

public X10Address(char hc)
           throws HomeException
Creates a X10Address with the given house code

Parameters:
hc - house code (A-P)
Throws:
HomeException - house code is invalid

X10Address

public X10Address(char hc,
                  int unit)
           throws HomeException
Creates a X10Address with the given house code, unit number.

Parameters:
hc - house code (A-P)
unit - unit number (1-16)
Throws:
HomeException - house code or unit number are invalid

X10Address

public X10Address(java.lang.String addr)
           throws HomeException
Creates a X10Address with the given address

Parameters:
addr - x10 address
Throws:
HomeException - address is invalid
Method Detail

getHouseCode

public char getHouseCode()
Gets the house code associated with this X10Address

Returns:
house code (A-P)

getUnitNum

public short getUnitNum()
Gets the unit number associated with this X10Address. Zero if this is a house code broadcast address.

Returns:
unit number (0-16)

isHouseCodeBroadcast

public boolean isHouseCodeBroadcast()
Returns true if this is a house code broadcast address.

Returns:
whether or not house code broadcast

toString

public java.lang.String toString()
Returns string representation of this address

Overrides:
toString in class java.lang.Object
Returns:
string representation.

getAddress

public int getAddress()
Returns the raw X10 address byte

Specified by:
getAddress in class DeviceAddress
Returns:
address byte

getOnCommand

public HomeCommand getOnCommand()
Get on command for this address

Specified by:
getOnCommand in class DeviceAddress
Returns:
the command

getOnCommand

public HomeCommand getOnCommand(int level)
Get on command for this address

Specified by:
getOnCommand in class DeviceAddress
Parameters:
level - the desired level
Returns:
the command

getOffCommand

public HomeCommand getOffCommand()
Get off command for this address

Specified by:
getOffCommand in class DeviceAddress
Returns:
the command

getDimCommand

public HomeCommand getDimCommand()
Gets dim command for this address

Specified by:
getDimCommand in class DeviceAddress
Returns:
the command

getBrightCommand

public HomeCommand getBrightCommand()
Gets bright command for this address

Specified by:
getBrightCommand in class DeviceAddress
Returns:
the command

getHailCommand

public HomeCommand getHailCommand()
Gets hail command for this address

Specified by:
getHailCommand in class DeviceAddress
Returns:
the command

getStatusRequestCommand

public HomeCommand getStatusRequestCommand()
Get status request command for this address

Specified by:
getStatusRequestCommand in class DeviceAddress
Returns:
the command