Hashtable services
Use Hashtable services to create, update, and obtain information about the hashtable.
containsKey
Checks for the existence of a hashtable element.
Input Parameters for containsKey
- hashtable: java.util.Hashtable - Hashtable in which to check for the existence of a hashtable element.
- key: String - Hashtable element to be checked for.
Output Parameters for containsKey
- containsKey: String - Indicates whether the specified hashtable element exists.
A value of:
-
true- Indicates that the element exists. -
false- Indicates that the element does not exist.
-
createHashtable
Creates a hashtable object.
Input Parameters for createHashtable
None.
Output Parameters for createHashtable
- hashtable: java.util.Hashtable - The new hashtable object.
get
Gets the value for a specified key in the hashtable.
Input Parameters for get
-
hashtable: java.util.Hashtable - Hashtable from which to retrieve the specified value.
-
key: String - Key of the hashtable element whose value is to be retrieved.
Output Parameters for get
- value: Object - Value of the input hashtable element.
listKeys
Lists all the keys stored in the hashtable.
Input Parameters for listKeys
- hashtable: java.util.Hashtable - Hashtable from which the keys are to be listed.
Output Parameters for listKeys
- keys: String[] - List of keys stored in the input hashtable.
put
Adds a key/value pair in the hashtable.
Input Parameters for put
- hashtable: java.util.Hashtable - Hashtable to which the key/value pair is to be added.
- key: String - Key of the element to be added to the hashtable.
- value: Object - Value of the element to be inserted into the hashtable.
Output Parameters for put
- hashtable: java.util.Hashtable - Hashtable object after the insertion of the key/value pair.
remove
Removes a key/value pair from the hashtable.
Input Parameters for remove
- hashtable: java.util.Hashtable - Hashtable from which to remove the key/value pair.
- key: String - Key of the hashtable element to be removed.
Output Parameters for remove
- hashtable: java.util.Hashtable - Hashtable object after the key/value pair is removed.
- value: Object - Value of the hashtable element that was removed. Returns null if the input key is not found in the hashtable.
size
Gets the number of elements in the hashtable.
Input Parameters for size
- hashtable: java.util.Hashtable - Hashtable from which the number of elements stored in it is to be retrieved.
Output Parameters for size
- size: String - Number of elements in the hashtable.