|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--au.edu.swin.synergy.lib.io.BTextdb
This class allows lines of text to be read and written to text files. Comments starting with # are ignored the lines are stripped of leading and trailing white space blank lines are skipped and the resulting lines are returned in the form of a BTextdbRecord see sample test class for details
BTextdbRecord
Constructor Summary | |
BTextdb()
Creates a new text db with no file name specified. |
|
BTextdb(String fName)
Creates a new database object |
Method Summary | |
void |
addRecord(BTextdbRecord record)
Write a record to the database |
void |
close()
close an open file |
BTextdbRecord |
getRecord()
Get a record from the database |
boolean |
openFileForRead()
openFileForRead |
boolean |
openFileForRead(InputStream newInputStream)
This will use the given input stream as the source of the file to read from. |
boolean |
openFileForWrite(boolean append)
opens a file for writing |
boolean |
openFileForWrite(boolean append,
OutputStream newOutputStream)
opens a file for writing |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public BTextdb(String fName)
fName
- the name of the filepublic BTextdb()
Method Detail |
public BTextdbRecord getRecord()
public void addRecord(BTextdbRecord record)
record
- the record to addpublic boolean openFileForRead()
public boolean openFileForRead(InputStream newInputStream)
inputStream
- The input stream to read frompublic boolean openFileForWrite(boolean append)
append
- if append is false, then any existing data will be overwrittenpublic boolean openFileForWrite(boolean append, OutputStream newOutputStream)
append
- if append is false, then any existing data will be overwrittenpublic void close()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |