001/* ----------------------------------------------------------------------------
002 * This file was automatically generated by SWIG (http://www.swig.org).
003 * Version 2.0.12
004 *
005 * Do not make changes to this file unless you know what you are doing--modify
006 * the SWIG interface file instead.
007 * ----------------------------------------------------------------------------- */
008
009package org.sbml.libsbml;
010
011public class OFStream extends OStream {
012   private long swigCPtr;
013
014   protected OFStream(long cPtr, boolean cMemoryOwn)
015   {
016     super(libsbmlJNI.OFStream_SWIGUpcast(cPtr), cMemoryOwn);
017     swigCPtr = cPtr;
018   }
019
020   protected static long getCPtr(OFStream obj)
021   {
022     return (obj == null) ? 0 : obj.swigCPtr;
023   }
024
025   protected static long getCPtrAndDisown (OFStream obj)
026   {
027     long ptr = 0;
028
029     if (obj != null)
030     {
031       ptr             = obj.swigCPtr;
032       obj.swigCMemOwn = false;
033     }
034
035     return ptr;
036   }
037
038  protected void finalize() {
039    delete();
040  }
041
042  public synchronized void delete() {
043    if (swigCPtr != 0) {
044      if (swigCMemOwn) {
045        swigCMemOwn = false;
046        libsbmlJNI.delete_OFStream(swigCPtr);
047      }
048      swigCPtr = 0;
049    }
050    super.delete();
051  }
052
053  public OFStream(String filename, boolean is_append) {
054    this(libsbmlJNI.new_OFStream__SWIG_0(libsbml.getAbsolutePath(filename), is_append), true);
055  }
056
057  public OFStream(String filename) {
058    this(libsbmlJNI.new_OFStream__SWIG_1(libsbml.getAbsolutePath(filename)), true);
059  }
060
061  public void open(String filename, boolean is_append) {
062    libsbmlJNI.OFStream_open__SWIG_0(swigCPtr, this, libsbml.getAbsolutePath(filename), is_append);
063  }
064
065  public void open(String filename) {
066    libsbmlJNI.OFStream_open__SWIG_1(swigCPtr, this, libsbml.getAbsolutePath(filename));
067  }
068
069  public void close() {
070    libsbmlJNI.OFStream_close(swigCPtr, this);
071  }
072
073  public boolean is_open() {
074    return libsbmlJNI.OFStream_is_open(swigCPtr, this);
075  }
076
077}