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
011/** 
012 * <span class="pkg-marker pkg-color-layout"><a href="group__layout.html">layout</a></span>
013
014 Implementation of the ListOfReactionGlyphs construct
015 * from the &ldquo;layout&rdquo; package.
016 <p>
017 * The {@link ListOfReactionGlyphs} is a container for the {@link ReactionGlyph} elements of a {@link Layout}.
018 <p>
019 * <p>
020 * The various ListOf___ classes in SBML
021 * are merely containers used for organizing the main components of an SBML
022 * model.  In libSBML's implementation, ListOf___
023 * classes are derived from the
024 * intermediate utility class {@link ListOf}, which
025 * is not defined by the SBML specifications but serves as a useful
026 * programmatic construct.  {@link ListOf} is itself is in turn derived from {@link SBase},
027 * which provides all of the various ListOf___
028 * classes with common features
029 * defined by the SBML specification, such as 'metaid' attributes and
030 * annotations.
031 <p>
032 * The relationship between the lists and the rest of an SBML model is
033 * illustrated by the following (for SBML Level&nbsp;2 Version&nbsp;4):
034 <p>
035 * <figure>
036  <object type="image/svg+xml" data="listof-illustration.svg" class="centered"></object>
037</figure>
038
039 <p>
040 * Readers may wonder about the motivations for using the ListOf___
041 * containers in SBML.  A simpler approach in XML might be to place the
042 * components all directly at the top level of the model definition.  The
043 * choice made in SBML is to group them within XML elements named after
044 * ListOf<em>Classname</em>, in part because it helps organize the
045 * components.  More importantly, the fact that the container classes are
046 * derived from {@link SBase} means that software tools can add information <em>about</em>
047 * the lists themselves into each list container's 'annotation'.
048 <p>
049 * @see ListOfFunctionDefinitions
050 * @see ListOfUnitDefinitions
051 * @see ListOfCompartmentTypes
052 * @see ListOfSpeciesTypes
053 * @see ListOfCompartments
054 * @see ListOfSpecies
055 * @see ListOfParameters
056 * @see ListOfInitialAssignments
057 * @see ListOfRules
058 * @see ListOfConstraints
059 * @see ListOfReactions
060 * @see ListOfEvents
061 <p>
062 * @see ReactionGlyph
063 */
064
065public class ListOfReactionGlyphs extends ListOf {
066   private long swigCPtr;
067
068   protected ListOfReactionGlyphs(long cPtr, boolean cMemoryOwn)
069   {
070     super(libsbmlJNI.ListOfReactionGlyphs_SWIGUpcast(cPtr), cMemoryOwn);
071     swigCPtr = cPtr;
072   }
073
074   protected static long getCPtr(ListOfReactionGlyphs obj)
075   {
076     return (obj == null) ? 0 : obj.swigCPtr;
077   }
078
079   protected static long getCPtrAndDisown (ListOfReactionGlyphs obj)
080   {
081     long ptr = 0;
082
083     if (obj != null)
084     {
085       ptr             = obj.swigCPtr;
086       obj.swigCMemOwn = false;
087     }
088
089     return ptr;
090   }
091
092  protected void finalize() {
093    delete();
094  }
095
096  public synchronized void delete() {
097    if (swigCPtr != 0) {
098      if (swigCMemOwn) {
099        swigCMemOwn = false;
100        libsbmlJNI.delete_ListOfReactionGlyphs(swigCPtr);
101      }
102      swigCPtr = 0;
103    }
104    super.delete();
105  }
106
107  
108/**
109   * Creates and returns a deep copy of this {@link ListOfReactionGlyphs}.
110   <p>
111   * @return a (deep) copy of this {@link ListOfReactionGlyphs}.
112   */ public
113 ListOfReactionGlyphs cloneObject() {
114    long cPtr = libsbmlJNI.ListOfReactionGlyphs_cloneObject(swigCPtr, this);
115    return (cPtr == 0) ? null : new ListOfReactionGlyphs(cPtr, true);
116  }
117
118  
119/**
120   * Ctor.
121   */ public
122 ListOfReactionGlyphs(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException {
123    this(libsbmlJNI.new_ListOfReactionGlyphs__SWIG_0(level, version, pkgVersion), true);
124  }
125
126  
127/**
128   * Ctor.
129   */ public
130 ListOfReactionGlyphs(long level, long version) throws org.sbml.libsbml.SBMLConstructorException {
131    this(libsbmlJNI.new_ListOfReactionGlyphs__SWIG_1(level, version), true);
132  }
133
134  
135/**
136   * Ctor.
137   */ public
138 ListOfReactionGlyphs(long level) throws org.sbml.libsbml.SBMLConstructorException {
139    this(libsbmlJNI.new_ListOfReactionGlyphs__SWIG_2(level), true);
140  }
141
142  
143/**
144   * Ctor.
145   */ public
146 ListOfReactionGlyphs() throws org.sbml.libsbml.SBMLConstructorException {
147    this(libsbmlJNI.new_ListOfReactionGlyphs__SWIG_3(), true);
148  }
149
150  
151/**
152   * Ctor.
153   */ public
154 ListOfReactionGlyphs(LayoutPkgNamespaces layoutns) throws org.sbml.libsbml.SBMLConstructorException {
155    this(libsbmlJNI.new_ListOfReactionGlyphs__SWIG_4(LayoutPkgNamespaces.getCPtr(layoutns), layoutns), true);
156  }
157
158  
159/**
160   * Returns the libSBML type code for the SBML objects
161   * contained in this {@link ListOf} object.
162   <p>
163   * <p>
164 * LibSBML attaches an identifying code to every kind of SBML object.  These
165 * are integer constants known as <em>SBML type codes</em>.  The names of all
166 * the codes begin with the characters &ldquo;<code>SBML_</code>&rdquo;. 
167 * In the Java language interface for libSBML, the
168 * type codes are defined as static integer constants in the interface class
169 * {@link libsbmlConstants}.    Note that different Level&nbsp;3 
170 * package plug-ins may use overlapping type codes; to identify the package
171 * to which a given object belongs, call the <code>getPackageName()</code>
172 * method on the object.
173   <p>
174   * @return the SBML type code for objects contained in this list:
175   * {@link  libsbmlConstants#SBML_LAYOUT_REACTIONGLYPH SBML_LAYOUT_REACTIONGLYPH} (default).
176   <p>
177   * @see #getElementName()
178   * @see #getPackageName()
179   */ public
180 int getItemTypeCode() {
181    return libsbmlJNI.ListOfReactionGlyphs_getItemTypeCode(swigCPtr, this);
182  }
183
184  
185/**
186   * Returns the XML element name of
187   * this SBML object.
188   */ public
189 String getElementName() {
190    return libsbmlJNI.ListOfReactionGlyphs_getElementName(swigCPtr, this);
191  }
192
193  
194/**
195   * Get a {@link ReactionGlyph} from the {@link ListOfReactionGlyphs}.
196   <p>
197   * @param n the index number of the {@link ReactionGlyph} to get.
198   <p>
199   * @return the nth {@link ReactionGlyph} in this {@link ListOfReactionGlyphs}.
200   <p>
201   * @see #size()
202   */ public
203 ReactionGlyph get(long n) {
204    long cPtr = libsbmlJNI.ListOfReactionGlyphs_get__SWIG_0(swigCPtr, this, n);
205    return (cPtr == 0) ? null : new ReactionGlyph(cPtr, false);
206  }
207
208  
209/**
210   * Get a {@link ReactionGlyph} from the {@link ListOfReactionGlyphs}
211   * based on its identifier.
212   <p>
213   * @param sid a string representing the identifier 
214   * of the {@link ReactionGlyph} to get.
215   <p>
216   * @return {@link ReactionGlyph} in this {@link ListOfReactionGlyphs}
217   * with the given <code>sid</code> or <code>null</code> if no such
218   * {@link ReactionGlyph} exists.
219   <p>
220   * @see #get(long n)
221   * @see #size()
222   */ public
223 ReactionGlyph get(String sid) {
224    long cPtr = libsbmlJNI.ListOfReactionGlyphs_get__SWIG_2(swigCPtr, this, sid);
225    return (cPtr == 0) ? null : new ReactionGlyph(cPtr, false);
226  }
227
228  
229/**
230   * Removes the nth item from this {@link ListOfReactionGlyphs} items and returns a pointer to
231   * it.
232   <p>
233   * The caller owns the returned item and is responsible for deleting it.
234   <p>
235   * @param n the index of the item to remove
236   <p>
237   * @see #size()
238   */ public
239 ReactionGlyph remove(long n) {
240    long cPtr = libsbmlJNI.ListOfReactionGlyphs_remove__SWIG_0(swigCPtr, this, n);
241    return (cPtr == 0) ? null : new ReactionGlyph(cPtr, true);
242  }
243
244  
245/**
246   * Removes item in this {@link ListOfReactionGlyphs} items with the given identifier.
247   <p>
248   * The caller owns the returned item and is responsible for deleting it.
249   * If none of the items in this list have the identifier <code>sid</code>, then 
250   * <code>null</code> is returned.
251   <p>
252   * @param sid the identifier of the item to remove
253   <p>
254   * @return the item removed.  As mentioned above, the caller owns the
255   * returned item.
256   */ public
257 ReactionGlyph remove(String sid) {
258    long cPtr = libsbmlJNI.ListOfReactionGlyphs_remove__SWIG_1(swigCPtr, this, sid);
259    return (cPtr == 0) ? null : new ReactionGlyph(cPtr, true);
260  }
261
262  
263/**
264    * Creates an {@link XMLNode} object from this.
265    */ public
266 XMLNode toXML() {
267    return new XMLNode(libsbmlJNI.ListOfReactionGlyphs_toXML(swigCPtr, this), true);
268  }
269
270}