001/* ----------------------------------------------------------------------------
002 * This file was automatically generated by SWIG (http://www.swig.org).
003 * Version 3.0.10
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 * container class that stores {@link GlobalRenderInformation} objects.
013 <p>
014 * The {@link ListOfLayouts} in the SBML model contains a {@link ListOfGlobalRenderInformation} which holds all {@link GlobalRenderInformation}
015 * objects.
016 */
017
018public class ListOfGlobalRenderInformation extends ListOf {
019   private long swigCPtr;
020
021   protected ListOfGlobalRenderInformation(long cPtr, boolean cMemoryOwn)
022   {
023     super(libsbmlJNI.ListOfGlobalRenderInformation_SWIGUpcast(cPtr), cMemoryOwn);
024     swigCPtr = cPtr;
025   }
026
027   protected static long getCPtr(ListOfGlobalRenderInformation obj)
028   {
029     return (obj == null) ? 0 : obj.swigCPtr;
030   }
031
032   protected static long getCPtrAndDisown (ListOfGlobalRenderInformation 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_ListOfGlobalRenderInformation(swigCPtr);
054      }
055      swigCPtr = 0;
056    }
057    super.delete();
058  }
059
060  
061/**
062   * Creates and returns a deep copy of the {@link ListOfGlobalRenderInformation} object.
063   <p>
064   * @return a (deep) copy of this {@link ListOfGlobalRenderInformation}
065   */ public
066 ListOfGlobalRenderInformation cloneObject() {
067    long cPtr = libsbmlJNI.ListOfGlobalRenderInformation_cloneObject(swigCPtr, this);
068    return (cPtr == 0) ? null : new ListOfGlobalRenderInformation(cPtr, true);
069  }
070
071  
072/**
073   * Parses the xml information in the given node and sets the attributes.
074   * This method should never be called by the user. It is only used to read render 
075   * information from annotations.
076   <p>
077   * @param node the {@link XMLNode} object reference that describes the {@link ListOfGlobalRenderInformation}
078   * object to be instantiated.
079   */ public
080 void parseXML(XMLNode node) {
081    libsbmlJNI.ListOfGlobalRenderInformation_parseXML(swigCPtr, this, XMLNode.getCPtr(node), node);
082  }
083
084  
085/**
086   * Constructor which instantiates an empty {@link ListOfGlobalRenderInformation} object.
087   */ public
088 ListOfGlobalRenderInformation(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException {
089    this(libsbmlJNI.new_ListOfGlobalRenderInformation__SWIG_0(level, version, pkgVersion), true);
090  }
091
092  
093/**
094   * Constructor which instantiates an empty {@link ListOfGlobalRenderInformation} object.
095   */ public
096 ListOfGlobalRenderInformation(long level, long version) throws org.sbml.libsbml.SBMLConstructorException {
097    this(libsbmlJNI.new_ListOfGlobalRenderInformation__SWIG_1(level, version), true);
098  }
099
100  
101/**
102   * Constructor which instantiates an empty {@link ListOfGlobalRenderInformation} object.
103   */ public
104 ListOfGlobalRenderInformation(long level) throws org.sbml.libsbml.SBMLConstructorException {
105    this(libsbmlJNI.new_ListOfGlobalRenderInformation__SWIG_2(level), true);
106  }
107
108  
109/**
110   * Constructor which instantiates an empty {@link ListOfGlobalRenderInformation} object.
111   */ public
112 ListOfGlobalRenderInformation() throws org.sbml.libsbml.SBMLConstructorException {
113    this(libsbmlJNI.new_ListOfGlobalRenderInformation__SWIG_3(), true);
114  }
115
116  
117/**
118   * Ctor.
119   */ public
120 ListOfGlobalRenderInformation(RenderPkgNamespaces renderns) throws org.sbml.libsbml.SBMLConstructorException {
121    this(libsbmlJNI.new_ListOfGlobalRenderInformation__SWIG_4(RenderPkgNamespaces.getCPtr(renderns), renderns), true);
122  }
123
124  
125/**
126   * Copy constructor for {@link ListOfGlobalRenderInformation} objects.
127   */ public
128 ListOfGlobalRenderInformation(ListOfGlobalRenderInformation source) throws org.sbml.libsbml.SBMLConstructorException {
129    this(libsbmlJNI.new_ListOfGlobalRenderInformation__SWIG_5(ListOfGlobalRenderInformation.getCPtr(source), source), true);
130  }
131
132  
133/**
134   * Get the type code of the objects contained in this {@link ListOf}.
135   <p>
136   * LibSBML attaches an identifying code to every
137   * kind of SBML object.  These are known as <em>SBML type codes</em>.  In
138   * other languages, the set of type codes is stored in an enumeration; in
139   * the Java language interface for libSBML, the type codes are defined as
140   * static integer constants in the interface class {@link
141   * libsbmlConstants}.  The names of the type codes all begin with the
142   * characters <code>SBML_.</code> 
143   <p>
144   * @return the SBML type code for the objects contained in this {@link ListOf}
145   * instance, or {@link libsbmlConstants#SBML_UNKNOWN SBML_UNKNOWN} (default).
146   */ public
147 int getItemTypeCode() {
148    return libsbmlJNI.ListOfGlobalRenderInformation_getItemTypeCode(swigCPtr, this);
149  }
150
151  
152/** */ public
153 boolean isValidTypeForList(SBase item) {
154    return libsbmlJNI.ListOfGlobalRenderInformation_isValidTypeForList(swigCPtr, this, SBase.getCPtrAndDisown(item), item);
155  }
156
157  
158/**
159   * Returns the XML element name of this object, which for
160   * {@link ListOfGlobalRenderInformation}, is always <code>'listOfGlobalRenderInformation'.</code>
161   <p>
162   * @return the name of this element, i.e., <code>'listOfGlobalRenderInformation'.</code>
163   */ public
164 String getElementName() {
165    return libsbmlJNI.ListOfGlobalRenderInformation_getElementName(swigCPtr, this);
166  }
167
168  
169/**
170   * Creates an {@link XMLNode} object from this {@link ListOfGlobalRenderInformation} object.
171   <p>
172   * @return the {@link XMLNode} with the XML representation for the 
173   * {@link ListOfGlobalRenderInformation} object.
174   */ public
175 XMLNode toXML() {
176    return new XMLNode(libsbmlJNI.ListOfGlobalRenderInformation_toXML(swigCPtr, this), true);
177  }
178
179  
180/**
181   * Sets the version of the render information list.
182   * The version consists of a major and a minor version number.
183   <p>
184   * @param major major version number
185   * @param minor minor version number
186   */ public
187 void setVersion(long major, long minor) {
188    libsbmlJNI.ListOfGlobalRenderInformation_setVersion(swigCPtr, this, major, minor);
189  }
190
191  
192/**
193   * Returns the major version of the render information list.
194   <p>
195   * @return the major version number of the global render information list
196   */ public
197 long getMajorVersion() {
198    return libsbmlJNI.ListOfGlobalRenderInformation_getMajorVersion(swigCPtr, this);
199  }
200
201  
202/**
203   * Returns the minor version of the render information list.
204   <p>
205   * @return the minor version number of the global render information list
206   */ public
207 long getMinorVersion() {
208    return libsbmlJNI.ListOfGlobalRenderInformation_getMinorVersion(swigCPtr, this);
209  }
210
211  
212/**
213   * Returns the version as a string.
214   <p>
215   * @return the version of the {@link GlobalRenderInformation} object
216   * as a string
217   */ public
218 String getVersionString() {
219    return libsbmlJNI.ListOfGlobalRenderInformation_getVersionString(swigCPtr, this);
220  }
221
222  
223/**
224   * Returns a pointer to the {@link GlobalRenderInformation} with the given index or null if
225   * the index is invalid.
226   <p>
227   * @param i index of the {@link GlobalRenderInformation} object to be returned
228   <p>
229   * @return pointer to the {@link GlobalRenderInformation} at the given index or null.
230   */ public
231 SBase get(long i) {
232    long cPtr = libsbmlJNI.ListOfGlobalRenderInformation_get__SWIG_0(swigCPtr, this, i);
233    return (cPtr == 0) ? null : new GlobalRenderInformation(cPtr, false);
234  }
235
236  
237/**
238   * Returns a pointer to the {@link GlobalRenderInformation} with the given <code>id</code> or <code>null</code> if
239   * the id is invalid.
240   <p>
241   * @param id id of the {@link GlobalRenderInformation} object to be returned
242   <p>
243   * @return pointer to the {@link GlobalRenderInformation} at the given <code>id</code> or <code>null.</code>
244   */ public
245 GlobalRenderInformation get(String id) {
246    long cPtr = libsbmlJNI.ListOfGlobalRenderInformation_get__SWIG_2(swigCPtr, this, id);
247    return (cPtr == 0) ? null : new GlobalRenderInformation(cPtr, false);
248  }
249
250  
251/**
252   * Removes the nth item from this {@link ListOfGlobalRenderInformation} items and returns a pointer to
253   * it.
254   <p>
255   * The caller owns the returned item and is responsible for deleting it.
256   <p>
257   * @param n the index of the item to remove
258   <p>
259   * @see #size()
260   */ public
261 SBase remove(long n) {
262    long cPtr = libsbmlJNI.ListOfGlobalRenderInformation_remove__SWIG_0(swigCPtr, this, n);
263    return (cPtr == 0) ? null : new GlobalRenderInformation(cPtr, true);
264  }
265
266  
267/**
268   * Removes item in this {@link ListOfGlobalRenderInformation} items with the given identifier.
269   <p>
270   * The caller owns the returned item and is responsible for deleting it.
271   * If none of the items in this list have the identifier <code>sid</code>, then @c
272   * null is returned.
273   <p>
274   * @param sid the identifier of the item to remove
275   <p>
276   * @return the item removed.  As mentioned above, the caller owns the
277   * returned item.
278   */ public
279 GlobalRenderInformation remove(String sid) {
280    long cPtr = libsbmlJNI.ListOfGlobalRenderInformation_remove__SWIG_1(swigCPtr, this, sid);
281    return (cPtr == 0) ? null : new GlobalRenderInformation(cPtr, true);
282  }
283
284}