Class XPipelineStep
- java.lang.Object
-
- net.sf.okapi.common.pipelinebuilder.XPipelineStep
-
- All Implemented Interfaces:
AutoCloseable
,Function<Stream<Event>,Stream<Event>>
,IPipelineStep
public class XPipelineStep extends Object implements IPipelineStep
-
-
Constructor Summary
Constructors Constructor Description XPipelineStep(Class<? extends IPipelineStep> stepClass, URL parametersURL, boolean ignoreErrors)
XPipelineStep(Class<? extends IPipelineStep> stepClass, IParameters parameters)
XPipelineStep(Class<? extends IPipelineStep> stepClass, XParameter... parameters)
XPipelineStep(IPipelineStep step)
XPipelineStep(IPipelineStep step, URL parametersURL, boolean ignoreErrors)
XPipelineStep(IPipelineStep step, IParameters parameters)
XPipelineStep(IPipelineStep step, XParameter... parameters)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancel()
Cancel processing on this pipeline.void
destroy()
Executes any cleanup code for this step.String
getDescription()
Gets a short localizable description of what this step does.String
getHelpLocation()
Gets the relative directory location for the help of this step.String
getName()
Gets the localizable name of this step.IParameters
getParameters()
Gets the current parameters for this step.IPipelineStep
getStep()
Event
handleEvent(Event event)
Processes each event sent though the pipeline.boolean
isDone()
boolean
isLastOutputStep()
Is this step the last step with output in the pipeline?void
setLastOutputStep(boolean isLastStep)
Tell the step if it is the last one on the pipeline with output.void
setParameters(IParameters params)
Sets new parameters for this step.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.okapi.common.pipeline.IPipelineStep
apply, close, getSourceLocale, getTargetLocale, handleStream, setSourceLocale, setTargetLocale
-
-
-
-
Constructor Detail
-
XPipelineStep
public XPipelineStep(IPipelineStep step, IParameters parameters)
-
XPipelineStep
public XPipelineStep(IPipelineStep step)
-
XPipelineStep
public XPipelineStep(IPipelineStep step, XParameter... parameters)
-
XPipelineStep
public XPipelineStep(Class<? extends IPipelineStep> stepClass, IParameters parameters)
-
XPipelineStep
public XPipelineStep(Class<? extends IPipelineStep> stepClass, XParameter... parameters)
-
XPipelineStep
public XPipelineStep(IPipelineStep step, URL parametersURL, boolean ignoreErrors)
-
XPipelineStep
public XPipelineStep(Class<? extends IPipelineStep> stepClass, URL parametersURL, boolean ignoreErrors)
-
-
Method Detail
-
getDescription
public String getDescription()
Description copied from interface:IPipelineStep
Gets a short localizable description of what this step does.- Specified by:
getDescription
in interfaceIPipelineStep
- Returns:
- the text of a short description of what this step does.
-
getName
public String getName()
Description copied from interface:IPipelineStep
Gets the localizable name of this step.- Specified by:
getName
in interfaceIPipelineStep
- Returns:
- the localizable name of this step.
-
destroy
public void destroy()
Description copied from interface:IPipelineStep
Executes any cleanup code for this step. Called once at the end of the pipeline lifecycle.- Specified by:
destroy
in interfaceIPipelineStep
-
getHelpLocation
public String getHelpLocation()
Description copied from interface:IPipelineStep
Gets the relative directory location for the help of this step. The main help file for the step must be at that location and its name must be the name of the class implementing the step in lowercase with a .html extension.- Specified by:
getHelpLocation
in interfaceIPipelineStep
- Returns:
- the relative directory location for the help of this step.
-
getParameters
public IParameters getParameters()
Description copied from interface:IPipelineStep
Gets the current parameters for this step.- Specified by:
getParameters
in interfaceIPipelineStep
- Returns:
- the current parameters for this step or null if there are no parameters.
-
handleEvent
public Event handleEvent(Event event)
Description copied from interface:IPipelineStep
Processes each event sent though the pipeline.- Specified by:
handleEvent
in interfaceIPipelineStep
- Parameters:
event
- the event to process.- Returns:
- the event to pass down the pipeline.
-
isDone
public boolean isDone()
Description copied from interface:IPipelineStep
Steps that can generateEvent
s such asIFilter
s return false until no more events can be created. Steps which do not createEvent
s always return true.- Specified by:
isDone
in interfaceIPipelineStep
- Returns:
- false if can generate more events, true otherwise.
-
isLastOutputStep
public boolean isLastOutputStep()
Description copied from interface:IPipelineStep
Is this step the last step with output in the pipeline?- Specified by:
isLastOutputStep
in interfaceIPipelineStep
- Returns:
- true if last step with output, false otherwise.
-
setLastOutputStep
public void setLastOutputStep(boolean isLastStep)
Description copied from interface:IPipelineStep
Tell the step if it is the last one on the pipeline with output.- Specified by:
setLastOutputStep
in interfaceIPipelineStep
- Parameters:
isLastStep
- true if last step with output, false otherwise.
-
setParameters
public void setParameters(IParameters params)
Description copied from interface:IPipelineStep
Sets new parameters for this step.- Specified by:
setParameters
in interfaceIPipelineStep
- Parameters:
params
- the new parameters to use.
-
getStep
public IPipelineStep getStep()
-
cancel
public void cancel()
Description copied from interface:IPipelineStep
Cancel processing on this pipeline. EachIPipelineStep
is responsible to implement a cancel method that will interrupt long running operations- Specified by:
cancel
in interfaceIPipelineStep
-
-