Class IncrementingNumber
Object
org.anchoranalysis.bean.AnchorBean<PathPrefixer>
org.anchoranalysis.io.output.bean.path.prefixer.PathPrefixer
org.anchoranalysis.io.output.bean.path.prefixer.PathPrefixerAvoidResolve
org.anchoranalysis.io.output.bean.path.prefixer.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 Summary
Constructors Constructor Description IncrementingNumber()IncrementingNumber(String prefix)Creates with a prefix. -
Method Summary
Modifier and Type Method Description intgetNumberDigits()Number of digits in the number, with leading zeros as necessary.DirectoryWithPrefixoutFilePrefixFromPath(NamedPath path, Path root, PathPrefixerContext context)Determines the out-file prefix from a path.voidsetNumberDigits(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, setPrefixMethods inherited from class org.anchoranalysis.io.output.bean.path.prefixer.PathPrefixer
resolvePath, resolvePath
-
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:PathPrefixerAvoidResolveDetermines the out-file prefix from a path.- Specified by:
outFilePrefixFromPathin 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.
-