|
|||||||||
| 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 interface java.util.Map |
|---|
Map.Entry<K,V> |
| Constructor Summary | |
|---|---|
Hashtable()
Deprecated. use MapUtil.map |
|
Hashtable(Hashtable source)
Deprecated. use MapUtil.map |
|
Hashtable(int initialCapacity)
Deprecated. use MapUtil.map |
|
Hashtable(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. |
Object |
clone()
Creates a shallow copy of the Hashtable. |
boolean |
contains(Object element)
Checks if the Hashtable contains the specified element. |
boolean |
containsKey(Object key)
Checks if the Hashtable has an entry matching the key key. |
int |
count()
Deprecated. replaced by size |
Enumeration |
elements()
Deprecated. use values.iterator() instead |
Object[] |
elementsArray()
Deprecated. use MapUtil.elementsArray |
Vector |
elementsVector()
Deprecated. use MapUtil.elementsList |
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(String serialized)
Populates the hashtable with serialized data from the string. |
Object |
get(Object key)
Searches the Hashtable and returns the element associated with the matched key. |
boolean |
isEmpty()
Indicates if the hashtable contains any elements. |
Enumeration |
keys()
Deprecated. use keySet.iterator() instead |
Object[] |
keysArray()
Deprecated. use MapUtil.keysArray |
Set |
keySet()
Returns a Set view of the keys contained in this map. |
Vector |
keysVector()
Deprecated. use MapUtil.keysList |
Object |
put(Object key,
Object element)
Places the key/element pair in the Hashtable. |
void |
readExternal(ObjectInput input)
Implementation of Externalizable interface. |
Object |
remove(Object key)
Finds and removes key and the element associated with it from the Hashtable. |
int |
removeElement(Object element)
Deprecated. use MapUtil.removeElement |
int |
size()
Returns the number of elements in the Hashtable. |
String |
toSerializedString()
Returns a string serialization of the Hashtable using the Serializer. |
String |
toString()
Returns the Hashtable's string representation. |
String[] |
toStringArray()
Converts a string into a string array for persistence purposes. |
Collection |
values()
Returns a collection view of the values contained in this map. |
void |
writeExternal(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(Hashtable source)
source - source HashtableMapUtil.map(java.util.Map)public Hashtable(Map source)
source - source Map| Method Detail |
|---|
public Object clone()
clone in class AbstractMapInternalError - if the cloning operation fails.public int count()
size()public int size()
size in interface Mapsize in class AbstractMappublic boolean isEmpty()
isEmpty in interface MapisEmpty in class AbstractMappublic Enumeration keys()
keySet,
Set.iterator(),
elements()public 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 Object[] keysArray()
MapUtil.keysArray(java.util.Map extends T, ?>)public Object[] elementsArray()
MapUtil.elementsArray(java.util.Map, ? extends T>)public boolean contains(Object element)
element - the element to search for in the Hashtable
NullPointerException - if element is nullpublic boolean containsKey(Object key)
containsKey in interface MapcontainsKey in class AbstractMapkey - the key to search for in the Hashtable
NullPointerException - if key is nullpublic Object get(Object key)
get in interface Mapget in class AbstractMapkey - the key to search the hashtable's keys
for. Hashtable hashes and compares key using
hashCode() and equals().
NullPointerException - if key is null and this Hashtable
is not empty.public Object remove(Object key)
remove in interface Mapremove in class AbstractMapkey - the key to search the hashtable's keys
for. Hashtable hashes and compares key using
hashCode() and equals().
public int removeElement(Object element)
element - the element to search for. Hashtable compares elements
using equals().
MapUtil.removeElement(java.util.Map, java.lang.Object)
public Object put(Object key,
Object element)
put in interface Mapput in class AbstractMapkey - the key to place into the Hashtable; may not be
nullelement - the element to place into the Hashtable; may
not be null
NullPointerException - if element or
key are nullpublic void clear()
clear in interface Mapclear in class AbstractMappublic String toString()
toString in class AbstractMappublic String[] toStringArray()
public String toSerializedString()
Serializerpublic void fromSerializedString(String serialized)
serialized - String containing serialized Hashtable data
public void writeExternal(ObjectOutput output)
throws IOException
writeExternal in interface Externalizableoutput - the stream to write the object to
IOException - Includes any I/O exceptions that may occur
public void readExternal(ObjectInput input)
throws IOException,
ClassNotFoundException
readExternal in interface Externalizableinput - the stream to read data from in order to restore the object
IOException - if I/O errors occur
ClassNotFoundException - If the class for an object being
restored cannot be found.public Set entrySet()
entrySet in interface MapentrySet in class AbstractMappublic Set keySet()
keySet in interface MapkeySet in class AbstractMappublic Collection values()
values in interface Mapvalues in class AbstractMap
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||