edu.washington.cs.knowitall.extractor.mapper
Class Mapper<T>
java.lang.Object
edu.washington.cs.knowitall.extractor.mapper.Mapper<T>
- Type Parameters:
T -
- Direct Known Subclasses:
- FilterMapper, IndependentMapper, MapperList, MaxMapper, MergeOverlappingMapper
public abstract class Mapper<T>
- extends Object
A class for taking a stream of T objects and modifying it
somehow (e.g. by filtering or modifying some objects). A Mapper
object has two states: enabled and disabled. If the Mapper is
disabled, it will return the stream of objects unmodified.
Subclasses extending Mapper should implement the
doMap(Iterable objects) method.
- Author:
- afader
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Mapper
public Mapper()
doMap
protected abstract Iterable<T> doMap(Iterable<T> objects)
- Parameters:
objects - a stream of objects
- Returns:
- a modified stream of objects
map
public Iterable<T> map(Iterable<T> objects)
- Parameters:
objects - a stream of objects
- Returns:
- a modified stream of objects if the mapper is enabled, the
unmodified input stream otherwise.
isEnabled
public boolean isEnabled()
- Returns:
true if this mapper is enabled.
disable
public void disable()
- Disables this mapper.
enable
public void enable()
- Enables this mapper.
Copyright © 2010-2012 University of Washington CSE. All Rights Reserved.