peersim.util
Class FileNameGenerator
java.lang.Object
peersim.util.FileNameGenerator
public class FileNameGenerator
- extends java.lang.Object
Generates a series of filenames for classes that have to save e.g.
snapshots regularly.
Field Summary |
java.lang.String |
ext
The extension of the filename |
java.lang.String |
prefix
The prefix of the filename |
Method Summary |
java.lang.String |
nextCounterName()
Generates a name based on a counter. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
prefix
public final java.lang.String prefix
- The prefix of the filename
ext
public final java.lang.String ext
- The extension of the filename
FileNameGenerator
public FileNameGenerator(java.lang.String prefix,
java.lang.String ext)
- Parameters:
prefix
- all returned names will be prefixed by thisext
- will be appended to all returned names
nextCounterName
public java.lang.String nextCounterName()
- Generates a name based on a counter.
The format of the name returned is
prefix
followed by
an 8 digit zero padded number, followed by ext
.
The first number used is zero.
- Returns:
- the next filename after increasing the counter