|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap
ariba.util.core.Hashtable
public class Hashtable
A Hashtable class that has a number of performance improvements over other Hashtable classes. The methods are not internally synchronized, so care must be taken at the application level to synchronize.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.util.AbstractMap |
---|
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V> |
Nested classes/interfaces inherited from interface java.util.Map |
---|
java.util.Map.Entry<K,V> |
Constructor Summary | |
---|---|
Hashtable()
Deprecated. use MapUtil.map |
|
Hashtable(java.util.Hashtable source)
Deprecated. use MapUtil.map |
|
Hashtable(int initialCapacity)
Deprecated. use MapUtil.map |
|
Hashtable(java.util.Map source)
Creates new Hashtable with the same contents as the given Map. |
Method Summary | |
---|---|
void |
clear()
Removes all keys and elements from the Hashtable. |
java.lang.Object |
clone()
Creates a shallow copy of the Hashtable. |
boolean |
contains(java.lang.Object element)
Checks if the Hashtable contains the specified element. |
boolean |
containsKey(java.lang.Object key)
Checks if the Hashtable has an entry matching the key key. |
int |
count()
Deprecated. replaced by size |
java.util.Enumeration |
elements()
Deprecated. use values.iterator() instead |
java.lang.Object[] |
elementsArray()
Deprecated. use MapUtil.elementsArray |
Vector |
elementsVector()
Deprecated. use MapUtil.elementsList |
java.util.Set |
entrySet()
Note: While iterating through a set of entries in the Hashtable, do not keep references to Key.Entry objects after a subsequent call to next(). |
void |
fromSerializedString(java.lang.String serialized)
Populates the hashtable with serialized data from the string. |
java.lang.Object |
get(java.lang.Object key)
Searches the Hashtable and returns the element associated with the matched key. |
boolean |
isEmpty()
Indicates if the hashtable contains any elements. |
java.util.Enumeration |
keys()
Deprecated. use keySet.iterator() instead |
java.lang.Object[] |
keysArray()
Deprecated. use MapUtil.keysArray |
java.util.Set |
keySet()
Returns a Set view of the keys contained in this map. |
Vector |
keysVector()
Deprecated. use MapUtil.keysList |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object element)
Places the key/element pair in the Hashtable. |
void |
readExternal(java.io.ObjectInput input)
Implementation of Externalizable interface. |
java.lang.Object |
remove(java.lang.Object key)
Finds and removes key and the element associated with it from the Hashtable. |
int |
removeElement(java.lang.Object element)
Deprecated. use MapUtil.removeElement |
int |
size()
Returns the number of elements in the Hashtable. |
java.lang.String |
toSerializedString()
Returns a string serialization of the Hashtable using the Serializer. |
java.lang.String |
toString()
Returns the Hashtable's string representation. |
java.lang.String[] |
toStringArray()
Converts a string into a string array for persistence purposes. |
java.util.Collection |
values()
Returns a collection view of the values contained in this map. |
void |
writeExternal(java.io.ObjectOutput output)
Implementation of Externalizable interface. |
Methods inherited from class java.util.AbstractMap |
---|
containsValue, equals, hashCode, putAll |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Hashtable()
MapUtil.map()
public Hashtable(int initialCapacity)
initialCapacity
- the number of elements this Hashtable
is capable of holding before needing to grow.MapUtil.map(int)
public Hashtable(java.util.Hashtable source)
source
- source HashtableMapUtil.map(java.util.Map)
public Hashtable(java.util.Map source)
source
- source MapMethod Detail |
---|
public java.lang.Object clone()
clone
in class java.util.AbstractMap
java.lang.InternalError
- if the cloning operation fails.public int count()
size()
public int size()
size
in interface java.util.Map
size
in class java.util.AbstractMap
public boolean isEmpty()
isEmpty
in interface java.util.Map
isEmpty
in class java.util.AbstractMap
public java.util.Enumeration keys()
keySet
,
Set.iterator()
,
elements()
public java.util.Enumeration elements()
values
,
Collection.iterator()
,
keys()
public Vector keysVector()
MapUtil.keysList(java.util.Map extends T, ?>)
public Vector elementsVector()
MapUtil.elementsList(java.util.Map, ? extends T>)
public java.lang.Object[] keysArray()
MapUtil.keysArray(java.util.Map extends T, ?>)
public java.lang.Object[] elementsArray()
MapUtil.elementsArray(java.util.Map, ? extends T>)
public boolean contains(java.lang.Object element)
element
- the element to search for in the Hashtable
java.lang.NullPointerException
- if element is nullpublic boolean containsKey(java.lang.Object key)
containsKey
in interface java.util.Map
containsKey
in class java.util.AbstractMap
key
- the key to search for in the Hashtable
java.lang.NullPointerException
- if key is nullpublic java.lang.Object get(java.lang.Object key)
get
in interface java.util.Map
get
in class java.util.AbstractMap
key
- the key to search the hashtable's keys
for. Hashtable hashes and compares key using
hashCode() and equals().
java.lang.NullPointerException
- if key is null and this Hashtable
is not empty.public java.lang.Object remove(java.lang.Object key)
remove
in interface java.util.Map
remove
in class java.util.AbstractMap
key
- the key to search the hashtable's keys
for. Hashtable hashes and compares key using
hashCode() and equals().
public int removeElement(java.lang.Object element)
element
- the element to search for. Hashtable compares elements
using equals().
MapUtil.removeElement(java.util.Map, java.lang.Object)
public java.lang.Object put(java.lang.Object key, java.lang.Object element)
put
in interface java.util.Map
put
in class java.util.AbstractMap
key
- the key to place into the Hashtable; may not be
nullelement
- the element to place into the Hashtable; may
not be null
java.lang.NullPointerException
- if element or
key are nullpublic void clear()
clear
in interface java.util.Map
clear
in class java.util.AbstractMap
public java.lang.String toString()
toString
in class java.util.AbstractMap
public java.lang.String[] toStringArray()
public java.lang.String toSerializedString()
Serializer
public void fromSerializedString(java.lang.String serialized)
serialized
- String containing serialized Hashtable datapublic void writeExternal(java.io.ObjectOutput output) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
output
- the stream to write the object to
java.io.IOException
- Includes any I/O exceptions that may occurpublic void readExternal(java.io.ObjectInput input) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
input
- the stream to read data from in order to restore the object
java.io.IOException
- if I/O errors occur
java.lang.ClassNotFoundException
- If the class for an object being
restored cannot be found.public java.util.Set entrySet()
entrySet
in interface java.util.Map
entrySet
in class java.util.AbstractMap
public java.util.Set keySet()
keySet
in interface java.util.Map
keySet
in class java.util.AbstractMap
public java.util.Collection values()
values
in interface java.util.Map
values
in class java.util.AbstractMap
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |