|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectes.uc3m.it.xbe32.XBE32Dictionary
This class allows XBE32 Elements' identifiers to be translated into/from names.
The dictionary can be filled with the add()
method, or directly from a Properties
file:
# name '=' identifier ('0x' hex or decimal format) # service = 1 type = 0x2102 addr = 0x2C03 ports = 0x2904 options = 0xC005 color = 6
Constructor Summary | |
XBE32Dictionary()
Creates an empty XBE32Dictionary . |
|
XBE32Dictionary(String file)
Creates a XBE32Dictionary from the specified
Properties filename. |
Method Summary | |
void |
add(int id,
String name)
Adds the specified identifier-name translation pair to the dictionary |
int |
getId(String name)
Returns the XBE32 Element identifier associated to the specified name |
String |
getName(int id)
Returns the XBE32 Element name associated to the specified identifier |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public XBE32Dictionary()
XBE32Dictionary
.
public XBE32Dictionary(String file) throws IOException, NumberFormatException
XBE32Dictionary
from the specified
Properties
filename.
file
- the file to load the dictionary from
IOException
- if an error occurs while loading the file
NumberFormatException
- if an identifier cannot be parsed as a
hexadecimal or decimal numberMethod Detail |
public void add(int id, String name)
id
- the XBE32 Element identifiername
- the XBE32 Element namepublic String getName(int id)
id
- the XBE32 Element identifier to translate into a name
null
if the name is not foundpublic int getId(String name)
name
- the XBE32 Element name to translate into a identifier
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |