Class ShuffleIfRequested<T extends InputFromManager>

Type Parameters:
T - input-object type

public class ShuffleIfRequested<T extends InputFromManager> extends InputManagerUnary<T>
Like Shuffle if requested in the InputContextParameters otherwise makes no change to the inputs.

If a shuffle is requested, the inputs may be sorted alphabetically (depending on sortIfNotRequested.

The operations are coupled, as sorting makes no sense when shuffling is occurring, but is often desirable otherwise.

Author:
Owen Feehan
  • Constructor Details

    • ShuffleIfRequested

      public ShuffleIfRequested()
  • Method Details

    • inputsFromDelegate

      protected InputsWithDirectory<T> inputsFromDelegate(InputsWithDirectory<T> fromDelegate, InputManagerParameters parameters) throws InputReadFailedException
      Description copied from class: InputManagerUnary
      Calculates the inputs to return given the inputs from the delegate.
      Specified by:
      inputsFromDelegate in class InputManagerUnary<T extends InputFromManager>
      Parameters:
      fromDelegate - the inputs from the delegate.
      parameters - parameters for determining inputs.
      Returns:
      inputs to return after any further processing.
      Throws:
      InputReadFailedException - if inputs cannot be successfully read from the file-system.
    • isSortIfNotRequested

      public boolean isSortIfNotRequested()
      When true, the inputs are sorted alphabetically, if a shuffle is not requested.
    • setSortIfNotRequested

      public void setSortIfNotRequested(boolean sortIfNotRequested)
      When true, the inputs are sorted alphabetically, if a shuffle is not requested.