Class InputBound<T,S>

Object
InputBound<T,S>
Type Parameters:
T - input-object type
S - shared-state type

public class InputBound<T,S> extends Object
Input for executing a task, associated with shared-state and other parameters.
Author:
Owen Feehan
  • Constructor Details

    • InputBound

      public InputBound(T input, S sharedState, boolean detailedLogging, InputOutputContextStateful contextExperiment, InputOutputContextStateful contextJob)
      Creates a new InputBound instance.
      Parameters:
      input - The input is bound. *
      sharedState - The state shared between inputs.
      detailedLogging - Whether logging is more detailed (true) or less detailed (false).
      contextExperiment - The input-output context associated with the current experiment.
      contextJob - The input-output context associated with the current job.
  • Method Details

    • changeInput

      public <U> InputBound<U,S> changeInput(U inputToAssign)
      Copies the current instance but changes the input.

      This an immutable operation that does not alter the existing instance.

      Type Parameters:
      U - the type of inputToAssign.
      Parameters:
      inputToAssign - the input in the copy, that replaces the existing input.
      Returns:
      a copy of the current instance, except the input is replaced with inputToAssign.
    • changeInputAndSharedState

      public <U, V> InputBound<U,V> changeInputAndSharedState(U inputToAssign, V sharedStateToAssign)
      Copies the current instance but changes both the input and shared-state.

      This an immutable operation that does not alter the existing instance.

      Type Parameters:
      U - the type of inputToAssign.
      V - the type of sharedStateToAssign.
      Parameters:
      inputToAssign - the input in the copy, that replaces the existing input.
      sharedStateToAssign - the shared-state in the copy, that replaces the existing shared-state.
      Returns:
      a copy of the current instance, except the input is replaced with inputToAssign.
    • createInitializationContext

      public InitializationContext createInitializationContext()
      Creates an InitializationContext from the current instance.
      Returns:
      a newly created InitializationContext.
    • getOutputter

      public Outputter getOutputter()
      The Outputter associated with this input, as it is being processed as a job.
      Returns:
      the outputter.
    • getLogger

      public Logger getLogger()
      The Logger associated with this input, as it is being processed as a job.
      Returns:
      the logger.
    • getLogReporterJob

      public StatefulMessageLogger getLogReporterJob()
      The StatefulMessageLogger associated with the job thati s being processed.
      Returns:
      the logger.
    • getTaskArguments

      public TaskArguments getTaskArguments()
      The arguments for the task that is being processed.
      Returns:
      the arguments.
    • getInput

      public T getInput()
      The input is bound. *
    • getSharedState

      public S getSharedState()
      The state shared between inputs.
    • isDetailedLogging

      public boolean isDetailedLogging()
      Whether logging is more detailed (true) or less detailed (false).
    • getContextExperiment

      public InputOutputContextStateful getContextExperiment()
      The input-output context associated with the current experiment.
    • getContextJob

      public InputOutputContextStateful getContextJob()
      The input-output context associated with the current job.