org.jjoost.collections
Class SetMaker<V>

java.lang.Object
  extended by org.jjoost.collections.SetMaker<V>
Direct Known Subclasses:
SetMaker.HashSetMaker

public abstract class SetMaker<V>
extends java.lang.Object

Author:
b.elliottsmith

Nested Class Summary
static class SetMaker.HashSetMaker<V>
          This class provides a user friendly means of constructing a variety of hash sets.
 
Method Summary
static
<V> SetMaker.HashSetMaker<V>
hash()
          Returns a new HashSetMaker for building hash sets
 MultiSet<V> newMultiSet()
          Construct and return a new MultiSet with INLINE nesting
abstract  MultiSet<V> newMultiSet(MultiSetNesting<V> nesting)
          Construct and return a new MultiSet with the provided nesting settings
 Factory<MultiSet<V>> newMultiSetFactory(MultiSetNesting<V> nesting)
          Return a new Factory whose create() method returns the result of this.newMultiSet(nesting).
abstract  Set<V> newSet()
          Construct and return a new Set
 Factory<Set<V>> newSetFactory()
          Return a new Factory whose create() method returns the result of this.newSet().
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newSet

public abstract Set<V> newSet()
Construct and return a new Set

Returns:
a new Set

newMultiSet

public MultiSet<V> newMultiSet()
Construct and return a new MultiSet with INLINE nesting

Returns:
a new MultiSet with INLINE nesting

newMultiSet

public abstract MultiSet<V> newMultiSet(MultiSetNesting<V> nesting)
Construct and return a new MultiSet with the provided nesting settings

Parameters:
nesting - nesting
Returns:
a new MultiSet with the provided nesting settings

newSetFactory

public Factory<Set<V>> newSetFactory()
Return a new Factory whose create() method returns the result of this.newSet(). Changes to this SetMaker after the construction of this factory will not affect the result of calls to the factory's create() method.

Returns:
a factory of type Set

newMultiSetFactory

public Factory<MultiSet<V>> newMultiSetFactory(MultiSetNesting<V> nesting)
Return a new Factory whose create() method returns the result of this.newMultiSet(nesting). Changes to this SetMaker after the construction of this factory will not affect the result of calls to the factory's create() method.

Returns:
a factory of type MultiSet

hash

public static <V> SetMaker.HashSetMaker<V> hash()
Returns a new HashSetMaker for building hash sets

Returns:
HashSetMaker