public class Pipeline extends java.lang.Object implements IPipeline, IObservable, IObserver
IPipeline
interface.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_ID |
Constructor and Description |
---|
Pipeline()
Creates a new Pipeline object.
|
Modifier and Type | Method and Description |
---|---|
void |
addObserver(IObserver observer)
Attaches a observer to the Observable.
|
void |
addStep(IPipelineStep step)
Adds a step to this pipeline.
|
void |
cancel()
Cancels processing on this pipeline.
|
void |
clearSteps()
Remove all the
IPipelineStep s from the pipeline. |
int |
countObservers()
Counts how many Observers were attached to this class.
|
void |
deleteObserver(IObserver observer)
Detaches a previously attached observer to the observable.
|
void |
deleteObservers()
Detaches all previously attached observer to the observable.
|
void |
destroy()
Frees all resources from all steps in this pipeline.
|
void |
endBatch()
Finishes a batch of inputs.
|
java.lang.String |
getId()
Get the Pipelines identifier.
|
java.util.List<IObserver> |
getObservers()
Returns list of observers registered with the Observable.
|
PipelineReturnValue |
getState()
Gets the current pipeline state.
|
java.util.List<IPipelineStep> |
getSteps()
Gets the list of all steps in this pipeline.
|
void |
notifyObservers()
Notifies all attached observers about changes in the observable.
|
void |
notifyObservers(java.lang.Object arg)
Notifies all attached observers about changes in the observable.
|
void |
process(Event input)
|
void |
process(RawDocument input)
Starts
IPipeline processing with a RawDocument as input. |
void |
setId(java.lang.String id)
Set the pipelines identifier.
|
void |
startBatch()
Starts a batch of inputs.
|
void |
update(IObservable o,
java.lang.Object arg)
This method is called whenever the observed object is changed.
|
public static final java.lang.String DEFAULT_ID
public void startBatch()
IPipeline
startBatch
in interface IPipeline
public void endBatch()
IPipeline
public void addStep(IPipelineStep step)
IPipeline
public java.util.List<IPipelineStep> getSteps()
IPipeline
public void cancel()
IPipeline
public PipelineReturnValue getState()
IPipeline
public void process(RawDocument input)
IPipeline
IPipeline
processing with a RawDocument
as input. This is a convenience method that calls
IPipeline.process(Event)
.public void destroy()
IPipeline
public void clearSteps()
IPipeline
IPipelineStep
s from the pipeline. Also calls the destroy() method on each step.clearSteps
in interface IPipeline
public java.lang.String getId()
IPipeline
public void setId(java.lang.String id)
IPipeline
public void update(IObservable o, java.lang.Object arg)
IObserver
public void addObserver(IObserver observer)
IObservable
addObserver
in interface IObservable
observer
- The observer to attach to the observablepublic int countObservers()
IObservable
countObservers
in interface IObservable
IObserver
public void deleteObserver(IObserver observer)
IObservable
deleteObserver
in interface IObservable
observer
- The observer to detach from the observablepublic void notifyObservers()
IObservable
notifyObservers
in interface IObservable
public void notifyObservers(java.lang.Object arg)
IObservable
notifyObservers
in interface IObservable
arg
- an arbitrary Object to be passed to the Observerpublic void deleteObservers()
IObservable
deleteObservers
in interface IObservable
public java.util.List<IObserver> getObservers()
IObservable
getObservers
in interface IObservable
Copyright © 2022. All rights reserved.