|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.util.bfs.SequenceFilenameGenerator
public class SequenceFilenameGenerator
File name generator implementation that generates file names using a simple numerical counter. It is possible to give a prexix and/or suffix. For example, with prefix="file-" and suffix=".txt", the following file sequence is generated: file-1.txt, file-2.txt, file-3.txt This generator completely ignores the owner and suggested file names.
Field Summary | |
---|---|
private int |
nextFileNum
|
private String |
prefix
|
private String |
suffix
|
Constructor Summary | |
---|---|
SequenceFilenameGenerator()
Create a new sequence file name generator. |
|
SequenceFilenameGenerator(String prefix,
String suffix,
int firstFileNum)
Create a new sequence file name generator. |
Method Summary | |
---|---|
String |
getNextFilename(Object owner,
String suggestedFilename)
Get the next file name. |
int |
getNextFileNumber()
Get the next file number. |
String |
getPrefix()
Get the prefix that is used for file name generation. |
String |
getSuffix()
Get the suffix that is used for file name generation. |
void |
setPrefix(String prefix)
Set the prefix that is used for file name generation. |
void |
setSuffix(String suffix)
Set the suffix that is used for file name generation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private String prefix
private String suffix
private int nextFileNum
Constructor Detail |
---|
public SequenceFilenameGenerator()
public SequenceFilenameGenerator(String prefix, String suffix, int firstFileNum)
prefix
- The prefix to usesuffix
- The suffix to usefirstFileNum
- The sequence number of the first fileMethod Detail |
---|
public String getNextFilename(Object owner, String suggestedFilename)
FilenameGenerator
DataWriterFactory
implementation).
getNextFilename
in interface FilenameGenerator<Object>
owner
- The owner of the data in the filesuggestedFilename
- A default suggested file name (can be null)
public String getPrefix()
public void setPrefix(String prefix)
prefix
- The prefix or null to not use a prefixpublic String getSuffix()
public void setSuffix(String suffix)
suffix
- The suffix or null to not use a suffixpublic int getNextFileNumber()
getNextFilename(Object, String)
is called.
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |