|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbcds.tools.FilenameSeq
public class FilenameSeq
FileNameSeq creates file names based on a name pattern with an embedded sequence marker. The sequence mark is either {%d} or {%:d}, where the colon character : stands for a width/padding specifier as used in Java's String.format.
Thus: new FilenameSeq("some_file_{%d}.txt").expand(1) returns "some_file_1.txt", while new FilenameSeq("some_file_{%03d}.txt").expand(9) returns "some_file_009.txt".
If the file pattern does not contain a sequence marker, expand returns the same string.
Constructor Summary | |
---|---|
FilenameSeq(java.lang.String fname_pattern)
Creates a new instance which uses the given filename pattern. |
Method Summary | |
---|---|
java.lang.String |
expand(int seq)
Returns the filename in which the integer seq embedded,
if hasSequenceMarker() is true, or simply the
same filename passed to its constructor otherwise. |
boolean |
hasSequenceMarker()
Returns true if the filename to which this instance is bound contains a sequence marker, and false otherwise. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FilenameSeq(java.lang.String fname_pattern)
java.lang.IllegalArgumentException
- if fname_pattern contains
an invalid sequence marker.Method Detail |
---|
public boolean hasSequenceMarker()
public java.lang.String expand(int seq)
seq
embedded,
if hasSequenceMarker()
is true, or simply the
same filename passed to its constructor otherwise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |