Class IncrementingNumber


public class IncrementingNumber extends PathPrefixerAvoidResolve
Outputs an incrementing number for each output that occurs.

The sequence begins with 0 and increments always by 1.

This number is independent of the input file-name and occurs only by whatever sequential order occurs with calls to outFilePrefixFromPath(org.anchoranalysis.io.output.path.prefixer.NamedPath, java.nio.file.Path, org.anchoranalysis.io.output.path.prefixer.PathPrefixerContext).

Author:
Owen Feehan
  • Constructor Details

    • IncrementingNumber

      public IncrementingNumber(String prefix)
      Creates with a prefix.
      Parameters:
      prefix - a string prefixed to each output-path.
    • IncrementingNumber

      public IncrementingNumber()
  • Method Details

    • outFilePrefixFromPath

      public DirectoryWithPrefix outFilePrefixFromPath(NamedPath path, Path root, PathPrefixerContext context)
      Description copied from class: PathPrefixerAvoidResolve
      Determines the out-file prefix from a path.
      Specified by:
      outFilePrefixFromPath in class PathPrefixerAvoidResolve
      Parameters:
      path - path to calculate prefix from with associated descriptive-name
      root - root of prefix
      context - the path-prefixer context.
      Returns:
      folder/filename for prefixing.
    • getNumberDigits

      public int getNumberDigits()
      Number of digits in the number, with leading zeros as necessary.
    • setNumberDigits

      public void setNumberDigits(int numberDigits)
      Number of digits in the number, with leading zeros as necessary.