Package opennlp.tools.util

## Interface SequenceCodec<T>

- Type Parameters:
    `T` - The generic type for the elements to handle.
  All Known Implementing Classes:
    `BilouCodec`, `BioCodec`

      public interface SequenceCodec<T>

  A codec for sequences of type `SequenceCodec`. Defines methods to en- or decode, and validate.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `boolean` | `areOutcomesCompatible​(String[] outcomes)` | Checks if the `outcomes` of a model are compatible with this `SequenceCodec`.
    `SequenceValidator<T>` | `createSequenceValidator()` |
    `Span[]` | `decode​(List<T> c)` | Decodes a sequence of `objects` into `Span` objects.
    `T[]` | `encode​(Span[] names, int length)` | Encodes `Span` objects into a sequence of `objects`.

- - ### Method Detail

    - #### decode

          Span[] decode​(List<T> c)

      Decodes a sequence of `objects` into `Span` objects.
      Parameters:
        `c` - A list of `SequenceCodec` to decode.
      Returns:
        A `Span` array encapsulating the decoded elements in `c`.

    - #### encode

          T[] encode​(Span[] names,
                     int length)

      Encodes `Span` objects into a sequence of `objects`.
      Parameters:
        `names` - A list of `elements` to encode.
        `length` - The length to respect.
      Returns:
        An array of `SequenceCodec` to encode.

    - #### createSequenceValidator

          SequenceValidator<T> createSequenceValidator()

      Returns:
        A `SequenceValidator` which can validate a sequence of `outcomes`.

    - #### areOutcomesCompatible

          boolean areOutcomesCompatible​(String[] outcomes)

      Checks if the `outcomes` of a model are compatible with this `SequenceCodec`.
      Parameters:
        `outcomes` - The possible model outcomes.
      Returns:
        `true` if `outcomes` are type compatible, `false` otherwise.