Example usage for org.apache.commons.collections.iterators FilterIterator setPredicate

List of usage examples for org.apache.commons.collections.iterators FilterIterator setPredicate

Introduction

In this page you can find the example usage for org.apache.commons.collections.iterators FilterIterator setPredicate.

Prototype

public void setPredicate(Predicate predicate) 

Source Link

Document

Sets the predicate this the iterator to use.

Usage

From source file:com.sworddance.util.PredicatedTransformingIterator.java

private void initIfNeeded() {
    if (baseIterator == null) {
        FilterIterator filtering = new FilterIterator(iterator);
        filtering.setPredicate(predicate == null ? TruePredicate.INSTANCE : predicate);
        baseIterator = new TransformIterator(filtering);
        baseIterator.setTransformer(transformer == null ? NOPTransformer.INSTANCE : transformer);
    }//www  .  j  a  v a  2s . c  om
}