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 *  Parent class for libSBML's 'ListOfXYZ' classes.
013 <p>
014 * <p style='color: #777; font-style: italic'>
015This class of objects is defined by libSBML only and has no direct
016equivalent in terms of SBML components.  This class is not prescribed by
017the SBML specifications, although it is used to implement features
018defined in SBML.
019</p>
020
021 <p>
022 * The {@link ListOf} class in libSBML is a utility class that serves as the parent
023 * class for implementing the ListOf__ classes.  It provides methods for
024 * working generically with the various SBML lists of objects in a program.
025 * LibSBML uses this separate list class rather than ordinary
026 * Java lists,
027 * so that it can provide the methods and features associated with {@link SBase}.
028 <p>
029 * <p>
030 * The various ListOf___ classes in SBML
031 * are merely containers used for organizing the main components of an SBML
032 * model.  In libSBML's implementation, ListOf___
033 * classes are derived from the
034 * intermediate utility class {@link ListOf}, which
035 * is not defined by the SBML specifications but serves as a useful
036 * programmatic construct.  {@link ListOf} is itself is in turn derived from {@link SBase},
037 * which provides all of the various ListOf___
038 * classes with common features
039 * defined by the SBML specification, such as 'metaid' attributes and
040 * annotations.
041 <p>
042 * The relationship between the lists and the rest of an SBML model is
043 * illustrated by the following (for SBML Level&nbsp;2 Version&nbsp;4):
044 <p>
045 * <figure>
046  <object type="image/svg+xml" data="listof-illustration.svg" class="centered"></object>
047</figure>
048
049 <p>
050 * Readers may wonder about the motivations for using the ListOf___
051 * containers in SBML.  A simpler approach in XML might be to place the
052 * components all directly at the top level of the model definition.  The
053 * choice made in SBML is to group them within XML elements named after
054 * ListOf<em>Classname</em>, in part because it helps organize the
055 * components.  More importantly, the fact that the container classes are
056 * derived from {@link SBase} means that software tools can add information <em>about</em>
057 * the lists themselves into each list container's 'annotation'.
058 <p>
059 * @see ListOfFunctionDefinitions
060 * @see ListOfUnitDefinitions
061 * @see ListOfCompartmentTypes
062 * @see ListOfSpeciesTypes
063 * @see ListOfCompartments
064 * @see ListOfSpecies
065 * @see ListOfParameters
066 * @see ListOfInitialAssignments
067 * @see ListOfRules
068 * @see ListOfConstraints
069 * @see ListOfReactions
070 * @see ListOfEvents
071 */
072
073public class ListOf extends SBase {
074   private long swigCPtr;
075
076   protected ListOf(long cPtr, boolean cMemoryOwn)
077   {
078     super(libsbmlJNI.ListOf_SWIGUpcast(cPtr), cMemoryOwn);
079     swigCPtr = cPtr;
080   }
081
082   protected static long getCPtr(ListOf obj)
083   {
084     return (obj == null) ? 0 : obj.swigCPtr;
085   }
086
087   protected static long getCPtrAndDisown (ListOf obj)
088   {
089     long ptr = 0;
090
091     if (obj != null)
092     {
093       ptr             = obj.swigCPtr;
094       obj.swigCMemOwn = false;
095     }
096
097     return ptr;
098   }
099
100  protected void finalize() {
101    delete();
102  }
103
104  public synchronized void delete() {
105    if (swigCPtr != 0) {
106      if (swigCMemOwn) {
107        swigCMemOwn = false;
108        libsbmlJNI.delete_ListOf(swigCPtr);
109      }
110      swigCPtr = 0;
111    }
112    super.delete();
113  }
114
115  
116/**
117   * Creates a new {@link ListOf} object.
118   <p>
119   * @param level the SBML Level; if not assigned, defaults to the
120   * value of {@link SBMLDocument#getDefaultLevel()}.
121   <p>
122   * @param version the Version within the SBML Level; if not assigned,
123   * defaults to the value of {@link SBMLDocument#getDefaultVersion()}.
124   <p>
125   * <p>
126 * @note Bare {@link ListOf} objects are
127 * impossible to add to SBML models.  The {@link ListOf}
128 * class is simply the base
129 * of <em>other</em> classes in
130 * libSBML.  Calling programs are not intended to create bare {@link ListOf}
131 * objects themselves.
132   <p>
133   * <p>
134 * @note Attempting to add an object to an {@link SBMLDocument} having a different
135 * combination of SBML Level, Version and XML namespaces than the object
136 * itself will result in an error at the time a caller attempts to make the
137 * addition.  A parent object must have compatible Level, Version and XML
138 * namespaces.  (Strictly speaking, a parent may also have more XML
139 * namespaces than a child, but the reverse is not permitted.)  The
140 * restriction is necessary to ensure that an SBML model has a consistent
141 * overall structure.  This requires callers to manage their objects
142 * carefully, but the benefit is increased flexibility in how models can be
143 * created by permitting callers to create objects bottom-up if desired.  In
144 * situations where objects are not yet attached to parents (e.g.,
145 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help
146 * libSBML determine such things as whether it is valid to assign a
147 * particular value to an attribute.
148   <p>
149   * 
150</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd>
151The native C++ implementation of this method defines a default argument
152value. In the documentation generated for different libSBML language
153bindings, you may or may not see corresponding arguments in the method
154declarations. For example, in Java and C#, a default argument is handled by
155declaring two separate methods, with one of them having the argument and
156the other one lacking the argument. However, the libSBML documentation will
157be <em>identical</em> for both methods. Consequently, if you are reading
158this and do not see an argument even though one is described, please look
159for descriptions of other variants of this method near where this one
160appears in the documentation.
161</dd></dl>
162 
163   */ public
164 ListOf(long level, long version) throws org.sbml.libsbml.SBMLConstructorException {
165    this(libsbmlJNI.new_ListOf__SWIG_0(level, version), true);
166  }
167
168  
169/**
170   * Creates a new {@link ListOf} object.
171   <p>
172   * @param level the SBML Level; if not assigned, defaults to the
173   * value of {@link SBMLDocument#getDefaultLevel()}.
174   <p>
175   * @param version the Version within the SBML Level; if not assigned,
176   * defaults to the value of {@link SBMLDocument#getDefaultVersion()}.
177   <p>
178   * <p>
179 * @note Bare {@link ListOf} objects are
180 * impossible to add to SBML models.  The {@link ListOf}
181 * class is simply the base
182 * of <em>other</em> classes in
183 * libSBML.  Calling programs are not intended to create bare {@link ListOf}
184 * objects themselves.
185   <p>
186   * <p>
187 * @note Attempting to add an object to an {@link SBMLDocument} having a different
188 * combination of SBML Level, Version and XML namespaces than the object
189 * itself will result in an error at the time a caller attempts to make the
190 * addition.  A parent object must have compatible Level, Version and XML
191 * namespaces.  (Strictly speaking, a parent may also have more XML
192 * namespaces than a child, but the reverse is not permitted.)  The
193 * restriction is necessary to ensure that an SBML model has a consistent
194 * overall structure.  This requires callers to manage their objects
195 * carefully, but the benefit is increased flexibility in how models can be
196 * created by permitting callers to create objects bottom-up if desired.  In
197 * situations where objects are not yet attached to parents (e.g.,
198 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help
199 * libSBML determine such things as whether it is valid to assign a
200 * particular value to an attribute.
201   <p>
202   * 
203</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd>
204The native C++ implementation of this method defines a default argument
205value. In the documentation generated for different libSBML language
206bindings, you may or may not see corresponding arguments in the method
207declarations. For example, in Java and C#, a default argument is handled by
208declaring two separate methods, with one of them having the argument and
209the other one lacking the argument. However, the libSBML documentation will
210be <em>identical</em> for both methods. Consequently, if you are reading
211this and do not see an argument even though one is described, please look
212for descriptions of other variants of this method near where this one
213appears in the documentation.
214</dd></dl>
215 
216   */ public
217 ListOf(long level) throws org.sbml.libsbml.SBMLConstructorException {
218    this(libsbmlJNI.new_ListOf__SWIG_1(level), true);
219  }
220
221  
222/**
223   * Creates a new {@link ListOf} object.
224   <p>
225   * @param level the SBML Level; if not assigned, defaults to the
226   * value of {@link SBMLDocument#getDefaultLevel()}.
227   <p>
228   * @param version the Version within the SBML Level; if not assigned,
229   * defaults to the value of {@link SBMLDocument#getDefaultVersion()}.
230   <p>
231   * <p>
232 * @note Bare {@link ListOf} objects are
233 * impossible to add to SBML models.  The {@link ListOf}
234 * class is simply the base
235 * of <em>other</em> classes in
236 * libSBML.  Calling programs are not intended to create bare {@link ListOf}
237 * objects themselves.
238   <p>
239   * <p>
240 * @note Attempting to add an object to an {@link SBMLDocument} having a different
241 * combination of SBML Level, Version and XML namespaces than the object
242 * itself will result in an error at the time a caller attempts to make the
243 * addition.  A parent object must have compatible Level, Version and XML
244 * namespaces.  (Strictly speaking, a parent may also have more XML
245 * namespaces than a child, but the reverse is not permitted.)  The
246 * restriction is necessary to ensure that an SBML model has a consistent
247 * overall structure.  This requires callers to manage their objects
248 * carefully, but the benefit is increased flexibility in how models can be
249 * created by permitting callers to create objects bottom-up if desired.  In
250 * situations where objects are not yet attached to parents (e.g.,
251 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help
252 * libSBML determine such things as whether it is valid to assign a
253 * particular value to an attribute.
254   <p>
255   * 
256</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd>
257The native C++ implementation of this method defines a default argument
258value. In the documentation generated for different libSBML language
259bindings, you may or may not see corresponding arguments in the method
260declarations. For example, in Java and C#, a default argument is handled by
261declaring two separate methods, with one of them having the argument and
262the other one lacking the argument. However, the libSBML documentation will
263be <em>identical</em> for both methods. Consequently, if you are reading
264this and do not see an argument even though one is described, please look
265for descriptions of other variants of this method near where this one
266appears in the documentation.
267</dd></dl>
268 
269   */ public
270 ListOf() throws org.sbml.libsbml.SBMLConstructorException {
271    this(libsbmlJNI.new_ListOf__SWIG_2(), true);
272  }
273
274  
275/**
276   * Creates a new {@link ListOf} with a given {@link SBMLNamespaces} object.
277   <p>
278   * @param sbmlns the set of SBML namespaces that this {@link ListOf} should
279   * contain.
280   <p>
281   * <p>
282 * @note Bare {@link ListOf} objects are
283 * impossible to add to SBML models.  The {@link ListOf}
284 * class is simply the base
285 * of <em>other</em> classes in
286 * libSBML.  Calling programs are not intended to create bare {@link ListOf}
287 * objects themselves.
288   <p>
289   * <p>
290 * @note Attempting to add an object to an {@link SBMLDocument} having a different
291 * combination of SBML Level, Version and XML namespaces than the object
292 * itself will result in an error at the time a caller attempts to make the
293 * addition.  A parent object must have compatible Level, Version and XML
294 * namespaces.  (Strictly speaking, a parent may also have more XML
295 * namespaces than a child, but the reverse is not permitted.)  The
296 * restriction is necessary to ensure that an SBML model has a consistent
297 * overall structure.  This requires callers to manage their objects
298 * carefully, but the benefit is increased flexibility in how models can be
299 * created by permitting callers to create objects bottom-up if desired.  In
300 * situations where objects are not yet attached to parents (e.g.,
301 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help
302 * libSBML determine such things as whether it is valid to assign a
303 * particular value to an attribute.
304   */ public
305 ListOf(SBMLNamespaces sbmlns) throws org.sbml.libsbml.SBMLConstructorException {
306    this(libsbmlJNI.new_ListOf__SWIG_3(SBMLNamespaces.getCPtr(sbmlns), sbmlns), true);
307  }
308
309  
310/**
311   * Copy constructor; creates a copy of this {@link ListOf}.
312   <p>
313   * @param orig the {@link ListOf} instance to copy.
314   */ public
315 ListOf(ListOf orig) throws org.sbml.libsbml.SBMLConstructorException {
316    this(libsbmlJNI.new_ListOf__SWIG_4(ListOf.getCPtr(orig), orig), true);
317  }
318
319  
320/**
321   * Creates and returns a deep copy of this {@link ListOf} object.
322   <p>
323   * @return the (deep) copy of this {@link ListOf} object.
324   */ public
325 ListOf cloneObject() {
326    long cPtr = libsbmlJNI.ListOf_cloneObject(swigCPtr, this);
327    return (cPtr == 0) ? null : new ListOf(cPtr, true);
328  }
329
330  
331/**
332   * Adds an item to the end of this {@link ListOf}'s list of items.
333   <p>
334   * This method makes a clone of the <code>item</code> handed to it.  This means that
335   * when the {@link ListOf} object is destroyed, the original items will not be
336   * destroyed.  For a method with an alternative ownership behavior, see the
337   * {@link ListOf#appendAndOwn(SBase)} method.
338   <p>
339   * @param item the item to be added to the list.
340   <p>
341   * <p>
342 * @return integer value indicating success/failure of the
343 * function.   The possible values
344 * returned by this function are:
345   * <ul>
346   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
347   * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT}
348   *
349   * </ul> <p>
350   * @see #appendAndOwn(SBase disownedItem)
351   * @see #appendFrom(ListOf list)
352   */ public
353 int append(SBase item) {
354    return libsbmlJNI.ListOf_append(swigCPtr, this, SBase.getCPtr(item), item);
355  }
356
357  
358/**
359   * Adds an item to the end of this {@link ListOf}'s list of items.
360   <p>
361   * This method does not clone the <code>disownedItem</code> handed to it; instead, it assumes
362   * ownership of it.  This means that when the {@link ListOf} is destroyed, the item
363   * will be destroyed along with it.  For a method with an alternative
364   * ownership behavior, see the {@link ListOf#append(SBase item)} method.
365   <p>
366   * @param disownedItem the item to be added to the list.
367   <p>
368   * <p>
369 * @return integer value indicating success/failure of the
370 * function.   The possible values
371 * returned by this function are:
372   * <ul>
373   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
374   * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT}
375   *
376   * </ul> <p>
377   * @see #append(SBase item)
378   * @see #appendFrom(ListOf list)
379   */ public
380 int appendAndOwn(SBase disownedItem) {
381    return libsbmlJNI.ListOf_appendAndOwn(swigCPtr, this, SBase.getCPtrAndDisown(disownedItem), disownedItem);
382  }
383
384  
385/**
386   * Adds a clone of a list of items to this {@link ListOf}'s list.
387   <p>
388   * Note that because this clones the objects handed to it, the original
389   * items will not be destroyed when this {@link ListOf} object is destroyed.
390   <p>
391   * @param list a list of items to be added.
392   <p>
393   * <p>
394 * @return integer value indicating success/failure of the
395 * function.   The possible values
396 * returned by this function are:
397   * <ul>
398   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
399   * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT}
400   *
401   * </ul> <p>
402   * @see #append(SBase item)
403   * @see #appendAndOwn(SBase disownedItem)
404   */ public
405 int appendFrom(ListOf list) {
406    return libsbmlJNI.ListOf_appendFrom(swigCPtr, this, ListOf.getCPtr(list), list);
407  }
408
409  
410/**
411   * Inserts an item at a given position in this {@link ListOf}'s list of items.
412   <p>
413   * This variant of the method makes a clone of the <code>item</code> handed to it.
414   * This means that when the {@link ListOf} is destroyed, the original <code>item</code> will
415   * <em>not</em> be destroyed.
416   <p>
417   * @param location the location in the list where to insert the item.
418   * @param item the item to be inserted to the list.
419   <p>
420   * <p>
421 * @return integer value indicating success/failure of the
422 * function.   The possible values
423 * returned by this function are:
424   * <ul>
425   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
426   * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT}
427   *
428   * </ul> <p>
429   * @see #insertAndOwn(int location, SBase item)
430   */ public
431 int insert(int location, SBase item) {
432    return libsbmlJNI.ListOf_insert(swigCPtr, this, location, SBase.getCPtr(item), item);
433  }
434
435  
436/**
437   * Inserts an item at a given position in this {@link ListOf}'s list of items.
438   <p>
439   * This variant of the method does not make a clone of the <code>disownedItem</code> handed to it.
440   * This means that when the {@link ListOf} is destroyed, the original <code>item</code>
441   * <em>will</em> be destroyed.
442   <p>
443   * @param location the location where to insert the item
444   * @param disownedItem the item to be inserted to the list
445   <p>
446   * <p>
447 * @return integer value indicating success/failure of the
448 * function.   The possible values
449 * returned by this function are:
450   * <ul>
451   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
452   * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT}
453   *
454   * </ul> <p>
455   * @see #insert(int location, SBase item)
456   */ public
457 int insertAndOwn(int location, SBase disownedItem) {
458    return libsbmlJNI.ListOf_insertAndOwn(swigCPtr, this, location, SBase.getCPtrAndDisown(disownedItem), disownedItem);
459  }
460
461  
462/**
463   * Get an item from the list.
464   <p>
465   * @param n the index number of the item to get.
466   <p>
467   * @return the <em>n</em>th item in this {@link ListOf} items, or a null pointer if
468   * the index number <code>n</code> refers to a nonexistent position in this list.
469   <p>
470   * @see #size()
471   */ public
472 SBase get(long n) {
473  return libsbml.DowncastSBase(libsbmlJNI.ListOf_get__SWIG_0(swigCPtr, this, n), false);
474}
475
476  
477/**
478   * Returns the first child element found that has the given identifier.
479   <p>
480   * This method searches this {@link ListOf}'s list of items for SBML objects based
481   * on their 'id' attribute value in the model-wide <code>SId</code>
482   * identifier namespace.
483   <p>
484   * @param id string representing the id of the object to find.
485   <p>
486   * @return the first element found with the given <code>id</code>, or <code>null</code> if no
487   * such object is found.
488   */ public
489 SBase getElementBySId(String id) {
490  return libsbml.DowncastSBase(libsbmlJNI.ListOf_getElementBySId(swigCPtr, this, id), false);
491}
492
493  
494/**
495   * Returns the first child element found with the given meta-identifier.
496   <p>
497   * @param metaid string representing the 'metaid' attribute of the object
498   * to find.
499   <p>
500   * @return the first element found with the given <code>metaid</code>, or <code>null</code> if
501   * no such object is found.
502   */ public
503 SBase getElementByMetaId(String metaid) {
504  return libsbml.DowncastSBase(libsbmlJNI.ListOf_getElementByMetaId(swigCPtr, this, metaid), false);
505}
506
507  
508/**
509   * Removes all items in this {@link ListOf} object.
510   <p>
511   * If parameter <code>doDelete</code> is <code>true</code> (default), all items in this {@link ListOf}
512   * object are deleted and cleared, and thus the caller doesn't have to
513   * delete those items.  Otherwise, all items are cleared only from this
514   * {@link ListOf} object; the caller is still responsible for deleting the actual
515   * items.  (In the latter case, callers are advised to store pointers to
516   * all items elsewhere before calling this function.)
517   <p>
518   * @param doDelete if <code>true</code> (default), all items are deleted and cleared.
519   * Otherwise, all items are just cleared and not deleted.
520   <p>
521   * 
522</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd>
523The native C++ implementation of this method defines a default argument
524value. In the documentation generated for different libSBML language
525bindings, you may or may not see corresponding arguments in the method
526declarations. For example, in Java and C#, a default argument is handled by
527declaring two separate methods, with one of them having the argument and
528the other one lacking the argument. However, the libSBML documentation will
529be <em>identical</em> for both methods. Consequently, if you are reading
530this and do not see an argument even though one is described, please look
531for descriptions of other variants of this method near where this one
532appears in the documentation.
533</dd></dl>
534 
535   */ public
536 void clear(boolean doDelete) {
537    libsbmlJNI.ListOf_clear__SWIG_0(swigCPtr, this, doDelete);
538  }
539
540  
541/**
542   * Removes all items in this {@link ListOf} object.
543   <p>
544   * If parameter <code>doDelete</code> is <code>true</code> (default), all items in this {@link ListOf}
545   * object are deleted and cleared, and thus the caller doesn't have to
546   * delete those items.  Otherwise, all items are cleared only from this
547   * {@link ListOf} object; the caller is still responsible for deleting the actual
548   * items.  (In the latter case, callers are advised to store pointers to
549   * all items elsewhere before calling this function.)
550   <p>
551   * @param doDelete if <code>true</code> (default), all items are deleted and cleared.
552   * Otherwise, all items are just cleared and not deleted.
553   <p>
554   * 
555</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd>
556The native C++ implementation of this method defines a default argument
557value. In the documentation generated for different libSBML language
558bindings, you may or may not see corresponding arguments in the method
559declarations. For example, in Java and C#, a default argument is handled by
560declaring two separate methods, with one of them having the argument and
561the other one lacking the argument. However, the libSBML documentation will
562be <em>identical</em> for both methods. Consequently, if you are reading
563this and do not see an argument even though one is described, please look
564for descriptions of other variants of this method near where this one
565appears in the documentation.
566</dd></dl>
567 
568   */ public
569 void clear() {
570    libsbmlJNI.ListOf_clear__SWIG_1(swigCPtr, this);
571  }
572
573  
574/**
575   * Removes all items in this {@link ListOf} object and deletes its properties too.
576   <p>
577   * This performs a call to clear() with an argument of <code>true</code> (thus removing
578   * all the child objects in the list), followed by calls to various libSBML
579   * <code>unset<em>Foo</em></code> methods to delete everything else: {@link CVTerm}
580   * objects, model history objects, etc.
581   <p>
582   * <p>
583 * @return integer value indicating success/failure of the
584 * function.   The possible values
585 * returned by this function are:
586   * <ul>
587   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
588   * </ul>
589   */ public
590 int removeFromParentAndDelete() {
591    return libsbmlJNI.ListOf_removeFromParentAndDelete(swigCPtr, this);
592  }
593
594  
595/**
596   * Removes the <em>n</em>th item from this {@link ListOf} list of items and returns
597   * it.
598   <p>
599   * The caller owns the returned item and is responsible for deleting it.
600   <p>
601   * @param n the index of the item to remove
602   <p>
603   * @see #size()
604   */ public
605 SBase remove(long n) {
606  return libsbml.DowncastSBase(libsbmlJNI.ListOf_remove(swigCPtr, this, n), true);
607}
608
609  
610/**
611   * Returns number of items in this {@link ListOf} list.
612   <p>
613   * @return the number of items in this {@link ListOf} items.
614   */ public
615 long size() {
616    return libsbmlJNI.ListOf_size(swigCPtr, this);
617  }
618
619  public void connectToChild() {
620    libsbmlJNI.ListOf_connectToChild(swigCPtr, this);
621  }
622
623  
624/**
625   * Returns the libSBML type code for this object, namely,
626   * {@link libsbmlConstants#SBML_LIST_OF SBML_LIST_OF}.
627   <p>
628   * <p>
629 * LibSBML attaches an identifying code to every kind of SBML object.  These
630 * are integer constants known as <em>SBML type codes</em>.  The names of all
631 * the codes begin with the characters <code>SBML_</code>.
632 * In the Java language interface for libSBML, the
633 * type codes are defined as static integer constants in the interface class
634 * {@link libsbmlConstants}.    Note that different Level&nbsp;3
635 * package plug-ins may use overlapping type codes; to identify the package
636 * to which a given object belongs, call the <code>getPackageName()</code>
637 * method on the object.
638   <p>
639   * @return the SBML type code for this object:
640   * {@link libsbmlConstants#SBML_LIST_OF SBML_LIST_OF} (default).
641   <p>
642   * @note The various {@link ListOf} classes mostly differ from each other in what they
643   * contain.  Hence, one must call getItemTypeCode() to fully determine the
644   * class of this SBML object.
645   <p>
646   * <p>
647 * @warning <span class='warning'>The specific integer values of the possible
648 * type codes may be reused by different Level&nbsp;3 package plug-ins.
649 * Thus, to identifiy the correct code, <strong>it is necessary to invoke
650 * both getTypeCode() and getPackageName()</strong>.</span>
651   <p>
652   * @see #getItemTypeCode()
653   * @see #getElementName()
654   * @see #getPackageName()
655   */ public
656 int getTypeCode() {
657    return libsbmlJNI.ListOf_getTypeCode(swigCPtr, this);
658  }
659
660  
661/**
662   * Get the type code of the objects contained in this {@link ListOf}.
663   <p>
664   * <p>
665 * LibSBML attaches an identifying code to every kind of SBML object.  These
666 * are integer constants known as <em>SBML type codes</em>.  The names of all
667 * the codes begin with the characters <code>SBML_</code>.
668 * In the Java language interface for libSBML, the
669 * type codes are defined as static integer constants in the interface class
670 * {@link libsbmlConstants}.    Note that different Level&nbsp;3
671 * package plug-ins may use overlapping type codes; to identify the package
672 * to which a given object belongs, call the <code>getPackageName()</code>
673 * method on the object.
674   <p>
675   * Classes that inherit from the {@link ListOf} class should override this method
676   * to return the SBML type code for the objects contained in this {@link ListOf}.
677   * If they do not, this method will return
678   * {@link libsbmlConstants#SBML_UNKNOWN SBML_UNKNOWN}
679   <p>
680   * @return The {@link ListOf} base class contains no SBML objects, and therefore
681   * this method returns {@link libsbmlConstants#SBML_UNKNOWN SBML_UNKNOWN}.
682   <p>
683   * @see #getElementName()
684   * @see #getPackageName()
685   */ public
686 int getItemTypeCode() {
687    return libsbmlJNI.ListOf_getItemTypeCode(swigCPtr, this);
688  }
689
690  
691/**
692   * Returns the XML element name of this object, which for {@link ListOf}, is
693   * always <code>'listOf'.</code>
694   <p>
695   * @return the XML name of this element.
696   */ public
697 String getElementName() {
698    return libsbmlJNI.ListOf_getElementName(swigCPtr, this);
699  }
700
701  
702/** * @internal */ public
703 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) {
704    libsbmlJNI.ListOf_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag);
705  }
706
707}