|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.jdo.spi.persistence.utility.BucketizedHashtable
public class BucketizedHashtable
This class implements bucketize hashtable, which subdivide the key collection stored into several hashtables (buckets) of smaller size. This will reduce the contention of hashtable.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
java.util.Map.Entry<K,V> |
| Constructor Summary | |
|---|---|
BucketizedHashtable()
Constructs a new, empty BucketizedHashtable with the default bucket size 11, default initial capacity (11 * bucketSize) and default load factor 0.75. |
|
BucketizedHashtable(int bucketSize)
Constructs a new, empty BucketizedHashtable with the specified bucket size, default initial capacity (11 * bucketSize) and default load factor 0.75. |
|
BucketizedHashtable(int bucketSize,
int initialCapacity)
Constructs a new, empty BucketizedHashtable with the specified bucket size, initial capacity and default load factor 0.75. |
|
BucketizedHashtable(int bucketSize,
int initialCapacity,
float loadFactor)
Constructs a new, empty BucketizedHashtable with the specified bucket size, initial capacity and load factor. |
|
| Method Summary | |
|---|---|
void |
clear()
Clears this BucketizedHashtable so that it contains no key. |
java.lang.Object |
clone()
Creates and returns a shallow copy of this object. |
boolean |
containsKey(java.lang.Object key)
|
boolean |
containsValue(java.lang.Object value)
|
java.util.Set |
entrySet()
The return set is backed by the map, so changes to the map are reflected in the set, and vice-versa. |
boolean |
equals(java.lang.Object o)
Compares the specified object with this map for equality. |
java.lang.Object |
get(java.lang.Object key)
|
int |
hashCode()
|
boolean |
isEmpty()
|
java.util.Set |
keySet()
The return set is backed by the map, so changes to the map are reflected in the set, and vice-versa. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Maps the specified key to the specified
value in this hashtable. |
void |
putAll(java.util.Map t)
|
java.lang.Object |
remove(java.lang.Object key)
Remove the key and its corresponding value. |
int |
size()
|
java.lang.String |
toString()
|
java.util.Collection |
values()
The return collection is backed by the map, so changes to the map are reflected in the collection, and vice-versa. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public BucketizedHashtable(int bucketSize,
int initialCapacity,
float loadFactor)
bucketSize - the number of buckets used for hashinginitialCapacity - the initial capacity of BucketizedHashtableloadFactor - the load factor of hashtable
public BucketizedHashtable(int bucketSize,
int initialCapacity)
bucketSize - the number of buckets used for hashinginitialCapacity - the initial capacity of hashtablepublic BucketizedHashtable(int bucketSize)
bucketSize - the number of buckets used for hashingpublic BucketizedHashtable()
| Method Detail |
|---|
public java.lang.Object get(java.lang.Object key)
get in interface java.util.Mapkey - a key in the hashtable
public java.lang.Object remove(java.lang.Object key)
remove in interface java.util.Mapkey - the key that needs to be removed
null if the key did not have a mapping.
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.
put in interface java.util.Mapkey - the hashtable keyvalue - the value
null if it did not have one.public void putAll(java.util.Map t)
putAll in interface java.util.Mapt - BucketizedHashtable
or a Map with a supported operation entrySetpublic boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Mapkey - possible key
public boolean containsValue(java.lang.Object value)
containsValue in interface java.util.Mapvalue - possible value
public int size()
size in interface java.util.Mappublic int hashCode()
hashCode in interface java.util.MaphashCode in class java.lang.Objectpublic boolean isEmpty()
isEmpty in interface java.util.Mappublic void clear()
clear in interface java.util.Mappublic java.util.Set entrySet()
entrySet in interface java.util.Mapjava.lang.UnsupportedOperationException - when bucketSize is greater onepublic java.util.Set keySet()
keySet in interface java.util.Mapjava.lang.UnsupportedOperationException - when bucketSize is greater onepublic java.util.Collection values()
values in interface java.util.Mapjava.lang.UnsupportedOperationException - when bucketSize is greater onepublic boolean equals(java.lang.Object o)
equals in interface java.util.Mapequals in class java.lang.Objectpublic java.lang.Object clone()
clone in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||