|
||||||||||
| 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 |
|---|
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. |
Object |
clone()
Creates and returns a shallow copy of this object. |
boolean |
containsKey(Object key)
|
boolean |
containsValue(Object value)
|
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(Object o)
Compares the specified object with this map for equality. |
Object |
get(Object key)
|
int |
hashCode()
|
boolean |
isEmpty()
|
Set |
keySet()
The return set is backed by the map, so changes to the map are reflected in the set, and vice-versa. |
Object |
put(Object key,
Object value)
Maps the specified key to the specified
value in this hashtable. |
void |
putAll(Map t)
|
Object |
remove(Object key)
Remove the key and its corresponding value. |
int |
size()
|
String |
toString()
|
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 Object get(Object key)
get in interface Mapkey - a key in the hashtable
public Object remove(Object key)
remove in interface Mapkey - the key that needs to be removed
null if the key did not have a mapping.
public Object put(Object key,
Object value)
key to the specified
value in this hashtable. Neither the key nor the
value can be null.
put in interface Mapkey - the hashtable keyvalue - the value
null if it did not have one.public void putAll(Map t)
putAll in interface Mapt - BucketizedHashtable
or a Map with a supported operation entrySetpublic boolean containsKey(Object key)
containsKey in interface Mapkey - possible key
public boolean containsValue(Object value)
containsValue in interface Mapvalue - possible value
public int size()
size in interface Mappublic int hashCode()
hashCode in interface MaphashCode in class Objectpublic boolean isEmpty()
isEmpty in interface Mappublic void clear()
clear in interface Mappublic Set entrySet()
entrySet in interface MapUnsupportedOperationException - when bucketSize is greater onepublic Set keySet()
keySet in interface MapUnsupportedOperationException - when bucketSize is greater onepublic Collection values()
values in interface MapUnsupportedOperationException - when bucketSize is greater onepublic boolean equals(Object o)
equals in interface Mapequals in class Objectpublic Object clone()
clone in class Objectpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||