Class OutputSequenceIndexed<T,S>

Object
OutputSequenceIndexed<T,S>
Type Parameters:
T - element-type in generator
S - index-type in sequence

public class OutputSequenceIndexed<T,S> extends Object
A sequence of outputs that use the same generator with non-incrementing indexes for each output.

An index is associated with each output that must be unique.

Author:
Owen Feehan
  • Method Details

    • add

      public void add(T element, S index) throws OutputWriteFailedException
      Outputs an additional element in the sequence.

      This is a thread-safe method.

      Parameters:
      element - the element
      index - index of the element to output
      Throws:
      OutputWriteFailedException - if the output cannot be successfully written.
    • add

      public void add(T element, Optional<S> index) throws OutputWriteFailedException
      Outputs an additional element in the sequence.

      This is a thread-safe method.

      Parameters:
      element - the element
      index - index of the element to output, if it exists. if it doesn't exist, the element will be written without any name.
      Throws:
      OutputWriteFailedException - if the output cannot be successfully written.