001/* ----------------------------------------------------------------------------
002 * This file was automatically generated by SWIG (http://www.swig.org).
003 * Version 2.0.11
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 Curve extends SBase {
012   private long swigCPtr;
013
014   protected Curve(long cPtr, boolean cMemoryOwn)
015   {
016     super(libsbmlJNI.Curve_SWIGUpcast(cPtr), cMemoryOwn);
017     swigCPtr = cPtr;
018   }
019
020   protected static long getCPtr(Curve obj)
021   {
022     return (obj == null) ? 0 : obj.swigCPtr;
023   }
024
025   protected static long getCPtrAndDisown (Curve 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_Curve(swigCPtr);
047      }
048      swigCPtr = 0;
049    }
050    super.delete();
051  }
052
053  public Curve(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException {
054    this(libsbmlJNI.new_Curve__SWIG_0(level, version, pkgVersion), true);
055  }
056
057  public Curve(long level, long version) throws org.sbml.libsbml.SBMLConstructorException {
058    this(libsbmlJNI.new_Curve__SWIG_1(level, version), true);
059  }
060
061  public Curve(long level) throws org.sbml.libsbml.SBMLConstructorException {
062    this(libsbmlJNI.new_Curve__SWIG_2(level), true);
063  }
064
065  public Curve() throws org.sbml.libsbml.SBMLConstructorException {
066    this(libsbmlJNI.new_Curve__SWIG_3(), true);
067  }
068
069  public Curve(LayoutPkgNamespaces layoutns) throws org.sbml.libsbml.SBMLConstructorException {
070    this(libsbmlJNI.new_Curve__SWIG_4(LayoutPkgNamespaces.getCPtr(layoutns), layoutns), true);
071  }
072
073  public Curve(XMLNode node, long l2version) throws org.sbml.libsbml.SBMLConstructorException {
074    this(libsbmlJNI.new_Curve__SWIG_5(XMLNode.getCPtr(node), node, l2version), true);
075  }
076
077  public Curve(XMLNode node) throws org.sbml.libsbml.SBMLConstructorException {
078    this(libsbmlJNI.new_Curve__SWIG_6(XMLNode.getCPtr(node), node), true);
079  }
080
081  public Curve(Curve source) throws org.sbml.libsbml.SBMLConstructorException {
082    this(libsbmlJNI.new_Curve__SWIG_7(Curve.getCPtr(source), source), true);
083  }
084
085  public void initDefaults() {
086    libsbmlJNI.Curve_initDefaults(swigCPtr, this);
087  }
088
089  public ListOfLineSegments getListOfCurveSegments() {
090    long cPtr = libsbmlJNI.Curve_getListOfCurveSegments(swigCPtr, this);
091    return (cPtr == 0) ? null : new ListOfLineSegments(cPtr, false);
092  }
093
094  public LineSegment getCurveSegment(long index) {
095    return (LineSegment) libsbml.DowncastSBase(libsbmlJNI.Curve_getCurveSegment__SWIG_0(swigCPtr, this, index), false);
096}
097
098  public void addCurveSegment(LineSegment segment) {
099    libsbmlJNI.Curve_addCurveSegment(swigCPtr, this, LineSegment.getCPtr(segment), segment);
100  }
101
102  public long getNumCurveSegments() {
103    return libsbmlJNI.Curve_getNumCurveSegments(swigCPtr, this);
104  }
105
106  public LineSegment createLineSegment() {
107    return (LineSegment) libsbml.DowncastSBase(libsbmlJNI.Curve_createLineSegment(swigCPtr, this), false);
108}
109
110  public CubicBezier createCubicBezier() {
111    long cPtr = libsbmlJNI.Curve_createCubicBezier(swigCPtr, this);
112    return (cPtr == 0) ? null : new CubicBezier(cPtr, false);
113  }
114
115  
116/**
117   * Returns the XML element name of this object.
118   * <p>
119   * This is overridden by subclasses to return a string appropriate to the
120   * SBML component.  For example, {@link Model} defines it as returning 
121   * <code>'model'</code>, {@link CompartmentType} defines it as returning <code>'compartmentType'</code>,
122   * and so on.
123   */ public
124 String getElementName() {
125    return libsbmlJNI.Curve_getElementName(swigCPtr, this);
126  }
127
128  
129/**
130   * Creates and returns a deep copy of this {@link SBase} object.
131   * <p>
132   * @return a (deep) copy of this {@link SBase} object.
133   */ public
134 Curve cloneObject() {
135    long cPtr = libsbmlJNI.Curve_cloneObject(swigCPtr, this);
136    return (cPtr == 0) ? null : new Curve(cPtr, true);
137  }
138
139  
140/**
141   * Returns the libSBML type code for this object.
142   * <p>
143   * This method may return the type code of this SBML object, or it may
144   * return {@link  libsbmlConstants#SBML_UNKNOWN SBML_UNKNOWN}.  This
145   * is because subclasses of {@link SBase} are not required to implement this
146   * method to return a type code.  This method is meant primarily for the
147   * LibSBML C interface, in which class and subclass information is not
148   * readily available.
149   * <p>
150   * @return the SBML object type code
151   * of this SBML object or
152   * {@link  libsbmlConstants#SBML_UNKNOWN SBML_UNKNOWN} (the default).
153   * <p>
154   * @see #getElementName()
155   * @see #getPackageName()
156   */ public
157 int getTypeCode() {
158    return libsbmlJNI.Curve_getTypeCode(swigCPtr, this);
159  }
160
161  public XMLNode toXML() {
162    return new XMLNode(libsbmlJNI.Curve_toXML(swigCPtr, this), true);
163  }
164
165  
166/**
167   * Sets this SBML object to child SBML objects (if any).
168   * (Creates a child-parent relationship by the parent)
169   * <p>
170   * Subclasses must override this function if they define
171   * one ore more child elements.
172   * Basically, this function needs to be called in
173   * constructor, copy constructor, assignment operator.
174   * <p>
175   * <p>
176   * @internal
177   */ public
178 void connectToChild() {
179    libsbmlJNI.Curve_connectToChild(swigCPtr, this);
180  }
181
182  
183/**
184   * Enables/Disables the given package with this element and child
185   * elements (if any).
186   * (This is an internal implementation for enablePackage function)
187   * <p>
188   * @note Subclasses in which one or more child elements are defined 
189   * must override this function.
190   * <p>
191   * <p>
192   * @see #connectToChild()
193   * @internal
194   */ public
195 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) {
196    libsbmlJNI.Curve_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag);
197  }
198
199}