|
Textractor API textractor-720 (20091120123250) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecttextractor.sentence.AbstractSentenceProcessor
textractor.chain.AbstractSentenceProducer
public abstract class AbstractSentenceProducer
Base class for Chain implementations that
contain one or more SentenceProcessor commands.
| Field Summary | |
|---|---|
protected List<Command> |
commands
The list of Commands configured for
this Chain, in the order in which they
may delegate processing to the remainder of the
Chain. |
protected boolean |
frozen
Flag indicating whether the configuration of our commands list has been frozen by a call to the execute() method. |
| Fields inherited from interface org.apache.commons.chain.Command |
|---|
CONTINUE_PROCESSING, PROCESSING_COMPLETE |
| Constructor Summary | |
|---|---|
AbstractSentenceProducer()
Create a new Chain. |
|
AbstractSentenceProducer(Collection<Command> commands)
Construct a Chain configured with the
specified Commands. |
|
AbstractSentenceProducer(Command command)
Construct a Chain configured with the
specified Command. |
|
AbstractSentenceProducer(Command[] commands)
Construct a Chain configured with the
specified Commands. |
|
| Method Summary | |
|---|---|
void |
addCommand(Command command)
See the Chain JavaDoc. |
boolean |
execute(Context context)
See the Chain JavaDoc. |
int |
getWorkQueueSize()
Get the size of the sentence production queue. |
void |
processingComplete(SentenceProcessingCompleteEvent event)
This method gets called when a sentence processing is complete. |
protected void |
produce(Article article,
Collection<Sentence> sentences)
Create a article sentence pair object from the individual objects for a sentence consumer to process. |
void |
setWorkQueueSize(int size)
Set the size of the sentence production queue. |
| Methods inherited from class textractor.sentence.AbstractSentenceProcessor |
|---|
addSentenceProcessedListener, addSentenceProcessingCompleteListener, fireSentenceProcessedEvent, fireSentenceProcessingCompleteEvent, removeSentenceProcessedListener, removeSentenceProcessingCompleteListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface textractor.sentence.SentenceProducer |
|---|
produce |
| Methods inherited from interface textractor.sentence.SentenceProcessor |
|---|
addSentenceProcessedListener, addSentenceProcessingCompleteListener, getNumberOfArticlesProcessed, getNumberOfSentencesProcessed, removeSentenceProcessedListener, removeSentenceProcessingCompleteListener |
| Methods inherited from interface java.util.concurrent.Callable |
|---|
call |
| Field Detail |
|---|
protected final List<Command> commands
Commands configured for
this Chain, in the order in which they
may delegate processing to the remainder of the
Chain.
protected boolean frozen
execute() method.
| Constructor Detail |
|---|
public AbstractSentenceProducer()
Chain.
public AbstractSentenceProducer(Command command)
Chain configured with the
specified Command.
command - The Command to be
configured
IllegalArgumentException - if command is
nullpublic AbstractSentenceProducer(Command[] commands)
Chain configured with the
specified Commands.
commands - The Commands to be configured
IllegalArgumentException - if commands,
or one of the individual Command
elements, is nullpublic AbstractSentenceProducer(Collection<Command> commands)
Chain configured with the
specified Commands.
commands - The Commands to be
configured
IllegalArgumentException - if commands,
or one of the individual Command
elements, is null| Method Detail |
|---|
public final void addCommand(Command command)
Chain JavaDoc.
addCommand in interface Chaincommand - The Command to be added
IllegalArgumentException - if command
is null
IllegalStateException - if no further configuration is allowed
public final boolean execute(Context context)
throws Exception
Chain JavaDoc.
execute in interface Chainexecute in interface Commandcontext - The Context to be
processed by this Chain
true if the processing of this
Context has been completed, or
false if the processing of this
Context should be delegated to a
subsequent Command in an enclosing
Chain
Exception - if there is a problem executing the Chain.
IllegalArgumentException - if context is
null
protected final void produce(Article article,
Collection<Sentence> sentences)
article - The article assoicated with the sentences.sentences - A collection of Sentences to process.public void processingComplete(SentenceProcessingCompleteEvent event)
SentenceProcessingCompleteListener
processingComplete in interface SentenceProcessingCompleteListenerevent - A SentenceProcessingCompleteEvent object describing
the event source.public int getWorkQueueSize()
public void setWorkQueueSize(int size)
size - The size of the queue.
|
Textractor API textractor-720 (20091120123250) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||