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
-
HashDictionary()
- Creates an empty HashDictionary
-
HashDictionary(int)
- Constructs a new, empty HashDictionary with the specified initial
capacity.
-
apply(BinaryFunction)
- Applies the specified function to each key and value pair in the
tree.
-
clear()
- Removes all items from the collection.
-
clone()
- Returns a clone of this HashDictionary.
-
contains(Object)
- Searches the HashDictionary for a value that
compares equal to the given item.
-
containsKey(Object)
- Checks the HashDictionary for a key that
compares equal to the given item.
-
elements()
- Returns an Enumeration object of the values
in this HashDictionary, which can be used to visit each value
in turn.
-
find(Object)
- Searches the HashDictionary for a value matching
the given item.
-
findKey(Object)
- Searches the HashDictionary for a key matching
the given item.
-
get(Object)
- Find in this HashDictionary the key comparing
equal to the given item and return its corresponding value.
-
isEmpty()
- Returns true if the collection is empty, false otherwise.
-
keys()
- Returns an Enumeration object of the keys
(not the values) in this dictionary, which can be used to visit
each key in turn.
-
occurrencesOf(Object)
- Returns the number of keys in the HashDictionary
that compare equal to the given item.
-
put(Object, Object)
- Inserts a key and value association into the HashDictionary.
-
remove(Object)
- Removes the key and value pair for which the key compares equal to
the given item.
-
removeAll(Object)
- Removes from the HashDictionary all elements that
compare equal to the given item.
-
size()
- Returns the number of elements in the collection.
-
toString()
- Converts this HashDictionary to a string.
HashDictionary
public HashDictionary()
- Creates an empty HashDictionary
HashDictionary
public HashDictionary(int initialCapacity)
- Constructs a new, empty HashDictionary with the specified initial
capacity.
- Parameters:
- initialCapacity - the initial number of buckets
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
clear
public synchronized void clear()
- Removes all items from the collection.
- Overrides:
- clear in class Hashtable
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
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
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
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
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
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
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
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
isEmpty
public boolean isEmpty()
- Returns true if the collection is empty, false otherwise.
- Overrides:
- isEmpty in class Hashtable
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
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
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
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)
size
public int size()
- Returns the number of elements in the collection.
- Overrides:
- size in class Hashtable
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