All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.roguewave.tools.v2-0.HashDictionary

java.lang.Object
   |
   +----java.util.Dictionary
           |
           +----java.util.Hashtable
                   |
                   +----com.roguewave.tools.v2-0.HashDictionary

public class HashDictionary
extends Hashtable
implements Cloneable, Serializable

Constructor Index

 o HashDictionary()
Creates an empty HashDictionary
 o HashDictionary(int)
Constructs a new, empty HashDictionary with the specified initial capacity.

Method Index

 o apply(BinaryFunction)
Applies the specified function to each key and value pair in the tree.
 o clear()
Removes all items from the collection.
 o clone()
Returns a clone of this HashDictionary.
 o contains(Object)
Searches the HashDictionary for a value that compares equal to the given item.
 o containsKey(Object)
Checks the HashDictionary for a key that compares equal to the given item.
 o elements()
Returns an Enumeration object of the values in this HashDictionary, which can be used to visit each value in turn.
 o find(Object)
Searches the HashDictionary for a value matching the given item.
 o findKey(Object)
Searches the HashDictionary for a key matching the given item.
 o get(Object)
Find in this HashDictionary the key comparing equal to the given item and return its corresponding value.
 o isEmpty()
Returns true if the collection is empty, false otherwise.
 o keys()
Returns an Enumeration object of the keys (not the values) in this dictionary, which can be used to visit each key in turn.
 o occurrencesOf(Object)
Returns the number of keys in the HashDictionary that compare equal to the given item.
 o put(Object, Object)
Inserts a key and value association into the HashDictionary.
 o remove(Object)
Removes the key and value pair for which the key compares equal to the given item.
 o removeAll(Object)
Removes from the HashDictionary all elements that compare equal to the given item.
 o size()
Returns the number of elements in the collection.
 o toString()
Converts this HashDictionary to a string.

Constructors

 o HashDictionary
 public HashDictionary()
Creates an empty HashDictionary

 o HashDictionary
 public HashDictionary(int initialCapacity)
Constructs a new, empty HashDictionary with the specified initial capacity.

Parameters:
initialCapacity - the initial number of buckets

Methods

 o apply
 public synchronized void apply(BinaryFunction b)
Applies the specified function to each key and value pair in the tree. Note that the return value of the binary function is ignored.

Parameters:
b - The BinaryFunction which will be applied to each key and value pair
 o clear
 public synchronized void clear()
Removes all items from the collection.

Overrides:
clear in class Hashtable
 o clone
 public synchronized Object clone()
Returns a clone of this HashDictionary. Note that the elements of the dictionary themselves are not cloned.

Returns:
The new HashDictionary.
Overrides:
clone in class Hashtable
 o contains
 public synchronized boolean contains(Object val)
Searches the HashDictionary for a value that compares equal to the given item.

Parameters:
val - The item to be will be tested against the values in the collection.
Returns:
true if a matching value is found, false otherwise
Overrides:
contains in class Hashtable
 o containsKey
 public synchronized boolean containsKey(Object key)
Checks the HashDictionary for a key that compares equal to the given item.

Parameters:
key - The item to be tested against the keys in the collection.
Returns:
true if a matching key is found, false otherwise
Throws: NullPointerException
if key is null
Overrides:
containsKey in class Hashtable
 o elements
 public synchronized Enumeration elements()
Returns an Enumeration object of the values in this HashDictionary, which can be used to visit each value in turn.

Returns:
An Enumeration of the values in the collection (not the keys)
Overrides:
elements in class Hashtable
 o find
 public Object find(Object val)
Searches the HashDictionary for a value matching the given item.

Parameters:
val - The item to be tested against the values in the collection.
Returns:
The matching value if a match is found, null otherwise
 o findKey
 public synchronized Object findKey(Object key)
Searches the HashDictionary for a key matching the given item.

Parameters:
key - The item to be tested against the keys in the collection.
Returns:
The matching key if a match is found, null otherwise
Throws: NullPointerException
If the specified key is null
 o get
 public synchronized Object get(Object key)
Find in this HashDictionary the key comparing equal to the given item and return its corresponding value.

Parameters:
key - The item to be tested against the keys in the collection.
Returns:
The value associated with the matched key, or null if no match
Overrides:
get in class Hashtable
 o keys
 public synchronized Enumeration keys()
Returns an Enumeration object of the keys (not the values) in this dictionary, which can be used to visit each key in turn.

Returns:
An Enumeration of the keys in this HashDictionary
Overrides:
keys in class Hashtable
 o isEmpty
 public boolean isEmpty()
Returns true if the collection is empty, false otherwise.

Overrides:
isEmpty in class Hashtable
 o occurrencesOf
 public int occurrencesOf(Object target)
Returns the number of keys in the HashDictionary that compare equal to the given item. Because duplicates are not allowed, this function can only return 0 or 1.

Parameters:
target - The item which is tested against the keys of this collection
Returns:
The number of matches (0 or 1)
Throws: NullPointerException
If the specified key is null
 o put
 public synchronized Object put(Object key,
                                Object value)
Inserts a key and value association into the HashDictionary. The key and the element cannot be null.

Parameters:
key - The item which will be the key of the association
value - The item which will be the value of the association
Returns:
The old value if the key was already in the HashDictionary or null if not
Throws: NullPointerException
if the value is null
Overrides:
put in class Hashtable
 o remove
 public synchronized Object remove(Object target)
Removes the key and value pair for which the key compares equal to the given item.

Parameters:
target - The item to be tested against the keys of the collection
Returns:
The value to which the key had been mapped in this dictionary, or null if the key did not have a mapping
Throws: NullPointerException
if target is null
Overrides:
remove in class Hashtable
 o removeAll
 public int removeAll(Object target)
Removes from the HashDictionary all elements that compare equal to the given item. Note that since this collection does not admit duplicate entries, the maximum number of elements removed will be 1.

Parameters:
target - The item to be tested against the keys of the collection
Returns:
The number of elements removed (0 or 1)
 o size
 public int size()
Returns the number of elements in the collection.

Overrides:
size in class Hashtable
 o toString
 public synchronized String toString()
Converts this HashDictionary to a string. The string will have the form
   [k1=v1, k2=v2, ... , kN=vN]
 
where the keys (k1 - kN) are listed in sorted order along with their corresponding values (v1 - vN).

Returns:
The String representation of this collection.
Overrides:
toString in class Hashtable

All Packages  Class Hierarchy  This Package  Previous  Next  Index