|
Bali Share 1.1.18 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.Dictionary | +--oracle.bali.share.collection.OptimisticHashMap
A Dictionary implementation that behaves like a Hashtable with optimistic synchronization of gets. This results in the following behavior:
Constructor Summary | |
OptimisticHashMap()
Constructs a new, empty OptimisticHashMap with a default capacity and load factor, which is 0.75. |
|
OptimisticHashMap(int initialCapacity)
Constructs a new, empty OptimisticHashMap with the specified initial capacity and default load factor, which is 0.75. |
|
OptimisticHashMap(int initialCapacity,
float loadFactor)
Constructs a new, empty OptimisticHashMap with the specified initial capacity and the specified load factor. |
Method Summary | |
void |
clear()
Clears this hashtable so that it contains no keys. |
java.lang.Object |
clone()
Creates a shallow copy of this OptimisticHashMap. |
boolean |
contains(java.lang.Object value)
Tests if some key maps into the specified value in this hashtable. |
boolean |
containsKey(java.lang.Object key)
Tests if the specified object is a key in this hashtable. |
java.util.Enumeration |
elements()
Returns an enumeration of the values in this hashtable. |
java.lang.Object |
get(java.lang.Object key)
Returns the value to which the specified key is mapped in this hashtable. |
boolean |
isEmpty()
Tests if this hashtable maps no keys to values. |
java.util.Enumeration |
keys()
Returns an enumeration of the keys in this hashtable. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Maps the specified key to the specified
value in this hashtable. |
protected void |
rehash()
Increases the capacity of and internally reorganizes this hashtable, in order to accommodate and access its entries more efficiently. |
java.lang.Object |
remove(java.lang.Object key)
Removes the key (and its corresponding value) from this hashtable. |
int |
size()
Returns the number of keys in this hashtable. |
java.lang.String |
toString()
Returns a string representation of this OptimisticHashMap object in the form of a set of entries, enclosed in braces and separated by the ASCII characters ", " (comma and space). |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public OptimisticHashMap(int initialCapacity, float loadFactor)
initialCapacity
- the initial capacity of the hashtable.loadFactor
- the load factor of the hashtable.java.lang.IllegalArgumentException
- if the initial capacity is less
than zero, or if the load factor is nonpositive.public OptimisticHashMap(int initialCapacity)
initialCapacity
- the initial capacity of the hashtable.java.lang.IllegalArgumentException
- if the initial capacity is less
than zero.public OptimisticHashMap()
Method Detail |
public int size()
size
in class java.util.Dictionary
public boolean isEmpty()
isEmpty
in class java.util.Dictionary
true
if this hashtable maps no keys to values;
false
otherwise.public java.util.Enumeration keys()
keys
in class java.util.Dictionary
Enumeration
public java.util.Enumeration elements()
elements
in class java.util.Dictionary
Enumeration
,
keys()
public boolean contains(java.lang.Object value)
containsKey
method.value
- a value to search for.true
if and only if some key maps to the
value
argument in this hashtable as
determined by the equals method;
false
otherwise.NullPointerException
- if the value is null
.containsKey(Object)
public boolean containsKey(java.lang.Object key)
key
- possible key.true
if and only if the specified object
is a key in this hashtable, as determined by the
equals method; false
otherwise.contains(Object)
public java.lang.Object get(java.lang.Object key)
get
in class java.util.Dictionary
key
- a key in the hashtable.null
if the key is not mapped to any value in
this hashtable.put(Object, Object)
protected void rehash()
public java.lang.Object put(java.lang.Object key, java.lang.Object value)
key
to the specified
value
in this hashtable. Neither the key nor the
value can be null
.
The value can be retrieved by calling the get
method
with a key that is equal to the original key.
put
in class java.util.Dictionary
key
- the hashtable key.value
- the value.NullPointerException
- if the key or value is
null
.Object.equals(Object)
,
get(Object)
public java.lang.Object remove(java.lang.Object key)
remove
in class java.util.Dictionary
key
- the key that needs to be removed.null
if the key did not have a mapping.public void clear()
public java.lang.Object clone()
clone
in class java.lang.Object
public java.lang.String toString()
Overrides to toString method of Object.
toString
in class java.lang.Object
|
Bali Share 1.1.18 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |