edu.illinois.cs.cogcomp.lbj.coref.exampleExtractors
Class BatchExExtractor<T>

java.lang.Object
  extended by edu.illinois.cs.cogcomp.lbj.coref.exampleExtractors.ExampleExtractor<T>
      extended by edu.illinois.cs.cogcomp.lbj.coref.exampleExtractors.BatchExExtractor<T>
Type Parameters:
T - The type of example.
All Implemented Interfaces:
LBJ2.parse.Parser
Direct Known Subclasses:
FilteredBatchExExtractor

public abstract class BatchExExtractor<T>
extends ExampleExtractor<T>

The base class for all example extractors that use a batch process.

Author:
Eric Bengtson

Field Summary
private  java.util.List<T> m_exampleCache
           
private  int m_exampleCacheNextIx
           
 
Constructor Summary
BatchExExtractor()
           
 
Method Summary
protected abstract  java.util.List<T> generateAllExamples()
          Generate all (non-filtered) examples.
 java.util.List<T> getExamples()
          Gets all the examples.
protected  T getNextCached()
          Gets the next entry in the cache, The cache will be populated with examples from getExamples().
 T next()
          Get the next example.
 void recordEquivalence()
          Does nothing, since extractor is a batch extractor.
 void reset()
          Reset the extractor.
 
Methods inherited from class edu.illinois.cs.cogcomp.lbj.coref.exampleExtractors.ExampleExtractor
close, enqueue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_exampleCache

private java.util.List<T> m_exampleCache

m_exampleCacheNextIx

private int m_exampleCacheNextIx
Constructor Detail

BatchExExtractor

public BatchExExtractor()
Method Detail

generateAllExamples

protected abstract java.util.List<T> generateAllExamples()
Generate all (non-filtered) examples.

Returns:
A list of all the examples to be extracted.

next

public T next()
Get the next example.

Specified by:
next in interface LBJ2.parse.Parser
Specified by:
next in class ExampleExtractor<T>
Returns:
the next example, or null when done.

getExamples

public java.util.List<T> getExamples()
Gets all the examples.

Returns:
examples that would be returned by repeated calls to next(). Does not include the final null that next() would return.

recordEquivalence

public void recordEquivalence()
Does nothing, since extractor is a batch extractor.


getNextCached

protected T getNextCached()
Gets the next entry in the cache, The cache will be populated with examples from getExamples().

Returns:
The next cached example.

reset

public void reset()
Reset the extractor. After calling this method, next() should begin returning examples starting with the first example.

Specified by:
reset in interface LBJ2.parse.Parser
Overrides:
reset in class ExampleExtractor<T>