|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.collections15.functors.factory.ConstantFactory<E>
public class ConstantFactory<E>
Factory
implementation that returns the same constant each
time.
ConstantFactory
. Mutable objects should
use the PrototypeFactory
instead.
Constructor Summary | |
---|---|
protected |
ConstantFactory(E constantToReturn)
Creates a new instance that returns the specified constant. |
Method Summary | ||
---|---|---|
E |
create()
Always returns the stored constant value. |
|
E |
getConstant()
Gets the stored constant value. |
|
static
|
getInstance(E constantToReturn)
Factory method that performs validation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected ConstantFactory(E constantToReturn)
constantToReturn
- The constant to return each time. May be
null
.Method Detail |
---|
public static <E> ConstantFactory<E> getInstance(E constantToReturn)
constantToReturn
- the constant object to return each time in the
factory
constant
factory.public E create()
create
in interface Factory<E>
public E getConstant()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |