Package org.anchoranalysis.io.input
Class InputContextParameters
Object
InputContextParameters
Additional parameters that offer context for many beans that provide input-functions.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
assignFilterGlob
(String glob) Assigns a glob that can be used by beans to filter input.void
assignFixedLimit
(int fixedLimit) Assigns a fixed upper limit of number of inputs.void
assignIdentifierSubrange
(IndexRangeNegative identifierSubrange) If defined, this indicates and specifies only a subset of the elements of the identifier to use.void
assignInputDirectory
(Optional<Path> inputDirectory) Sets an input-directory.void
assignInputFilterExtensions
(StringSetTrie filterExtensions) Assigns extensions that can be used filter inputs, but irrespective of whether extensions have already been set.void
assignInputFilterExtensionsIfMissing
(Supplier<Optional<StringSetTrie>> filterExtensions) Assigns extensions that can be used filter inputs, but only when no extensions have already been set.void
assignPaths
(List<Path> paths) Assigns a specific list of paths that are used for the inputs.void
assignRatioLimit
(double ratioLimit) Assigns a fixed upper limit that is a ratio of the number of inputs allowed.void
Specify that the entire filename or relative path (excluding extension) is used to determine a unique identifier.void
Indicates that the order of the inputs should be shuffled (randomized).Parameters for debug-mode (only defined if we are in debug mode).If defined, this indicates and specifies only a subset of the naming-elements to use.If defined, a directory which can be used by beans to find input.A trie of extensions that can be used filter inputs.A glob that can be used by beans to filter input.A list of paths referring to specific inputs.If defined, an upper limit that is imposed on the number of inputs.boolean
If true, the entire filename or relative path (excluding extension) is used to determine a unique identifier.boolean
If true, the order of the inputs are shuffled (randomized).void
setDebugModeParameters
(Optional<DebugModeParameters> debugModeParameters) Parameters for debug-mode (only defined if we are in debug mode).void
setIdentifierSubrange
(Optional<IndexRangeNegative> identifierSubrange) If defined, this indicates and specifies only a subset of the naming-elements to use.void
setInputDirectory
(Optional<Path> inputDirectory) If defined, a directory which can be used by beans to find input.void
setInputFilterExtensions
(Optional<StringSetTrie> inputFilterExtensions) A trie of extensions that can be used filter inputs.void
setInputFilterGlob
(Optional<String> inputFilterGlob) A glob that can be used by beans to filter input.void
setInputPaths
(Optional<List<Path>> inputPaths) A list of paths referring to specific inputs.void
setLimitUpper
(Optional<io.vavr.control.Either<Integer, Double>> limitUpper) If defined, an upper limit that is imposed on the number of inputs.void
setRelativeForIdentifier
(boolean relativeForIdentifier) If true, the entire filename or relative path (excluding extension) is used to determine a unique identifier.void
setShuffle
(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.
-