Package org.anchoranalysis.io.input
Class InputsWithDirectory<T extends InputFromManager>
Object
InputsWithDirectory<T>
- Type Parameters:
T
- input-type
All inputs for an experiment, together with any parent directory which is specified as a parent
for these inputs.
All inputs must be contained in this directory or one of its sub-direcotries.
- Author:
- Owen Feehan
-
Constructor Summary
ConstructorsConstructorDescriptionInputsWithDirectory
(List<T> inputs) Creates without any parent directory.InputsWithDirectory
(List<T> inputs, Optional<Path> directory) Creates a newInputsWithDirectory
instance. -
Method Summary
Modifier and TypeMethodDescriptionThe directory associated with the inputs.boolean
Find all files in the input directory are not used as inputs.int
hashCode()
inputs()
The inputs.boolean
isEmpty()
Whether no inputs exist.iterator()
Returns an iterator over the elements in this list in proper sequence.Returns a list iterator over the elements in this list (in proper sequence).<S extends InputFromManager>
InputsWithDirectory<S> Creates a newInputsWithDirectory
which is the result of mapping the existing inputs.<S extends InputFromManager,
E extends Exception>
InputsWithDirectory<S> map
(CheckedFunction<T, S, E> mapFunction, Class<? extends E> throwableClass) Creates a newInputsWithDirectory
which is the result of mapping the existing inputs.toString()
<S extends InputFromManager>
InputsWithDirectory<S> withInputs
(List<S> inputsToAssign) Changes the inputs, but preserves the directory.
-
Constructor Details
-
InputsWithDirectory
Creates without any parent directory.- Parameters:
inputs
- the inputs.
-
InputsWithDirectory
Creates a newInputsWithDirectory
instance.- Parameters:
inputs
- The inputs.directory
- The directory associated with the inputs.
-
-
Method Details
-
map
Creates a newInputsWithDirectory
which is the result of mapping the existing inputs.This is an immutable operation.
- Type Parameters:
S
- the type of inputs that are mapped to.- Parameters:
mapFunction
- the function that transforms and existing input into a new input.- Returns:
- a newly created input-manager with the mapped inputs, but an identical directory.
-
map
public <S extends InputFromManager,E extends Exception> InputsWithDirectory<S> map(CheckedFunction<T, S, throws EE> mapFunction, Class<? extends E> throwableClass) Creates a newInputsWithDirectory
which is the result of mapping the existing inputs.This is an immutable operation.
- Type Parameters:
S
- the type of inputs that are mapped to.E
- an exception that may be thrown bymapFunction
.- Parameters:
mapFunction
- the function that transforms and existing input into a new input.throwableClass
- class type of exception that may be thrown bymapFunction
.- Returns:
- a newly created input-manager with the mapped inputs, but an identical directory.
- Throws:
E
- if thrown bymapFunction
.
-
withInputs
Changes the inputs, but preserves the directory.This is an immutable operation.
- Type Parameters:
S
- type of inputs to assign- Parameters:
inputsToAssign
- inputs to assign- Returns:
- a newly created input-manager with
inputsToAssign
, but an unchanged directory.
-
findAllNonInputFiles
Find all files in the input directory are not used as inputs.- Returns:
- the files, with an identifier derived relative to the input-directory
- Throws:
OperationFailedException
- if directory isn't defined
-
isEmpty
public boolean isEmpty()Whether no inputs exist.- Returns:
- true if no inputs exist, false if at least one input exists.
-
iterator
Returns an iterator over the elements in this list in proper sequence.- Returns:
- an iterator over the elements in this list in proper sequence
-
listIterator
Returns a list iterator over the elements in this list (in proper sequence).- Returns:
- a list iterator over the elements in this list (in proper sequence)
-
inputs
The inputs. -
directory
The directory associated with the inputs. -
equals
-
hashCode
public int hashCode() -
toString
-