Class sfclasses.PersistentOutputStream
All Packages Class Hierarchy This Package Previous Next Index
Class sfclasses.PersistentOutputStream
java.lang.Object
|
+----java.io.OutputStream
|
+----java.io.FilterOutputStream
|
+----java.io.PrintStream
|
+----sfclasses.PersistentOutputStream
- public class PersistentOutputStream
- extends PrintStream
This stream is used to save data to a persistent state.
Normally the methods are called from the write() method defined
in the Persistent interface.
When you want to start the save process, you have to create
a new PersistentOutputStream passing the data output stream as
parameter. Then call the appropriate method to save the object
you are using as starting point (e.g. writePersistent). Any objects
contained in this object are automatically saved (recursively).
-
PersistentOutputStream(OutputStream)
- Initialize the stream using fs as data destination.
-
writeBoolean(String, boolean)
- Write boolean.
-
writeDouble(String, double)
- Write double.
-
writeInt(String, int)
- Write integer.
-
writeObject(String, Object)
- Write object that does not implement Persistent.
-
writePersistent(String, Persistent)
- Write object of a class that implements Persistent.
-
writePersistentVector(String, Vector)
- Write vector.
-
writeString(String, String)
- Write string.
PersistentOutputStream
public PersistentOutputStream(OutputStream fs)
- Initialize the stream using fs as data destination.
- Parameters:
- fs - Data output stream
writeObject
public void writeObject(String s,
Object x)
- Write object that does not implement Persistent. An object written
with writeObject cannot be restored properly; only the string
returned by the object's toString() method is written to the
stream.
- Parameters:
- s - Identification string, must end with a comma!
- x - Object to write
writeInt
public void writeInt(String s,
int x)
- Write integer.
- Parameters:
- s - Identification string, must end with a comma!
- x - Integer to write
writeDouble
public void writeDouble(String s,
double x)
- Write double.
- Parameters:
- s - Identification string, must end with a comma!
- x - Value to write
writeBoolean
public void writeBoolean(String s,
boolean x)
- Write boolean.
- Parameters:
- s - Identification string, must end with a comma!
- x - Value to write
writeString
public void writeString(String s,
String x)
- Write string.
- Parameters:
- s - Identification string, must end with a comma!
- x - Value to write
writePersistent
public void writePersistent(String s,
Persistent x)
- Write object of a class that implements Persistent.
- Parameters:
- s - Identification string, must end with a comma!
- x - Object to write
writePersistentVector
public void writePersistentVector(String s,
Vector e)
- Write vector.
- Parameters:
- s - Identification string, must end with a comma!
- e - Vector to write
All Packages Class Hierarchy This Package Previous Next Index