Class IntegerSuffixOutputNameStyle
Object
OutputNameStyle
IndexableOutputNameStyle
IntegerSuffixOutputNameStyle
- All Implemented Interfaces:
Serializable
Outputs a file-name involving an integer suffix of length
numberDigits
with leading
zeros.
Optionally, a prefix will be placed before this number (with an underscore to separate).
If no prefix is defined, no underscore will be present.
- Author:
- Owen Feehan
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionEmpty constructor, as needed for deserialization.IntegerSuffixOutputNameStyle
(String outputName, int numberDigits) Creates with an output-name and a number of digits.IntegerSuffixOutputNameStyle
(String outputName, String prefix, int numberDigits) Creates with an output-name, a prefix, and a number of digits. -
Method Summary
Modifier and TypeMethodDescriptionDeep copy the current object.protected String
filenameFromOutputFormatString
(String outputFormatString, String index) Constructs a file name from the output format string and an index.protected String
A format-string as recognized byString.format(java.lang.String, java.lang.Object...)
that expects a single string element.Methods inherited from class org.anchoranalysis.io.output.namestyle.IndexableOutputNameStyle
filenameWithoutExtension, filenameWithoutExtension, filenameWithoutExtension
Methods inherited from class org.anchoranalysis.io.output.namestyle.OutputNameStyle
getOutputName, setOutputName
-
Constructor Details
-
IntegerSuffixOutputNameStyle
public IntegerSuffixOutputNameStyle()Empty constructor, as needed for deserialization. -
IntegerSuffixOutputNameStyle
Creates with an output-name and a number of digits.- Parameters:
outputName
- the output-name.numberDigits
- a fixed number of digits (prefixed with leading zeros) for the numeric part.
-
IntegerSuffixOutputNameStyle
Creates with an output-name, a prefix, and a number of digits.- Parameters:
outputName
- the output-name.prefix
- a string placed before the numeric part of the naming-style.numberDigits
- a fixed number of digits (prefixed with leading zeros) for the numeric part.
-
-
Method Details
-
duplicate
Description copied from class:OutputNameStyle
Deep copy the current object.- Specified by:
duplicate
in classIndexableOutputNameStyle
- Returns:
- a newly created copy.
-
filenameFromOutputFormatString
Description copied from class:IndexableOutputNameStyle
Constructs a file name from the output format string and an index.- Specified by:
filenameFromOutputFormatString
in classIndexableOutputNameStyle
- Parameters:
outputFormatString
- a format-string as recognized byString.format(java.lang.String, java.lang.Object...)
that expects a single string element (what will be populated byindex
) to form the name.index
- the index, unique within a set of filenames being outputted.- Returns:
- the file-name as a string.
-
outputFormatString
Description copied from class:IndexableOutputNameStyle
A format-string as recognized byString.format(java.lang.String, java.lang.Object...)
that expects a single string element.- Specified by:
outputFormatString
in classIndexableOutputNameStyle
- Returns:
- the format-string.
-