public class SetBeanProvider extends CollectionBeanProvider
A specialized CollectionBeanProvider implementation that
creates a java.util.Set bean.
The createCollection() method is implemented to create a
concrete implementation of the java.util.Set interface.
Depending on the ordered flag that can be passed to the
constructor either a java.util.HashSet (if
ordered is false) or a
java.util.LinkedHashSet (if ordered is true)
is created. In the latter case the set will remember the order of its
elements.
Implementation note: Objects of this class are immutable and thus can be shared between multiple threads.
| Constructor and Description |
|---|
SetBeanProvider(Collection<Dependency> deps,
boolean ordered)
Creates a new instance of
SetBeanProvider and initializes
it with the dependencies of its elements and the ordered flag. |
| Modifier and Type | Method and Description |
|---|---|
protected Collection<Object> |
createCollection(int size)
Creates the collection managed by this bean provider.
|
boolean |
isOrdered()
Returns the
ordered flag. |
getBean, getBeanClass, getDependencies, getElementDependenciesgetLockID, isBeanAvailable, setLockID, shutdownpublic SetBeanProvider(Collection<Dependency> deps, boolean ordered)
SetBeanProvider and initializes
it with the dependencies of its elements and the ordered flag.deps - the dependencies representing the elements of the setordered - a flag whether the set created should keep the order of
its elementsIllegalArgumentException - if the collection with the dependencies
is nullpublic boolean isOrdered()
ordered flag. This flag determines the type of
the collection created by this bean provider.ordered flagprotected Collection<Object> createCollection(int size)
java.util.Set
interface (the concrete type depends on the ordered
property.createCollection in class CollectionBeanProvidersize - the size of the collectionCopyright © 2016 The JGUIraffe Team. All rights reserved.