|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jjoost.collections.SetMaker<V>
org.jjoost.collections.SetMaker.HashSetMaker<V>
public static class SetMaker.HashSetMaker<V>
This class provides a user friendly means of constructing a variety of hash sets. Almost all hash based set options are exposed by this class.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.jjoost.collections.SetMaker |
|---|
SetMaker.HashSetMaker<V> |
| Constructor Summary | |
|---|---|
SetMaker.HashSetMaker()
create a new HashSetMaker |
|
| Method Summary | |
|---|---|
SetMaker.HashSetMaker<V> |
copy()
Return a new SetMaker with the same properties as this one |
SetMaker.HashSetMaker<V> |
equality(Equality<? super V> eq)
Set the definition of equality used by sets constructed by this SetMaker. |
SetMaker.HashSetMaker<V> |
initialCapacity(int initialCapacity)
Specify the minimum initial capacity a set should have on construction |
SetMaker.HashSetMaker<V> |
loadFactor(float loadFactor)
Define the load factor all sets should be constructed with. |
MultiSet<V> |
newMultiSet(MultiSetNesting<V> nesting)
Construct and return a new MultiSet with the provided nesting settings |
Set<V> |
newSet()
Construct and return a new Set |
SetMaker.HashSetMaker<V> |
rehasher(Rehasher rehasher)
Set the Rehasher used by sets constructed by this SetMaker. |
SetMaker.HashSetMaker<V> |
type(HashStoreType type)
Set the type of hash structure to back the set by; this will affect performance and concurrency characteristics, primarily, but should have no impact on the basic functionality. |
| Methods inherited from class org.jjoost.collections.SetMaker |
|---|
hash, newMultiSet, newMultiSetFactory, newSetFactory |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SetMaker.HashSetMaker()
| Method Detail |
|---|
public SetMaker.HashSetMaker<V> rehasher(Rehasher rehasher)
Rehasher used by sets constructed by this SetMaker. All hashes are passed through the rehasher
before being used; it is the rehasher's job to prevent unfortunate inputs/hash functions causing the set to perform poorly.
The default differs depending on the HashStoreType.
rehasher - the Rehasher
thispublic SetMaker.HashSetMaker<V> equality(Equality<? super V> eq)
SetMaker. The Equality defines both the
hash and equality implementations to use instead of the default Object.hashCode() and Object.equals()
methods. The default is Equalities.object() which delegates to these methods, however
Equalities.identity() causes sets created by this SetMaker to behave like an
IdentityHashMap (regarding key equality).
eq - the key Equality
thispublic SetMaker.HashSetMaker<V> type(HashStoreType type)
type - the hash store type
thispublic SetMaker.HashSetMaker<V> initialCapacity(int initialCapacity)
initialCapacity - the minimum initial capacity of the set constructed
thispublic SetMaker.HashSetMaker<V> loadFactor(float loadFactor)
loadFactor - the load factory of the map constructed
thispublic Set<V> newSet()
SetMakerSet
newSet in class SetMaker<V>Setpublic MultiSet<V> newMultiSet(MultiSetNesting<V> nesting)
SetMakerMultiSet with the provided nesting settings
newMultiSet in class SetMaker<V>nesting - nesting
MultiSet with the provided nesting settingspublic SetMaker.HashSetMaker<V> copy()
SetMakerSetMaker with the same properties as this one
SetMaker
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||