|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object RDictionary
RDictionary is a reverse dictionary that allows looking up keys by value as well as looking up values by key.
Constructor Summary | |
RDictionary()
Construct an RDictionary. |
|
RDictionary(NamedValue[] pairs)
Construct an RDictionary from an array of name:value pairs. |
Method Summary | |
void |
add(NamedValue nv)
Add a name:value pair to the dictionary. |
void |
add(NamedValue[] pairs)
Add an array of name:value pairs to the dictionary. |
void |
add(String name,
int ivalue)
Add a name:value pair to the dictionary. |
void |
add(String name,
Object value)
Add a name:value pair to the dictionary. |
void |
clear()
Remove all entries from the dictionary. |
int |
intValue(String name)
Returns the integer value matching the specified key if it exists. |
String |
name(int ivalue)
Returns the name matching the specified integer value if it exists. |
String |
name(Object value)
Returns the name (key) matching the specified value if it exists. |
String |
toString()
Returns a string representation of the contents of this dictionary. |
Object |
value(String name)
Returns the value matching the specified key if it exists. |
Methods inherited from class Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public RDictionary()
public RDictionary(NamedValue[] pairs)
Method Detail |
public void add(NamedValue nv)
nv
- the name:value pair to be added.public void add(String name, Object value)
name
- the name to be added.value
- the value to be added.public void add(String name, int ivalue)
name
- the name to be added.ivalue
- the integer value to be added.public void add(NamedValue[] pairs)
pairs
- the name:value pairs to be added.public String name(Object value)
value
- the value to be found.
public String name(int ivalue)
ivalue
- the integer value to be found.
public Object value(String name)
name
- the key to be found.
public int intValue(String name)
name
- the key to be found.
public void clear()
public String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |