|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsbrt.shell.io.SerializedOutputFile<E>
E
- the object type.public class SerializedOutputFile<E>
This class is used to write serialized objects to output files.
Constructor Summary | |
---|---|
SerializedOutputFile(java.lang.String fileName,
FileFormat fileFormat)
Constructs a new serialized output file from the provided arguments. |
Method Summary | ||
---|---|---|
|
addData(S results)
Adds data to this output file. |
|
void |
breakPoint()
Does nothing. |
|
void |
close()
Closes this file. |
|
protected void |
finalize()
Disposes of system resources associated with this file when called by the garbage collector. |
|
java.lang.String |
getCanonicalName()
Returns the canonical name of this file. |
|
FileFormat |
getFileFormat()
Returns the format of 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 |
isEof(java.lang.Object obj)
Indicates if the provided object is a valid end-of-file marker. |
|
static boolean |
isValidFormat(FileFormat fileFormat)
Indicates if the provided file format is valid for a serialized output file. |
|
protected void |
writeObject(java.lang.Object obj)
Serializes the provided object and writes it to this file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SerializedOutputFile(java.lang.String fileName, FileFormat fileFormat)
fileName
- the name of the file to be created.fileFormat
- the format of the file to be created.Method Detail |
---|
public static boolean isEof(java.lang.Object obj)
obj
- the object to test.
true
if the provided object is an
instance of EndOfFile; false
otherwise.public static boolean isValidFormat(FileFormat fileFormat)
fileFormat
- the file format to test.
true
if the provided file format is
valid for a serialized output file; false
otherwise.public FileFormat getFileFormat()
public final java.lang.String getName()
getName
in interface ResultsManager<E>
public final java.lang.String getOriginalName()
getOriginalName
in interface SbrtFile
public final java.lang.String getCanonicalName()
getCanonicalName
in interface SbrtFile
File.getCanonicalPath()
public <S extends E> void addData(S results)
addData
in interface ResultsManager<E>
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 writeObject(java.lang.Object obj)
obj
- the object to be serialized and written to this file.
ApplicationException
- if an I/O error occurs while
writing to file.
java.io#InvalidClassException
- if something is wrong with a
class used by serialization.
java.io#NotSerializableException
- if some object to be
serialized does not implement the java.io.Serializable interface.public void breakPoint()
breakPoint
in interface ResultsManager<E>
java.lang.IllegalStateException
- if close()
has already been called.public void close()
close
in interface ResultsManager<E>
close
in interface SbrtFile
ApplicationException
- if an I/O error occurred
while closing this file.public final boolean isClosed()
isClosed
in interface ResultsManager<E>
isClosed
in interface SbrtFile
true
if this file is closed;
false
othewise.ResultsManager.close()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
- the Exception raised by this method.Object.finalize()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |