Package org.anchoranalysis.io.input
Class InputContextParameters
Object
org.anchoranalysis.io.input.InputContextParameters
public class InputContextParameters extends Object
Additional parameters that offer context for many beans that provide input-functions.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors Constructor Description InputContextParameters() -
Method Summary
Modifier and Type Method Description voidassignFilterGlob(String glob)Assigns a glob that can be used by beans to filter input.voidassignFixedLimit(int fixedLimit)Assigns a fixed upper limit of number of inputs.voidassignIdentifierSubrange(IndexRangeNegative identifierSubrange)If defined, this indicates and specifies only a subset of the elements of the identifier to use.voidassignInputDirectory(Optional<Path> inputDirectory)Sets an input-directory.voidassignInputFilterExtensions(StringSetTrie filterExtensions)Assigns extensions that can be used filter inputs, but irrespective of whether extensions have already been set.voidassignInputFilterExtensionsIfMissing(Supplier<Optional<StringSetTrie>> filterExtensions)Assigns extensions that can be used filter inputs, but only when no extensions have already been set.voidassignPaths(List<Path> paths)Assigns a specific list of paths that are used for the inputs.voidassignRatioLimit(double ratioLimit)Assigns a fixed upper limit that is a ratio of the number of inputs allowed.voidassignRelativeForIdentifier()Specify that the entire filename or relative path (excluding extension) is used to determine a unique identifier.voidassignShuffle()Indicates that the order of the inputs should be shuffled (randomized).Optional<DebugModeParameters>getDebugModeParameters()Parameters for debug-mode (only defined if we are in debug mode).Optional<IndexRangeNegative>getIdentifierSubrange()If defined, this indicates and specifies only a subset of the naming-elements to use.Optional<Path>getInputDirectory()If defined, a directory which can be used by beans to find input.Optional<StringSetTrie>getInputFilterExtensions()A trie of extensions that can be used filter inputs.Optional<String>getInputFilterGlob()A glob that can be used by beans to filter input.Optional<List<Path>>getInputPaths()A list of paths referring to specific inputs.Optional<io.vavr.control.Either<Integer,Double>>getLimitUpper()If defined, an upper limit that is imposed on the number of inputs.booleanisRelativeForIdentifier()If true, the entire filename or relative path (excluding extension) is used to determine a unique identifier.booleanisShuffle()If true, the order of the inputs are shuffled (randomized).voidsetDebugModeParameters(Optional<DebugModeParameters> debugModeParameters)Parameters for debug-mode (only defined if we are in debug mode).voidsetIdentifierSubrange(Optional<IndexRangeNegative> identifierSubrange)If defined, this indicates and specifies only a subset of the naming-elements to use.voidsetInputDirectory(Optional<Path> inputDirectory)If defined, a directory which can be used by beans to find input.voidsetInputFilterExtensions(Optional<StringSetTrie> inputFilterExtensions)A trie of extensions that can be used filter inputs.voidsetInputFilterGlob(Optional<String> inputFilterGlob)A glob that can be used by beans to filter input.voidsetInputPaths(Optional<List<Path>> inputPaths)A list of paths referring to specific inputs.voidsetLimitUpper(Optional<io.vavr.control.Either<Integer,Double>> limitUpper)If defined, an upper limit that is imposed on the number of inputs.voidsetRelativeForIdentifier(boolean relativeForIdentifier)If true, the entire filename or relative path (excluding extension) is used to determine a unique identifier.voidsetShuffle(boolean shuffle)If true, the order of the inputs are shuffled (randomized).
-
Constructor Details
-
InputContextParameters
public InputContextParameters()
-
-
Method Details
-
setInputDirectory
If defined, a directory which can be used by beans to find input.This should always be an absolute path, never a relative one.
- Parameters:
inputDirectory- the absolute path of the input-directory.- Throws:
IOException- if the path passed is not absolute.
-
assignInputDirectory
Sets an input-directory.If defined, The path will be converted to an absolute path, if it hasn't been already, based upon the current working directory.
- Parameters:
inputDirectory- the input-directory to an assign
-
assignFilterGlob
Assigns a glob that can be used by beans to filter input.The syntax should be from Java's getPathMatcher.
- Parameters:
glob- a string describing a glob in the syntax expected by Java.
-
assignIdentifierSubrange
If defined, this indicates and specifies only a subset of the elements of the identifier to use.- Parameters:
identifierSubrange- if defined, this indicates and specifies only a subset of the naming-elements to use.
-
assignInputFilterExtensionsIfMissing
public void assignInputFilterExtensionsIfMissing(Supplier<Optional<StringSetTrie>> filterExtensions)Assigns extensions that can be used filter inputs, but only when no extensions have already been set.- Parameters:
filterExtensions- the extensions sued to filter inputs (without the leading period).
-
assignInputFilterExtensions
Assigns extensions that can be used filter inputs, but irrespective of whether extensions have already been set.Any existing input-filter-extensions are repalced with
filterExtensions.- Parameters:
filterExtensions- the extensions sued to filter inputs (without the leading period).
-
assignRelativeForIdentifier
public void assignRelativeForIdentifier()Specify that the entire filename or relative path (excluding extension) is used to determine a unique identifier. -
assignFixedLimit
public void assignFixedLimit(int fixedLimit)Assigns a fixed upper limit of number of inputs.- Parameters:
fixedLimit- the maximum number of inputs allowed.
-
assignRatioLimit
public void assignRatioLimit(double ratioLimit)Assigns a fixed upper limit that is a ratio of the number of inputs allowed.- Parameters:
ratioLimit- the maximum number of inputs allowed.
-
assignPaths
Assigns a specific list of paths that are used for the inputs.- Parameters:
paths- the paths.
-
assignShuffle
public void assignShuffle()Indicates that the order of the inputs should be shuffled (randomized). -
getInputPaths
A list of paths referring to specific inputs. -
setInputPaths
A list of paths referring to specific inputs. -
getInputDirectory
If defined, a directory which can be used by beans to find input. -
getInputFilterGlob
A glob that can be used by beans to filter input.It requires the syntax of Java's getPathMatcher.
-
setInputFilterGlob
A glob that can be used by beans to filter input.It requires the syntax of Java's getPathMatcher.
-
getInputFilterExtensions
A trie of extensions that can be used filter inputs. -
setInputFilterExtensions
A trie of extensions that can be used filter inputs. -
getDebugModeParameters
Parameters for debug-mode (only defined if we are in debug mode). -
setDebugModeParameters
Parameters for debug-mode (only defined if we are in debug mode). -
isRelativeForIdentifier
public boolean isRelativeForIdentifier()If true, the entire filename or relative path (excluding extension) is used to determine a unique identifier. -
setRelativeForIdentifier
public void setRelativeForIdentifier(boolean relativeForIdentifier)If true, the entire filename or relative path (excluding extension) is used to determine a unique identifier. -
isShuffle
public boolean isShuffle()If true, the order of the inputs are shuffled (randomized). -
setShuffle
public void setShuffle(boolean shuffle)If true, the order of the inputs are shuffled (randomized). -
getLimitUpper
-
setLimitUpper
-
getIdentifierSubrange
If defined, this indicates and specifies only a subset of the naming-elements to use. -
setIdentifierSubrange
If defined, this indicates and specifies only a subset of the naming-elements to use.
-