com.googlecode.whatswrong
Class FilterPipeline

java.lang.Object
  extended by com.googlecode.whatswrong.FilterPipeline
All Implemented Interfaces:
NLPInstanceFilter

public class FilterPipeline
extends java.lang.Object
implements NLPInstanceFilter

A FilterPipeline filters an NLPInstance by iteratively calling a sequence of delegate filters.

Author:
Sebastian Riedel

Constructor Summary
FilterPipeline(NLPInstanceFilter... filters)
          Creates a new filter pipeline with the given filters.
 
Method Summary
 NLPInstance filter(NLPInstance original)
          Applies the 1st filter to the original instance, the 2nd filter to the result of the 1st filter, and so on.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilterPipeline

public FilterPipeline(NLPInstanceFilter... filters)
Creates a new filter pipeline with the given filters.

Parameters:
filters - the filters of the pipeline. The first filter will be applied first, the last filter last.
Method Detail

filter

public NLPInstance filter(NLPInstance original)
Applies the 1st filter to the original instance, the 2nd filter to the result of the 1st filter, and so on.

Specified by:
filter in interface NLPInstanceFilter
Parameters:
original - the original instance.
Returns:
the result of the last filter applied to the previous result.
See Also:
NLPInstanceFilter.filter(NLPInstance)


Copyright © 2009. All Rights Reserved.