|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.phoenix_int.aserver.util.PHXFileLoader
public class PHXFileLoader
This is a utility class for loading data files. The class makes it easy to load files, line by line while ignoring comments (lines that begin with #).
Sample Usage:
PHXFileLoader fl;try { fl = new PHXFileLoader( "myfile.dat" ); } catch ( IOException e ) { System.out.println( e ); }
String line = fl.nextLine();
while ( line != null ) { // process line ...
line = fl.nextLine(); }
fl.close();
| Constructor Summary | |
|---|---|
PHXFileLoader(java.io.File file)
|
|
PHXFileLoader(java.io.InputStream inStream)
|
|
PHXFileLoader(java.lang.String fileName)
|
|
PHXFileLoader(java.io.StringReader inStream)
|
|
| Method Summary | |
|---|---|
void |
close()
closes the file |
void |
finalize()
|
java.lang.String |
getFileName()
retrieves the file name |
int |
getLineNumber()
returns the line number of the last line read. |
java.lang.String |
getRemainder()
returns the rest of the file as a string |
java.lang.String |
nextLine()
extracts the next non-comment line from the data file |
java.lang.String |
readNextLine()
extracts the next line from the data file |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PHXFileLoader(java.lang.String fileName)
throws java.io.IOException
fileName - the file to load
java.io.IOException - if there is a problem opening the file
public PHXFileLoader(java.io.File file)
throws java.io.IOException
file - the file to load
java.io.IOException - if there is a problem opening the file
public PHXFileLoader(java.io.StringReader inStream)
throws java.io.IOException
java.io.IOException
public PHXFileLoader(java.io.InputStream inStream)
throws java.io.IOException
java.io.IOException| Method Detail |
|---|
public void finalize()
finalize in class java.lang.Objectpublic void close()
public java.lang.String getFileName()
public int getLineNumber()
public java.lang.String nextLine()
public java.lang.String readNextLine()
public java.lang.String getRemainder()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||