de.unidu.is.text
Class CounterFilter

java.lang.Object
  extended byde.unidu.is.text.CounterFilter
All Implemented Interfaces:
Filter

public class CounterFilter
extends java.lang.Object
implements Filter

This filter counts occurences of objects, and returns a list of object-frequency pairs.

Since:
2003-09-11
Version:
$Revision $, $Date: 2005/02/21 17:29:28 $
Author:
Henrik Nottelmann

Constructor Summary
CounterFilter(Filter nextFilter)
          Creates a new instance and sets the next filter in the chain.
 
Method Summary
 java.util.Iterator apply(java.util.Iterator iterator)
          Applies this filter on each object returned by the specified iterator.
 java.util.Iterator apply(java.lang.Object seed)
          Applies this filter on the specified single object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CounterFilter

public CounterFilter(Filter nextFilter)
Creates a new instance and sets the next filter in the chain.

Parameters:
nextFilter - next filter in the filter chain
Method Detail

apply

public java.util.Iterator apply(java.lang.Object seed)
Applies this filter on the specified single object.

Specified by:
apply in interface Filter
Parameters:
seed - object on which the filter is applied
Returns:
iterator over the resulting objects
See Also:
Filter.apply(java.lang.Object)

apply

public java.util.Iterator apply(java.util.Iterator iterator)
Applies this filter on each object returned by the specified iterator.

This method first calls the next filter in the filter chain (if existing), and then applies this filter on the specified iterator.

Specified by:
apply in interface Filter
Parameters:
iterator - iterator over objects on which the filter is applied
Returns:
iterator over the resulting objects
See Also:
Filter.apply(java.util.Iterator)