|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.collections15.functors.transformer.ConstantTransformer<I,O>
public class ConstantTransformer<I,O>
Transformer
implementation that returns the same constant each
time.
ConstantTransformer
. Mutable objects
should use the FactoryTransformer
, seeded with a PrototypeFactory
Constructor Summary | |
---|---|
protected |
ConstantTransformer(O constant)
Creates a new instance whose transform(I) method always returns the
specified constant. |
Method Summary | ||
---|---|---|
O |
getConstant()
Returns the constant used by this Transformer . |
|
static
|
getInstance(O constant)
Returns an instance whose transform(I) method always returns the
specified constant. |
|
O |
transform(I input)
Transforms the input by ignoring it and returning the stored constant instead. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected ConstantTransformer(O constant)
transform(I)
method always returns the
specified constant.
constant
- The constant to be returned each time the transform(I)
method is invoked. May be null
.Method Detail |
---|
public static <I,O> ConstantTransformer<I,O> getInstance(O constant)
transform(I)
method always returns the
specified constant.
constant
- The constant to be returned each time the transform(I)
method is invoked. May be null
.
transform(I)
method always returns the
specified constant.public O transform(I input)
transform
in interface Transformer<I,O>
input
- The input object which is ignored.
public O getConstant()
Transformer
.
Transformer
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |