|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface LookupKeyed
A Lookup table which can have all of its "keys" retrieved.
A simple Lookup table only allows one to fetch
values for a specific key. Sometimes it can be useful to fetch all
of the keys which a Lookup table contains. This
allows one to iterate over the entire contents of a Lookup table. It should be noted that the "keys" fetched may not
be returned in any specific order. Take a look at the LookupOrdered object to see an example of a class
which implements this interface and also provides a method to fetch
back keys in the order they were first put into the table.
It should be noted that this interface reiterates the methods which it extends from its parent class. This should not have been required, but was done to fix a problem encountered in the Internet Explorer 4.0 JVM.
LookupCreate| Method Summary | |
|---|---|
Object |
get(Object key)
Fetch the value associated with a "key" Try to lookup the Object which is associated with the key. |
Enumeration |
getKeys()
Get enumeration of all of the keys in the lookup table. |
String |
getString(Object key)
Fetch a String "value" associated with a "key". |
| Method Detail |
|---|
Object get(Object key)
If you are implementing this method in your class, you must be
certain that it never invokes the getString(Object) method! Let me repeat: It is permitted for the
getString(java.lang.Object) method to invoke this method, but not the
other way around! Failure to follow this convention can result in
potentially infinite recursion.
get in interface Lookupkey - Key to use to look up object with (if you pass null, you will
get null back). If the object passed is non-null, it should
not throw any exceptions if the Object.toString() is
invoked on it.
LookupCreateString getString(Object key)
get(java.lang.Object) method with this method.
getString in interface Lookupkey - Key to use to look up object with (if you pass null, you will
get null back). If the object passed is non-null, it should
not throw any exceptions if the Object.toString() is
invoked on it.
Lookup table all support the Object.toString() method
without Exception.LookupCreateEnumeration getKeys()
Enumeration list of all keys in the Lookup table.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||