net.sf.okapi.common.pipeline

## Interface IPipeline

- All Known Implementing Classes:
    Pipeline

      public interface IPipeline

  Common set of methods to drive an event-driven process. A pipeline is made of a chain of `IPipelineStep` objects through which documents are processed.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `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.
    `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.
    `PipelineReturnValue` | `getState()` Gets the current pipeline state.
    `java.util.List<IPipelineStep>` | `getSteps()` Gets the list of all steps in this pipeline.
    `void` | `process(Event input)` Starts `IPipeline` processing with a `Event` as 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.

- - ### Method Detail

    - #### process

          void process(RawDocument input)

      Starts `IPipeline` processing with a `RawDocument` as input. This is a convenience method that calls `process(Event)`.
      Parameters:
        `input` - the RawDocument to process.

    - #### process

          void process(Event input)

      Starts `IPipeline` processing with a `Event` as input.
      Parameters:
        `input` - event that primes the `IPipeline`

    - #### getState

          PipelineReturnValue getState()

      Gets the current pipeline state.
      Returns:
        the current state of the pipeline.

    - #### cancel

          void cancel()

      Cancels processing on this pipeline.

    - #### addStep

          void addStep(IPipelineStep step)

      Adds a step to this pipeline. Steps are executed in the order they are added.
      Parameters:
        `step` - the step to add.

    - #### getSteps

          java.util.List<IPipelineStep> getSteps()

      Gets the list of all steps in this pipeline.
      Returns:
        a list of all steps in this pipeline, the list may be empty.

    - #### startBatch

          void startBatch()

      Starts a batch of inputs.

    - #### endBatch

          void endBatch()

      Finishes a batch of inputs.

    - #### destroy

          void destroy()

      Frees all resources from all steps in this pipeline.

    - #### clearSteps

          void clearSteps()

      Remove all the `IPipelineStep`s from the pipeline. Also calls the destroy() method on each step.

    - #### setId

          void setId(java.lang.String id)

      Set the pipelines identifier.
      Parameters:
        `id` - the new id of the pipeline.

    - #### getId

          java.lang.String getId()

      Get the Pipelines identifier.
      Returns:
        String identifier