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)

Constructor Index

 o InteractiveProperties()

Method Index

 o contains(Object)
Returns true if hashtable cantains value as an element.
 o containsKey(Object)
Returns true if the collection contains an element for the key.
 o get(Object)
Gets the object associated with the specified key in the hashtable.
 o getProperty(String)
Gets a property with the specified key.
 o keys()
Returns an enumeration of the hashtable's keys.

Constructors

 o InteractiveProperties
 public InteractiveProperties()

Methods

 o 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
 o 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
 o 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
 o 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
 o 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