1
2
3 package org.galagosearch.tupleflow;
4
5 import java.io.IOException;
6
7 /***
8 * This is the base class for most TupleFlow steps. Most TupleFlow steps convert
9 * data from some type T to some type U, then call the process method on some other
10 * processor. This class abstracts the details of implementing that kind of class.
11 *
12 * @author trevor
13 */
14 public abstract class StandardStep<T, U> implements Processor<T>, Source<U> {
15 public Processor<U> processor;
16
17 public abstract void process(T object) throws IOException;
18 public void setProcessor(Step next) throws IncompatibleProcessorException {
19 Linkage.link(this, next);
20 }
21 public void close() throws IOException {
22 processor.close();
23 }
24 }