|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pz.platypus.FileList
public class FileList
A simple treemap containing the name of the input files that were read. This is useful in situations where the principal Platypus file includes other files (via the [include:filename] command. In certain listings, we refer to the files by their number for brevity. This FileList is the list of those files, their number is the key in the tree, their name the value. 0 is always null, so that the first file in the tree is numbered 1.
Field Summary | |
---|---|
private java.util.TreeMap<java.lang.Integer,java.lang.String> |
filenames
the array containing the filenames |
private int |
next
the next number of a file |
Constructor Summary | |
---|---|
FileList()
|
Method Summary | |
---|---|
int |
addFilename(java.lang.String newFilename)
Add the filename to the table. |
java.lang.String |
getFilename(int fileNumber)
Find the file name based on the number it was assigned |
int |
getFileNumber(java.lang.String filename)
Find the file number based on the name |
int |
getSize()
get number of files stored |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final java.util.TreeMap<java.lang.Integer,java.lang.String> filenames
private int next
Constructor Detail |
---|
public FileList()
Method Detail |
---|
public int addFilename(java.lang.String newFilename) throws FilenameLookupException
newFilename
- name of file to add
FilenameLookupException
- technically, this routine cannot throw this exceptionpublic java.lang.String getFilename(int fileNumber) throws FilenameLookupException
fileNumber
- the number of the file in the array
FilenameLookupException
- if the fileNumber does not correspond to a filenamepublic int getFileNumber(java.lang.String filename) throws FilenameLookupException
filename
- to get the number for in the tree
FilenameLookupException
- if filename is not in listpublic int getSize()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |