textractor.chain
Class AbstractSentenceConsumer
java.lang.Object
textractor.sentence.AbstractSentenceProcessor
textractor.chain.AbstractSentenceConsumer
- All Implemented Interfaces:
- Callable<Boolean>, EventListener, Command, SentenceProcessingCompleteListener, SentenceConsumer, SentenceProcessor, TextractorProcessor
- Direct Known Subclasses:
- DocumentStoreBuilder, Indexer, SentenceWriter
public abstract class AbstractSentenceConsumer
- extends AbstractSentenceProcessor
- implements Command, SentenceConsumer, SentenceProcessingCompleteListener, Callable<Boolean>
Command implementation that executes
a SentenceConsumer.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
productionCompleted
protected boolean productionCompleted
- Indicates the producer is done and there will be no more to consume.
textractorContext
protected TextractorContext textractorContext
- The
Context that this SentenceConsumer can use.
AbstractSentenceConsumer
public AbstractSentenceConsumer()
- Create a new
Command to consume sentences.
execute
public final boolean execute(Context context)
- Specified by:
execute in interface Command
call
public final Boolean call()
throws Exception
- Specified by:
call in interface Callable<Boolean>
- Throws:
Exception
okToComplete
public boolean okToComplete()
- Indicate that all processing is complete and it's ok to terminate.
If false is returned the consumer thread will terminate without firing
a
SentenceProcessingCompleteEvent.
Be aware of this and send the event if you override the default
behavior.
- Returns:
- true if it's ok to complete.
processingComplete
public void processingComplete(SentenceProcessingCompleteEvent event)
- This method gets called when a sentence processing is complete.
- Specified by:
processingComplete in interface SentenceProcessingCompleteListener
- Parameters:
event - A SentenceProcessingCompleteEvent object describing
the event source.
Copyright © 2003-2008 Institute for Computational Biomedicine, All Rights Reserved.