Class ShuffleIfRequested<T extends InputFromManager>
- Type Parameters:
T
- input-object type
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected InputsWithDirectory
<T> inputsFromDelegate
(InputsWithDirectory<T> fromDelegate, InputManagerParameters parameters) Calculates the inputs to return given the inputs from the delegate.boolean
When true, the inputs are sorted alphabetically, if a shuffle is not requested.void
setSortIfNotRequested
(boolean sortIfNotRequested) When true, the inputs are sorted alphabetically, if a shuffle is not requested.Methods inherited from class org.anchoranalysis.io.input.bean.InputManagerUnary
getInput, inputs, setInput
Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
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 classInputManagerUnary<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.
-