com.tangosol.util
Class SafeHashSet
java.lang.Object
java.util.AbstractCollection
java.util.AbstractSet
com.tangosol.util.MapSet
com.tangosol.util.SafeHashSet
- All Implemented Interfaces:
- ExternalizableLite, Externalizable, Serializable, Cloneable, Iterable, Collection, Set
public class SafeHashSet
- extends MapSet
An implementation of java.util.Set that is synchronized, but minimally so.
This class is for use in situation where high concurrency is required,
but so is data integrity.
- Since:
- Coherence 3.1
- Author:
- gg 09/16/05
Constructor Summary |
SafeHashSet()
Construct a thread-safe hash set using the default settings. |
SafeHashSet(int cInitialBuckets,
float flLoadFactor,
float flGrowthRate)
Construct a thread-safe hash set using the specified settings. |
Method Summary |
protected Map |
instantiateMap()
Factory pattern: Provide an underlying Map for this Set implementation
to store its contents in. |
Methods inherited from class com.tangosol.util.MapSet |
add, addAll, clear, clone, contains, containsAll, getMap, iterator, readExternal, readExternal, remove, removeAll, retainAll, size, toArray, toArray, writeExternal, writeExternal |
Methods inherited from interface java.util.Set |
isEmpty |
SafeHashSet
public SafeHashSet()
- Construct a thread-safe hash set using the default settings.
SafeHashSet
public SafeHashSet(int cInitialBuckets,
float flLoadFactor,
float flGrowthRate)
- Construct a thread-safe hash set using the specified settings.
- Parameters:
cInitialBuckets
- the initial number of hash buckets, 0 < nflLoadFactor
- the acceptable load factor before resizing
occurs, 0 < n, such that a load factor of
1.0 causes resizing when the number of entries
exceeds the number of bucketsflGrowthRate
- the rate of bucket growth when a resize occurs,
0 < n, such that a growth rate of 1.0 will
double the number of buckets:
bucketcount = bucketcount * (1 + growthrate)
instantiateMap
protected Map instantiateMap()
- Factory pattern: Provide an underlying Map for this Set implementation
to store its contents in.
- Overrides:
instantiateMap
in class MapSet
- Returns:
- a new Map instance