|
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.AbstractSentenceTransformer
public abstract class AbstractSentenceTransformer
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. |
protected boolean |
productionCompleted
Indicates the producer is done and there will be no more to consume. |
| Fields inherited from interface org.apache.commons.chain.Command |
|---|
CONTINUE_PROCESSING, PROCESSING_COMPLETE |
| Constructor Summary | |
|---|---|
AbstractSentenceTransformer()
Create a new Chain. |
|
AbstractSentenceTransformer(Collection<Command> commands)
Construct a Chain configured with the
specified Commands. |
|
AbstractSentenceTransformer(Command command)
Construct a Chain configured with the
specified Command. |
|
AbstractSentenceTransformer(Command[] commands)
Construct a Chain configured with the
specified Commands. |
|
| Method Summary | |
|---|---|
void |
addCommand(Command command)
See the Chain JavaDoc. |
Boolean |
call()
|
boolean |
execute(Context context)
See the Chain JavaDoc. |
int |
getOutputQueueSize()
Get the size of the sentence transformation queue. |
boolean |
okToComplete()
Indicate that all processing is complete and it's ok to terminate. |
void |
processingComplete(SentenceProcessingCompleteEvent event)
This method gets called when a sentence processing is complete. |
void |
setOutputQueueSize(int size)
Set the size of the sentence transformation 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.SentenceTransformer |
|---|
transform |
| Methods inherited from interface textractor.sentence.SentenceProcessor |
|---|
addSentenceProcessedListener, addSentenceProcessingCompleteListener, getNumberOfArticlesProcessed, getNumberOfSentencesProcessed, removeSentenceProcessedListener, removeSentenceProcessingCompleteListener |
| Field Detail |
|---|
protected boolean productionCompleted
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 AbstractSentenceTransformer()
Chain.
public AbstractSentenceTransformer(Command command)
Chain configured with the
specified Command.
command - The Command to be
configured
IllegalArgumentException - if command is
nullpublic AbstractSentenceTransformer(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 AbstractSentenceTransformer(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
public final Boolean call()
throws Exception
call in interface Callable<Boolean>Exceptionpublic void processingComplete(SentenceProcessingCompleteEvent event)
processingComplete in interface SentenceProcessingCompleteListenerevent - A SentenceProcessingCompleteEvent object
describing the event source.public boolean okToComplete()
SentenceProcessingCompleteEvent.
Be aware of this and send the event if you override the default
behavior.
public int getOutputQueueSize()
public void setOutputQueueSize(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 | |||||||||