org.wcb.autohome.factories
Class FactoryUtilities
java.lang.Object
org.wcb.autohome.factories.FactoryUtilities
- All Implemented Interfaces:
- X10DeviceConstants
- public class FactoryUtilities
- extends java.lang.Object
- implements X10DeviceConstants
Project: Alice X10 Home Automation
Filename: $Id: FactoryUtilities.java,v 1.3 2004/02/25 21:38:36 wbogaardt Exp $
Abstract: This class is a consolidation of methods that have been commonly called
throught the application rather than keeping reimplementing the same function
over and over.
- Version:
- 1.0
- Author:
- wbogaardt
Fields inherited from interface org.wcb.autohome.interfaces.X10DeviceConstants |
APPLIANCE_MODULE_OFF, APPLIANCE_MODULE_ON, BAUD, BAUD_RATE_ARRAY, BRIGHT_ACTION, BROWSER, CM11A_TRANSMITTER, CM17A_TRANSMITTER, CONNECT_ON_START, COUNTRY, DATA_BIT, DATA_BITS_ARRAY, DEVICE_ARRAY, DIM_ACTION, EMAIL_AUTHORIZE, EMAIL_FREQUENCY, EMAIL_FROM, EMAIL_PASSWORD, EMAIL_SMTP, EMAIL_TO, EMAIL_USERNAME, FALSE, HOUSE_CODES_ARRAY, INTERFACE_TYPE, LAMP_MODULE_OFF, LAMP_MODULE_ON, LANGUAGE, LAST_FILE, LOCALHOST, LOOK_AND_FEEL, MAC, METAL, MOTIF, OFF_ACTION, ON_ACTION, PARITY, PARITY_ARRAY, RECOVER_CM11A, RMI_HOST, SEPARATOR, SERIAL_PORT, SPEECH_ENGINE, STOP_BIT, STOP_BITS_ARRAY, TEST_TRANSMITTER, TIMER_EVENT, TRIGGER_EVENT, TRUE, USER_HOME, WINDOWS |
Method Summary |
static int |
getDeviceCode(java.lang.String val)
Takes a String representation of something like
A1 and parses the integer from the string. |
static char |
getHouseCode(java.lang.String val)
Takes a string and returns the first
character in that string as a char value. |
static int |
getIntValue(java.lang.String value)
Gets the integer value from a string |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FactoryUtilities
public FactoryUtilities()
getHouseCode
public static char getHouseCode(java.lang.String val)
- Takes a string and returns the first
character in that string as a char value.
- Parameters:
val
- the String to get the house code from
- Returns:
- The character of the first position in the string (Defaults to 'A');
getDeviceCode
public static int getDeviceCode(java.lang.String val)
- Takes a String representation of something like
A1 and parses the integer from the string.
If the entered integers
are greater than 16 then 16 is returned;
- Parameters:
val
- the String value to get the device code from.
- Returns:
- the device code defaults to 1 or 16.
getIntValue
public static int getIntValue(java.lang.String value)
- Gets the integer value from a string
- Parameters:
value
- The string to get the integer from
- Returns:
- The int otherwise a default value of 1
Copyright © 1999-2004 Walter Bogaardt. All Rights Reserved.