sdsu.test
Class InteractiveProperties
java.lang.Object
|
+--java.util.Dictionary
|
+--java.util.Hashtable
|
+--java.util.Properties
|
+--sdsu.test.InteractiveProperties
- public class InteractiveProperties
- extends java.util.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)
- See Also:
- Serialized Form
Method Summary |
boolean |
contains(java.lang.Object value)
Returns true if hashtable cantains value as an element. |
boolean |
containsKey(java.lang.Object key)
Returns true if the collection contains an element for the key. |
java.lang.Object |
get(java.lang.Object key)
Gets the object associated with the specified key in the
hashtable. |
java.lang.String |
getProperty(java.lang.String key)
Gets a property with the specified key. |
java.util.Enumeration |
keys()
Returns an enumeration of the hashtable's keys. |
Methods inherited from class java.util.Properties |
getProperty,
list,
list,
load,
propertyNames,
save,
setProperty,
store |
Methods inherited from class java.util.Hashtable |
clear,
clone,
containsValue,
elements,
entrySet,
equals,
hashCode,
isEmpty,
keySet,
put,
putAll,
remove,
size,
toString,
values |
Methods inherited from class java.lang.Object |
getClass,
notify,
notifyAll,
wait,
wait,
wait |
InteractiveProperties
public InteractiveProperties()
contains
public boolean contains(java.lang.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 java.util.Hashtable
containsKey
public boolean containsKey(java.lang.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 java.util.Hashtable
get
public java.lang.Object get(java.lang.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- Overrides:
- get in class java.util.Hashtable
- See Also:
Hashtable#put
getProperty
public java.lang.String getProperty(java.lang.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 java.util.Properties
keys
public java.util.Enumeration keys()
- Returns an enumeration of the hashtable's keys.
- Overrides:
- keys in class java.util.Hashtable
- See Also:
Hashtable#elements
,
Enumeration