Class InputContextParameters

Object
InputContextParameters

public class InputContextParameters extends Object
Additional parameters that offer context for many beans that provide input-functions.
Author:
Owen Feehan
  • Constructor Details

    • InputContextParameters

      public InputContextParameters()
  • Method Details

    • setInputDirectory

      public void setInputDirectory(Optional<Path> inputDirectory) throws IOException
      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

      public void assignInputDirectory(Optional<Path> inputDirectory)
      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

      public void assignFilterGlob(String glob)
      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

      public void assignIdentifierSubrange(IndexRangeNegative identifierSubrange)
      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

      public void assignInputFilterExtensions(StringSetTrie filterExtensions)
      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

      public void assignPaths(List<Path> paths)
      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

      public Optional<List<Path>> getInputPaths()
      A list of paths referring to specific inputs.
    • setInputPaths

      public void setInputPaths(Optional<List<Path>> inputPaths)
      A list of paths referring to specific inputs.
    • getInputDirectory

      public Optional<Path> getInputDirectory()
      If defined, a directory which can be used by beans to find input.
    • getInputFilterGlob

      public Optional<String> getInputFilterGlob()
      A glob that can be used by beans to filter input.

      It requires the syntax of Java's getPathMatcher.

    • setInputFilterGlob

      public void setInputFilterGlob(Optional<String> inputFilterGlob)
      A glob that can be used by beans to filter input.

      It requires the syntax of Java's getPathMatcher.

    • getInputFilterExtensions

      public Optional<StringSetTrie> getInputFilterExtensions()
      A trie of extensions that can be used filter inputs.
    • setInputFilterExtensions

      public void setInputFilterExtensions(Optional<StringSetTrie> inputFilterExtensions)
      A trie of extensions that can be used filter inputs.
    • getDebugModeParameters

      public Optional<DebugModeParameters> getDebugModeParameters()
      Parameters for debug-mode (only defined if we are in debug mode).
    • setDebugModeParameters

      public void setDebugModeParameters(Optional<DebugModeParameters> debugModeParameters)
      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

      public Optional<io.vavr.control.Either<Integer,Double>> getLimitUpper()
      If defined, an upper limit that is imposed on the number of inputs.

      When an Integer is is a fixed number of inputs.

      When a Double it is a ratio of the total number of inputs (and should only be in the interval (0.0, 1.0)).

    • setLimitUpper

      public void setLimitUpper(Optional<io.vavr.control.Either<Integer,Double>> limitUpper)
      If defined, an upper limit that is imposed on the number of inputs.

      When an Integer is is a fixed number of inputs.

      When a Double it is a ratio of the total number of inputs (and should only be in the interval (0.0, 1.0)).

    • getIdentifierSubrange

      public Optional<IndexRangeNegative> getIdentifierSubrange()
      If defined, this indicates and specifies only a subset of the naming-elements to use.
    • setIdentifierSubrange

      public void setIdentifierSubrange(Optional<IndexRangeNegative> identifierSubrange)
      If defined, this indicates and specifies only a subset of the naming-elements to use.