org.apache.commons.collections.functors

Class TransformerPredicate

Implemented Interfaces:
Predicate, Serializable

public final class TransformerPredicate
extends java.lang.Object
implements Predicate, Serializable

Predicate implementation that returns the result of a transformer.
Version:
$Revision: 1.6 $ $Date: 2004/05/16 11:16:01 $
Author:
Stephen Colebourne
Since:
Commons Collections 3.0

Constructor Summary

TransformerPredicate(Transformer transformer)
Constructor that performs no validation.

Method Summary

boolean
evaluate(Object object)
Evaluates the predicate returning the result of the decorated transformer.
static Predicate
getInstance(Transformer transformer)
Factory to create the predicate.
Transformer
getTransformer()
Gets the transformer.

Constructor Details

TransformerPredicate

public TransformerPredicate(Transformer transformer)
Constructor that performs no validation. Use getInstance if you want that.
Parameters:
transformer - the transformer to decorate

Method Details

evaluate

public boolean evaluate(Object object)
Evaluates the predicate returning the result of the decorated transformer.
Specified by:
evaluate in interface Predicate
Parameters:
object - the input object
Returns:
true if decorated transformer returns Boolean.TRUE

getInstance

public static Predicate getInstance(Transformer transformer)
Factory to create the predicate.
Parameters:
transformer - the transformer to decorate
Returns:
the predicate

getTransformer

public Transformer getTransformer()
Gets the transformer.
Returns:
the transformer
Since:
Commons Collections 3.1

Copyright © 2001-2006 Apache Software Foundation. All Rights Reserved.