Package org.apfloat.spi
Class FilenameGenerator
- java.lang.Object
-
- org.apfloat.spi.FilenameGenerator
-
public class FilenameGenerator extends java.lang.ObjectClass for generating filenames for temporary files.- Version:
- 1.0
-
-
Constructor Summary
Constructors Constructor Description FilenameGenerator(java.lang.String path, java.lang.String initialValue, java.lang.String suffix)Create a new filename generator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgenerateFilename()Generate a filename.java.lang.StringgetInitialValue()Returns the current initial value of the base file names generated.java.lang.StringgetPath()Returns the path setting of this filename generator.java.lang.StringgetSuffix()Returns the suffix setting of this filename generator.
-
-
-
Constructor Detail
-
FilenameGenerator
public FilenameGenerator(java.lang.String path, java.lang.String initialValue, java.lang.String suffix) throws java.lang.NumberFormatExceptionCreate a new filename generator. The generated filenames will point to the specified directory path. The base file name is a sequential number. The specified suffix is appended to the final file name.- Parameters:
path- The path where the file are created. Ifnull, the default file path from theApfloatContextis used.initialValue- The initial value for the numbers. Ifnull, the default file initial value from theApfloatContextis used.suffix- The suffix for file names. Ifnull, the default file suffix from theApfloatContextis used.- Throws:
java.lang.NumberFormatException- If initialValue is not a valid integer number.
-
-
Method Detail
-
generateFilename
public java.lang.String generateFilename()
Generate a filename. The returned filename is unique among those generated by this filename generator.- Returns:
- A generated file name.
-
getPath
public java.lang.String getPath()
Returns the path setting of this filename generator.- Returns:
- The path setting of this filename generator.
-
getInitialValue
public java.lang.String getInitialValue()
Returns the current initial value of the base file names generated.- Returns:
- The current initial value of the base file names generated.
-
getSuffix
public java.lang.String getSuffix()
Returns the suffix setting of this filename generator.- Returns:
- The suffix setting of this filename generator.
-
-