001/* ----------------------------------------------------------------------------
002 * This file was automatically generated by SWIG (http://www.swig.org).
003 * Version 3.0.7
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
011/** 
012 * A container to store curve elements (RenderPoint and {@link RenderCubicBezier}). Use in {@link RenderCurve} and {@link Polygon}
013 <p>
014 * The {@link ListOfCurveElements} is a container class to store the curve elements of {@link RenderCurve} 
015 * objects and {@link Polygon} objects.
016 */
017
018public class ListOfCurveElements extends ListOf {
019   private long swigCPtr;
020
021   protected ListOfCurveElements(long cPtr, boolean cMemoryOwn)
022   {
023     super(libsbmlJNI.ListOfCurveElements_SWIGUpcast(cPtr), cMemoryOwn);
024     swigCPtr = cPtr;
025   }
026
027   protected static long getCPtr(ListOfCurveElements obj)
028   {
029     return (obj == null) ? 0 : obj.swigCPtr;
030   }
031
032   protected static long getCPtrAndDisown (ListOfCurveElements obj)
033   {
034     long ptr = 0;
035
036     if (obj != null)
037     {
038       ptr             = obj.swigCPtr;
039       obj.swigCMemOwn = false;
040     }
041
042     return ptr;
043   }
044
045  protected void finalize() {
046    delete();
047  }
048
049  public synchronized void delete() {
050    if (swigCPtr != 0) {
051      if (swigCMemOwn) {
052        swigCMemOwn = false;
053        libsbmlJNI.delete_ListOfCurveElements(swigCPtr);
054      }
055      swigCPtr = 0;
056    }
057    super.delete();
058  }
059
060  
061/**
062   * Creates a new {@link ListOfCurveElements} object from the given {@link XMLNode} object.
063   * The {@link XMLNode} object has to contain a valid XML representation of a 
064   * {@link ListOfCurveElements} object as defined in the render extension specification.
065   * This method is normally called when render information is read from a file and 
066   * should normally not have to be called explicitly.
067   <p>
068   * @param node the {@link XMLNode} object reference that describes the {@link ListOfCurveElements}
069   * object to be instantiated.
070   */ public
071 ListOfCurveElements(XMLNode node, long l2version) throws org.sbml.libsbml.SBMLConstructorException {
072    this(libsbmlJNI.new_ListOfCurveElements__SWIG_0(XMLNode.getCPtr(node), node, l2version), true);
073  }
074
075  
076/**
077   * Creates a new {@link ListOfCurveElements} object from the given {@link XMLNode} object.
078   * The {@link XMLNode} object has to contain a valid XML representation of a 
079   * {@link ListOfCurveElements} object as defined in the render extension specification.
080   * This method is normally called when render information is read from a file and 
081   * should normally not have to be called explicitly.
082   <p>
083   * @param node the {@link XMLNode} object reference that describes the {@link ListOfCurveElements}
084   * object to be instantiated.
085   */ public
086 ListOfCurveElements(XMLNode node) throws org.sbml.libsbml.SBMLConstructorException {
087    this(libsbmlJNI.new_ListOfCurveElements__SWIG_1(XMLNode.getCPtr(node), node), true);
088  }
089
090  
091/**
092   * Creates and returns a deep copy of the {@link ListOfCurveElements} object.
093   <p>
094   * @return a (deep) copy of this {@link ListOfCurveElements}
095   */ public
096 ListOfCurveElements cloneObject() {
097    long cPtr = libsbmlJNI.ListOfCurveElements_cloneObject(swigCPtr, this);
098    return (cPtr == 0) ? null : new ListOfCurveElements(cPtr, true);
099  }
100
101  
102/**
103   * Constructor which instantiates an empty {@link ListOfCurveElements} object.
104   */ public
105 ListOfCurveElements(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException {
106    this(libsbmlJNI.new_ListOfCurveElements__SWIG_2(level, version, pkgVersion), true);
107  }
108
109  
110/**
111   * Constructor which instantiates an empty {@link ListOfCurveElements} object.
112   */ public
113 ListOfCurveElements(long level, long version) throws org.sbml.libsbml.SBMLConstructorException {
114    this(libsbmlJNI.new_ListOfCurveElements__SWIG_3(level, version), true);
115  }
116
117  
118/**
119   * Constructor which instantiates an empty {@link ListOfCurveElements} object.
120   */ public
121 ListOfCurveElements(long level) throws org.sbml.libsbml.SBMLConstructorException {
122    this(libsbmlJNI.new_ListOfCurveElements__SWIG_4(level), true);
123  }
124
125  
126/**
127   * Constructor which instantiates an empty {@link ListOfCurveElements} object.
128   */ public
129 ListOfCurveElements() throws org.sbml.libsbml.SBMLConstructorException {
130    this(libsbmlJNI.new_ListOfCurveElements__SWIG_5(), true);
131  }
132
133  
134/**
135   * Ctor.
136   */ public
137 ListOfCurveElements(RenderPkgNamespaces renderns) throws org.sbml.libsbml.SBMLConstructorException {
138    this(libsbmlJNI.new_ListOfCurveElements__SWIG_6(RenderPkgNamespaces.getCPtr(renderns), renderns), true);
139  }
140
141  
142/**
143   * Copy constructor for {@link ListOfCurveElements} objects.
144   */ public
145 ListOfCurveElements(ListOfCurveElements source) throws org.sbml.libsbml.SBMLConstructorException {
146    this(libsbmlJNI.new_ListOfCurveElements__SWIG_7(ListOfCurveElements.getCPtr(source), source), true);
147  }
148
149  
150/**
151   * Returns a pointer to the {@link RenderPoint} with the given index or null if
152   * the index is invalid.
153   <p>
154   * @param i index of the {@link RenderPoint} object to be returned
155   <p>
156   * @return pointer to the {@link RenderPoint} at the given index or null.
157   */ public
158 SBase get(long i) {
159  return (RenderPoint) libsbml.DowncastSBase(libsbmlJNI.ListOfCurveElements_get__SWIG_0(swigCPtr, this, i), false);
160}
161
162  
163/**
164   * Removes the {@link RenderPoint} with the given index and returns a pointer to the 
165   * removed object. The caller is responsible for freeing the associated memory.
166   <p>
167   * @param i index of the {@link RenderPoint} object to be removed
168   <p>
169   * @return pointer to the removed {@link RenderPoint} or null if the index
170   *  was not valid.
171   */ public
172 SBase remove(long i) {
173  return (RenderPoint) libsbml.DowncastSBase(libsbmlJNI.ListOfCurveElements_remove(swigCPtr, this, i), true);
174}
175
176  
177/**
178   * Returns the XML element name of this object, which for
179   * {@link ListOfCurveElements}, is always <code>'listOfCurveElements'.</code>
180   <p>
181   * @return the name of this element, i.e., <code>'listOfCurveElements'.</code>
182   */ public
183 String getElementName() {
184    return libsbmlJNI.ListOfCurveElements_getElementName(swigCPtr, this);
185  }
186
187  
188/**
189   * Creates an {@link XMLNode} object from this {@link ListOfCurveElements} object.
190   <p>
191   * @return the {@link XMLNode} with the XML representation for the 
192   * {@link ListOfCurveElements} object.
193   */ public
194 XMLNode toXML() {
195    return new XMLNode(libsbmlJNI.ListOfCurveElements_toXML(swigCPtr, this), true);
196  }
197
198  
199/**
200   * Get the type code of the objects contained in this {@link ListOf}.
201   <p>
202   * LibSBML attaches an identifying code to every
203   * kind of SBML object.  These are known as <em>SBML type codes</em>.  In
204   * other languages, the set of type codes is stored in an enumeration; in
205   * the Java language interface for libSBML, the type codes are defined as
206   * static integer constants in the interface class {@link
207   * libsbmlConstants}.  The names of the type codes all begin with the
208   * characters <code>SBML_.</code> 
209   <p>
210   * @return the SBML type code for the objects contained in this {@link ListOf}
211   * instance, or {@link libsbmlConstants#SBML_UNKNOWN SBML_UNKNOWN} (default).
212   */ public
213 int getItemTypeCode() {
214    return libsbmlJNI.ListOfCurveElements_getItemTypeCode(swigCPtr, this);
215  }
216
217  
218/** */ public
219 boolean isValidTypeForList(SBase item) {
220    return libsbmlJNI.ListOfCurveElements_isValidTypeForList(swigCPtr, this, SBase.getCPtrAndDisown(item), item);
221  }
222
223}