agentland.output
Class X10Data

java.lang.Object
  |
  +--agentland.device.DeviceData
        |
        +--agentland.output.X10Data

public class X10Data
extends DeviceData
implements Serializable, Cloneable

See Also:
Serialized Form

Fields inherited from class agentland.device.DeviceData
names
 
Constructor Summary
X10Data()
           
X10Data(char houseCode, int moduleCode)
           
X10Data(String name, char houseCode, int moduleCode)
           
X10Data(String houseCode, int moduleCode)
           
X10Data(String name, String houseCode, int moduleCode)
           
 
Method Summary
static byte charToByte(char ch)
           
static int charToInt(char ch)
          Takes a char like "a", "b", etc and converts them to ints like 0 for a, 1 for b, etc
static X10Data fromString(String str)
          Parses a string to create an X10 object
 char getHouseCode()
           
 int getHouseCodeInt()
          Returns house code as an int; 0 for 'a', and so on...
 int getModuleCode()
           
 void setHouseCode(char houseCode)
           
 void setModuleCode(int moduleCode)
           
static char stringToChar(String str)
          converts a string to char.
 
Methods inherited from class agentland.device.DeviceData
addName, equals, getName, getNames, setName, setName, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

X10Data

public X10Data()

X10Data

public X10Data(char houseCode,
               int moduleCode)

X10Data

public X10Data(String houseCode,
               int moduleCode)

X10Data

public X10Data(String name,
               char houseCode,
               int moduleCode)

X10Data

public X10Data(String name,
               String houseCode,
               int moduleCode)
Method Detail

getHouseCode

public char getHouseCode()

getHouseCodeInt

public int getHouseCodeInt()
Returns house code as an int; 0 for 'a', and so on...

getModuleCode

public int getModuleCode()

setHouseCode

public void setHouseCode(char houseCode)

setModuleCode

public void setModuleCode(int moduleCode)

fromString

public static X10Data fromString(String str)
Parses a string to create an X10 object
Parameters:
str - the string to be parsed
Returns:
an X10Data object or null if failed

stringToChar

public static char stringToChar(String str)
converts a string to char. if the string is of length other than 1, it will throw IllegalArgumentException

charToInt

public static int charToInt(char ch)
Takes a char like "a", "b", etc and converts them to ints like 0 for a, 1 for b, etc

charToByte

public static byte charToByte(char ch)