public class OStream extends Object
cout
,
cerr
, and clog
.
A few libSBML methods accept an argument for indicating where to send
text string output. An example is the SBMLDocument.printErrors(OStream
stream)
method. However, the methods use C++ style streams and not Java
stream objects. The OStream
object exists to bridge the Java and
underlying native implementation. It is a simple wrapper around the
underlying stream object and provides a few basic methods for
manipulating it.
Modifier and Type | Field and Description |
---|---|
static int |
CERR   |
static int |
CLOG   |
static int |
COUT   |
Constructor and Description |
---|
OStream()
Creates a new
OStream object with one of standard output stream objects. |
OStream(int sot)
Creates a new
OStream object with one of standard output stream objects. |
Modifier and Type | Method and Description |
---|---|
void |
delete()
Explicitly deletes the underlying native object.
|
void |
endl()
Writes an end-of-line character on this tream.
|
org.sbml.libsbml.SWIGTYPE_p_std__ostream |
get_ostream()
Returns the stream object.
|
public static final int CERR
public static final int CLOG
public static final int COUT
public OStream()
OStream
object with one of standard output stream objects.
sot
- a value from the StdOSType enumeration(COUT, CERR, or CLOG)
indicating the type of stream to create.public void delete()
In general, application software will not need to call this method directly. The Java language binding for libSBML is implemented as a language wrapper that provides a Java interface to libSBML's underlying C++/C code. Some of the Java methods return objects that are linked to objects created not by Java code, but by C++ code. The Java objects wrapped around them will be deleted when the garbage collector invokes the corresponding C++ finalize()
methods for the objects. The finalize()
methods in turn call the OStream.delete()
method on the libSBML object.
This method is exposed in case calling programs want to ensure that the underlying object is freed immediately, and not at some arbitrary time determined by the Java garbage collector. In normal usage, callers do not need to invoke OStream.delete()
themselves.
public void endl()
public org.sbml.libsbml.SWIGTYPE_p_std__ostream get_ostream()