|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.jmrix.acela.AcelaAddress
public class AcelaAddress
Utility Class supporting parsing and testing of addresses for Acela
One address format is supported: Atxxxx where: t is the type code, 'T' for turnouts, 'S' for sensors, and 'L' for lights xxxx is a bit number of the input or output bit (0-1023) examples: AT2 (bit 2), AS1003 (bit 1003), AL134 (bit134)
| Constructor Summary | |
|---|---|
AcelaAddress()
|
|
| Method Summary | |
|---|---|
static String |
convertSystemNameToAlternate(String systemName)
Public static method to convert one format Acela system name for the alternate format. |
static int |
getBitFromSystemName(String systemName)
Public static method to parse a Acela system name and return the bit number Notes: Bits are numbered from 1. |
static int |
getNodeAddressFromSystemName(String systemName)
Public static method to parse a Acela system name and return the Acela Node Address Note: Returns '-1' if illegal systemName format or if the node is not found. |
static AcelaNode |
getNodeFromSystemName(String systemName)
Public static method to parse a Acela system name and return the Acela Node Note: Returns 'null' if illegal systemName format or if the node is not found |
static String |
getUserNameFromSystemName(String systemName)
Public static method to the user name for a valid system name Returns "" (null string) if the system name is not valid or does not exist |
static String |
makeSystemName(String type,
int nAddress,
int bitNum)
Public static method to construct a Acela system name from type character, node address, and bit number This routine returns a system name in the CLxxxx, CTxxxx, or CSxxxx format. |
static String |
normalizeSystemName(String systemName)
Public static method to normalize a Acela system name This routine is used to ensure that each system name is uniquely linked to one Acela bit, by removing extra zeros inserted by the user. |
static boolean |
validSystemNameConfig(String systemName)
|
static boolean |
validSystemNameConfig(String systemName,
char type)
Public static method to validate Acela system name for configuration returns 'true' if system name has a valid meaning in current configuration, else returns 'false' |
static boolean |
validSystemNameFormat(String systemName,
char type)
Public static method to validate system name format returns 'true' if system name has a valid format, else returns 'false' |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AcelaAddress()
| Method Detail |
|---|
public static int getNodeAddressFromSystemName(String systemName)
public static AcelaNode getNodeFromSystemName(String systemName)
public static int getBitFromSystemName(String systemName)
public static boolean validSystemNameFormat(String systemName,
char type)
public static boolean validSystemNameConfig(String systemName,
char type)
public static boolean validSystemNameConfig(String systemName)
public static String convertSystemNameToAlternate(String systemName)
public static String normalizeSystemName(String systemName)
This routine is used to ensure that each system name is uniquely linked to one Acela bit, by removing extra zeros inserted by the user.
If the supplied system name does not have a valid format, an empty string is returned. Otherwise a normalized name is returned in the same format as the input name.
public static String makeSystemName(String type,
int nAddress,
int bitNum)
This routine returns a system name in the CLxxxx, CTxxxx, or CSxxxx format. The returned name is normalized.
If the supplied character is not valid, or the node address is out of the 0 - 127 range, or the bit number is out of the 1 - 2048 range, an error message is logged and the null string "" is returned.
public static String getUserNameFromSystemName(String systemName)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||