edu.washington.cs.knowitall.extractor.mapper
Class MapperList<T>

java.lang.Object
  extended by edu.washington.cs.knowitall.extractor.mapper.Mapper<T>
      extended by edu.washington.cs.knowitall.extractor.mapper.MapperList<T>
Type Parameters:
T -
Direct Known Subclasses:
ReVerbArgument1Mappers, ReVerbArgument2Mappers, ReVerbRelationMappers

public class MapperList<T>
extends Mapper<T>

A list of Mapper objects. Applies each mapper in the list to an input stream of T objects in order.

Author:
afader

Constructor Summary
MapperList()
          Constructs an empty list of mappers.
MapperList(java.util.List<Mapper<T>> mappers)
          Constructs a new list of mappers from the given list.
 
Method Summary
 void addMapper(Mapper<T> mapper)
          Adds a mapper to the end of the list.
protected  java.lang.Iterable<T> doMap(java.lang.Iterable<T> objects)
           
 java.lang.Iterable<Mapper<T>> getMappers()
           
 
Methods inherited from class edu.washington.cs.knowitall.extractor.mapper.Mapper
disable, enable, isEnabled, map
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapperList

public MapperList()
Constructs an empty list of mappers.


MapperList

public MapperList(java.util.List<Mapper<T>> mappers)
Constructs a new list of mappers from the given list.

Parameters:
mappers - another mapper list.
Method Detail

getMappers

public java.lang.Iterable<Mapper<T>> getMappers()
Returns:
the Mapper objects in this list.

addMapper

public void addMapper(Mapper<T> mapper)
Adds a mapper to the end of the list. This mapper will be the last one to be applied to the input stream of objects.

Parameters:
mapper -

doMap

protected java.lang.Iterable<T> doMap(java.lang.Iterable<T> objects)
Specified by:
doMap in class Mapper<T>
Parameters:
objects - a stream of objects
Returns:
a modified stream of objects