org.apfloat.spi
Class FilenameGenerator

java.lang.Object
  extended byorg.apfloat.spi.FilenameGenerator

public class FilenameGenerator
extends java.lang.Object

Class for generating filenames for temporary files.

Version:
1.0
Author:
Mikko Tommila

Constructor Summary
FilenameGenerator(java.lang.String path, java.lang.String initialValue, java.lang.String suffix)
          Create a new filename generator.
 
Method Summary
 java.lang.String generateFilename()
          Generate a filename.
 java.lang.String getInitialValue()
          Returns the current initial value of the base file names generated.
 java.lang.String getPath()
          Returns the path setting of this filename generator.
 java.lang.String getSuffix()
          Returns the suffix setting of this filename generator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilenameGenerator

public FilenameGenerator(java.lang.String path,
                         java.lang.String initialValue,
                         java.lang.String suffix)
                  throws java.lang.NumberFormatException
Create 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. If null, the default file path from the ApfloatContext is used.
initialValue - The initial value for the numbers. If null, the default file initial value from the ApfloatContext is used.
suffix - The suffix for file names. If null, the default file suffix from the ApfloatContext is 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.