Class IncrementingNumber
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Number of digits in the number, with leading zeros as necessary.outFilePrefixFromPath
(NamedPath path, Path root, PathPrefixerContext context) Determines the out-file prefix from a path.void
setNumberDigits
(int numberDigits) Number of digits in the number, with leading zeros as necessary.Methods inherited from class org.anchoranalysis.io.output.bean.path.prefixer.PathPrefixerAvoidResolve
getPrefix, outFilePrefix, outFilePrefixAvoidResolve, rootDirectoryPrefix, rootDirectoryPrefixAvoidResolve, setPrefix
Methods inherited from class org.anchoranalysis.io.output.bean.path.prefixer.PathPrefixer
resolvePath, resolvePath
Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
IncrementingNumber
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 classPathPrefixerAvoidResolve
- Parameters:
path
- path to calculate prefix from with associated descriptive-nameroot
- root of prefixcontext
- 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.
-