|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsbrt.shell.io.TextOutputFile<T>
T
- the type contained in this type of output file.public class TextOutputFile<T>
This class is used to represent output files containing plain text.
Constructor Summary | |
---|---|
TextOutputFile(java.lang.String fileName,
FileFormat fileFormat,
Formatter<T> lineFormat)
Constructs a new text output file using the provided arguments. |
|
TextOutputFile(java.lang.String fileName,
Formatter<T> lineFormat)
Constructs a new text output file using the provided arguments. |
Method Summary | ||
---|---|---|
|
addData(S results)
Adds data to this output file. |
|
void |
breakPoint()
Writes a line of # symbols to this file. |
|
void |
close()
Closes this file. |
|
protected void |
finalize()
Disposes of system resources associated with this file when called by the garbage collector. |
|
static TextOutputFile<java.lang.String> |
getBasic(java.lang.String fileName)
Returns a basic text output file. |
|
static TextOutputFile<java.lang.String> |
getBasic(java.lang.String fileName,
FileFormat fileFormat)
Returns a basic text output file with the provided file format. |
|
java.lang.String |
getCanonicalName()
Returns the canonical name of this file. |
|
Formatter<T> |
getLineFormat()
Returns the format used to write lines to this file. |
|
java.lang.String |
getName()
Returns the canonical name of this file. |
|
java.lang.String |
getOriginalName()
Returns the name of this file. |
|
boolean |
isClosed()
Indicates if this file has already been closed. |
|
static boolean |
isValidFormat(FileFormat fileFormat)
Indicates if the provided file format is valid for a text output file. |
|
protected void |
writeLine(java.lang.String line)
Writes the provided string to this output file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TextOutputFile(java.lang.String fileName, Formatter<T> lineFormat)
fileName
- the name of the file to be created.lineFormat
- the format used for writing formatted
data strings to this file.public TextOutputFile(java.lang.String fileName, FileFormat fileFormat, Formatter<T> lineFormat)
fileName
- the name of the file to be created.fileFormat
- the file format used to write data
to this file.lineFormat
- the format used for writing formatted
data strings to this file.Method Detail |
---|
public static boolean isValidFormat(FileFormat fileFormat)
fileFormat
- the file format to test.
true
if the provided file format is
valid for a text output file; false
otherwise.public static TextOutputFile<java.lang.String> getBasic(java.lang.String fileName)
fileName
- the name with which to name the file.
public static TextOutputFile<java.lang.String> getBasic(java.lang.String fileName, FileFormat fileFormat)
fileName
- the name of the file to be created.fileFormat
- the file format with which to write
this file.
public final java.lang.String getName()
getName
in interface ResultsManager<T>
public final java.lang.String getOriginalName()
getOriginalName
in interface SbrtFile
public final java.lang.String getCanonicalName()
getCanonicalName
in interface SbrtFile
File.getCanonicalPath()
public final boolean isClosed()
isClosed
in interface ResultsManager<T>
isClosed
in interface SbrtFile
true
if this file is closed;
false
othewise.ResultsManager.close()
public Formatter<T> getLineFormat()
public void close()
close
in interface ResultsManager<T>
close
in interface SbrtFile
ApplicationException
- if an I/O error occurred
while closing this file.protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
- the Exception raised by this method.Object.finalize()
public void breakPoint()
#
symbols to this file.
breakPoint
in interface ResultsManager<T>
java.lang.IllegalStateException
- if close()
has already been called.public <S extends T> void addData(S results)
addData
in interface ResultsManager<T>
S
- a type extending the primary data type
contained in this output file.results
- the results, or data, to be added
to this output file.
ApplicationException
- if an I/O error occurs
while writing data to this file.
java.lang.IllegalStateException
- if close()
has already been called.
java.lang.NullPointerException
- if the provided
argument is null
.protected final void writeLine(java.lang.String line)
line
- the line to write to this file.
ApplicationException
- if an I/O error occurs
while writing data to this file.
java.lang.IllegalStateException
- if close()
has already been called.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |