ca.grimoire.formtree.receiver.constructor
Class SetReceiver<T>

java.lang.Object
  extended by ca.grimoire.formtree.receiver.constructor.CollectionReceiver<T,java.util.Set<T>>
      extended by ca.grimoire.formtree.receiver.constructor.SetReceiver<T>
Type Parameters:
T - the type of the elements in the set.
All Implemented Interfaces:
FormElementReceiver, FormReceiver<java.util.Set<T>>

public class SetReceiver<T>
extends CollectionReceiver<T,java.util.Set<T>>

Receives constructible elements into a Set.


Field Summary
 
Fields inherited from class ca.grimoire.formtree.receiver.constructor.CollectionReceiver
elementClass
 
Constructor Summary
SetReceiver(java.lang.Class<T> elementClass)
          Creates a new receiver for a set of some constructible element type.
 
Method Summary
static java.lang.Class<?> acceptableSetType(java.lang.reflect.Type type)
          Determines whether some Type represents a set of constructible elements.
static
<T> SetReceiver<T>
create(java.lang.Class<T> elementClass)
          A type-inferring alternative to SetReceiver(Class).
protected  java.util.Set<T> createCollection(java.util.List<T> elements)
          Converts the passed list of elements into a Set.
 
Methods inherited from class ca.grimoire.formtree.receiver.constructor.CollectionReceiver
acceptableElementClass, acceptableElementClass, finished, index, key, values
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SetReceiver

public SetReceiver(java.lang.Class<T> elementClass)
Creates a new receiver for a set of some constructible element type.

Parameters:
elementClass - the Class of <T>.
Method Detail

acceptableSetType

public static java.lang.Class<?> acceptableSetType(java.lang.reflect.Type type)
Determines whether some Type represents a set of constructible elements.

Parameters:
type - the Type to examine.
Returns:
the Class of the elements of the set, or null if type does not represent a set of constructible elements.

create

public static <T> SetReceiver<T> create(java.lang.Class<T> elementClass)
A type-inferring alternative to SetReceiver(Class).

Type Parameters:
T - the type of the elements in the set.
Parameters:
elementClass - the Class of <T>
Returns:
a new SetReceiver.

createCollection

protected java.util.Set<T> createCollection(java.util.List<T> elements)
Converts the passed list of elements into a Set.

Specified by:
createCollection in class CollectionReceiver<T,java.util.Set<T>>
Parameters:
elements - the collection contents.
Returns:
the corresponding collection.
See Also:
CollectionReceiver.createCollection(java.util.List)


Copyright © 2011 Grimoire Alchymia. All Rights Reserved.