All Packages Class Hierarchy This Package Previous Next Index
Class sdsu.test.InteractiveProperties
java.lang.Object
|
+----java.util.Dictionary
|
+----java.util.Hashtable
|
+----java.util.Properties
|
+----sdsu.test.InteractiveProperties
- public class InteractiveProperties
- extends Properties
This Properties acts like a
normal hashtable or Properties, except when a key or value is not found on a lookup. In this case, the hashtable
prompts the user via standard in for the value in question.
This class should only be used for testing programs.
This class is designed to aid in testing java programs that are run as cgi programs.
When run as a cgi program, various information is sent to the program. When the program is
tested outside the cgi environment, that data is not available.
- Version:
- 1.0 2 April 1997
- Author:
- Roger Whitney (whitney@cs.sdsu.edu)
-
InteractiveProperties()
-
-
contains(Object)
- Returns true if hashtable cantains value as an element.
-
containsKey(Object)
- Returns true if the collection contains an element for the key.
-
get(Object)
- Gets the object associated with the specified key in the
hashtable.
-
getProperty(String)
- Gets a property with the specified key.
-
keys()
- Returns an enumeration of the hashtable's keys.
InteractiveProperties
public InteractiveProperties()
contains
public synchronized boolean contains(Object value)
- Returns true if hashtable cantains value as an element.
If the table does not contain the value, the user is prompted for the correct
answer.
- Overrides:
- contains in class Hashtable
containsKey
public synchronized boolean containsKey(Object key)
- Returns true if the collection contains an element for the key.
If the table does not contain the value, the user is prompted for the correct
answer.
- Parameters:
- key - the key that we are looking for
- Overrides:
- containsKey in class Hashtable
get
public synchronized Object get(Object key)
- Gets the object associated with the specified key in the
hashtable. If table does not contain the key, prompt the user for
if the table should have the value.
- Parameters:
- key - the specified key
- Returns:
- s the element for the key or null if the key
is not defined in the hash table.
- Overrides:
- get in class Hashtable
- See Also:
- put
getProperty
public String getProperty(String key)
- Gets a property with the specified key. If the key is not
found in this property list, tries the defaults. This method
returns null if the property is not found.
- Parameters:
- key - the hashtable key
- Overrides:
- getProperty in class Properties
keys
public synchronized Enumeration keys()
- Returns an enumeration of the hashtable's keys.
- Overrides:
- keys in class Hashtable
- See Also:
- elements, Enumeration
All Packages Class Hierarchy This Package Previous Next Index