001/* ----------------------------------------------------------------------------
002 * This file was automatically generated by SWIG (http://www.swig.org).
003 * Version 3.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-render"><a href="group__render.html">render</a></span>
013
014 Representation of a {@link Polygon}
015 <p>
016 * The {@link Polygon} is very similar to the {@link RenderCurve} class. The only difference
017 * is that in the polygon the end point of the last element in the curve
018 * segment list is automatically connected to the start point of the first
019 * element.
020 <p>
021 * Since a polygon is a closed shape and doesn't really have a start or an
022 * end, it does not get decorations as the {@link RenderCurve} does.  So, a polygon
023 * is always closed and can therefore have a fill style and fill style related
024 * attributes.  Those attributes are inherited from the {@link Polygon} base class
025 * {@link GraphicalPrimitive2D}.
026 */
027
028public class Polygon extends GraphicalPrimitive2D {
029   private long swigCPtr;
030
031   protected Polygon(long cPtr, boolean cMemoryOwn)
032   {
033     super(libsbmlJNI.Polygon_SWIGUpcast(cPtr), cMemoryOwn);
034     swigCPtr = cPtr;
035   }
036
037   protected static long getCPtr(Polygon obj)
038   {
039     return (obj == null) ? 0 : obj.swigCPtr;
040   }
041
042   protected static long getCPtrAndDisown (Polygon obj)
043   {
044     long ptr = 0;
045
046     if (obj != null)
047     {
048       ptr             = obj.swigCPtr;
049       obj.swigCMemOwn = false;
050     }
051
052     return ptr;
053   }
054
055  protected void finalize() {
056    delete();
057  }
058
059  public synchronized void delete() {
060    if (swigCPtr != 0) {
061      if (swigCMemOwn) {
062        swigCMemOwn = false;
063        libsbmlJNI.delete_Polygon(swigCPtr);
064      }
065      swigCPtr = 0;
066    }
067    super.delete();
068  }
069
070  
071/**
072   * Creates a new {@link Polygon} using the given SBML Level, Version and
073   * &ldquo;render&rdquo; package version.
074   <p>
075   * @param level a long integer, the SBML Level to assign to this {@link Polygon}.
076   <p>
077   * @param version a long integer, the SBML Version to assign to this
078   * {@link Polygon}.
079   <p>
080   * @param pkgVersion a long integer, the SBML Render Version to assign to
081   * this {@link Polygon}.
082   <p>
083   * <p>
084 * @note Attempting to add an object to an {@link SBMLDocument} having a different
085 * combination of SBML Level, Version and XML namespaces than the object
086 * itself will result in an error at the time a caller attempts to make the
087 * addition.  A parent object must have compatible Level, Version and XML
088 * namespaces.  (Strictly speaking, a parent may also have more XML
089 * namespaces than a child, but the reverse is not permitted.)  The
090 * restriction is necessary to ensure that an SBML model has a consistent
091 * overall structure.  This requires callers to manage their objects
092 * carefully, but the benefit is increased flexibility in how models can be
093 * created by permitting callers to create objects bottom-up if desired.  In
094 * situations where objects are not yet attached to parents (e.g.,
095 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help
096 * libSBML determine such things as whether it is valid to assign a
097 * particular value to an attribute.  For packages, this means that the 
098 * parent object to which this package element is being added must have
099 * been created with the package namespace, or that the package namespace
100 * was added to it, even if that parent is not a package object itself.
101   */ public
102 Polygon(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException {
103    this(libsbmlJNI.new_Polygon__SWIG_0(level, version, pkgVersion), true);
104  }
105
106  
107/**
108   * Creates a new {@link Polygon} using the given SBML Level, Version and
109   * &ldquo;render&rdquo; package version.
110   <p>
111   * @param level a long integer, the SBML Level to assign to this {@link Polygon}.
112   <p>
113   * @param version a long integer, the SBML Version to assign to this
114   * {@link Polygon}.
115   <p>
116   * @param pkgVersion a long integer, the SBML Render Version to assign to
117   * this {@link Polygon}.
118   <p>
119   * <p>
120 * @note Attempting to add an object to an {@link SBMLDocument} having a different
121 * combination of SBML Level, Version and XML namespaces than the object
122 * itself will result in an error at the time a caller attempts to make the
123 * addition.  A parent object must have compatible Level, Version and XML
124 * namespaces.  (Strictly speaking, a parent may also have more XML
125 * namespaces than a child, but the reverse is not permitted.)  The
126 * restriction is necessary to ensure that an SBML model has a consistent
127 * overall structure.  This requires callers to manage their objects
128 * carefully, but the benefit is increased flexibility in how models can be
129 * created by permitting callers to create objects bottom-up if desired.  In
130 * situations where objects are not yet attached to parents (e.g.,
131 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help
132 * libSBML determine such things as whether it is valid to assign a
133 * particular value to an attribute.  For packages, this means that the 
134 * parent object to which this package element is being added must have
135 * been created with the package namespace, or that the package namespace
136 * was added to it, even if that parent is not a package object itself.
137   */ public
138 Polygon(long level, long version) throws org.sbml.libsbml.SBMLConstructorException {
139    this(libsbmlJNI.new_Polygon__SWIG_1(level, version), true);
140  }
141
142  
143/**
144   * Creates a new {@link Polygon} using the given SBML Level, Version and
145   * &ldquo;render&rdquo; package version.
146   <p>
147   * @param level a long integer, the SBML Level to assign to this {@link Polygon}.
148   <p>
149   * @param version a long integer, the SBML Version to assign to this
150   * {@link Polygon}.
151   <p>
152   * @param pkgVersion a long integer, the SBML Render Version to assign to
153   * this {@link Polygon}.
154   <p>
155   * <p>
156 * @note Attempting to add an object to an {@link SBMLDocument} having a different
157 * combination of SBML Level, Version and XML namespaces than the object
158 * itself will result in an error at the time a caller attempts to make the
159 * addition.  A parent object must have compatible Level, Version and XML
160 * namespaces.  (Strictly speaking, a parent may also have more XML
161 * namespaces than a child, but the reverse is not permitted.)  The
162 * restriction is necessary to ensure that an SBML model has a consistent
163 * overall structure.  This requires callers to manage their objects
164 * carefully, but the benefit is increased flexibility in how models can be
165 * created by permitting callers to create objects bottom-up if desired.  In
166 * situations where objects are not yet attached to parents (e.g.,
167 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help
168 * libSBML determine such things as whether it is valid to assign a
169 * particular value to an attribute.  For packages, this means that the 
170 * parent object to which this package element is being added must have
171 * been created with the package namespace, or that the package namespace
172 * was added to it, even if that parent is not a package object itself.
173   */ public
174 Polygon(long level) throws org.sbml.libsbml.SBMLConstructorException {
175    this(libsbmlJNI.new_Polygon__SWIG_2(level), true);
176  }
177
178  
179/**
180   * Creates a new {@link Polygon} using the given SBML Level, Version and
181   * &ldquo;render&rdquo; package version.
182   <p>
183   * @param level a long integer, the SBML Level to assign to this {@link Polygon}.
184   <p>
185   * @param version a long integer, the SBML Version to assign to this
186   * {@link Polygon}.
187   <p>
188   * @param pkgVersion a long integer, the SBML Render Version to assign to
189   * this {@link Polygon}.
190   <p>
191   * <p>
192 * @note Attempting to add an object to an {@link SBMLDocument} having a different
193 * combination of SBML Level, Version and XML namespaces than the object
194 * itself will result in an error at the time a caller attempts to make the
195 * addition.  A parent object must have compatible Level, Version and XML
196 * namespaces.  (Strictly speaking, a parent may also have more XML
197 * namespaces than a child, but the reverse is not permitted.)  The
198 * restriction is necessary to ensure that an SBML model has a consistent
199 * overall structure.  This requires callers to manage their objects
200 * carefully, but the benefit is increased flexibility in how models can be
201 * created by permitting callers to create objects bottom-up if desired.  In
202 * situations where objects are not yet attached to parents (e.g.,
203 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help
204 * libSBML determine such things as whether it is valid to assign a
205 * particular value to an attribute.  For packages, this means that the 
206 * parent object to which this package element is being added must have
207 * been created with the package namespace, or that the package namespace
208 * was added to it, even if that parent is not a package object itself.
209   */ public
210 Polygon() throws org.sbml.libsbml.SBMLConstructorException {
211    this(libsbmlJNI.new_Polygon__SWIG_3(), true);
212  }
213
214  
215/**
216   * Creates a new {@link Polygon} using the given {@link RenderPkgNamespaces} object.
217   <p>
218   * <p>
219 * The package namespaces object used in this constructor is derived from a
220 * {@link SBMLNamespaces} object, which encapsulates SBML Level/Version/namespaces
221 * information.  It is used to communicate the SBML Level, Version, and 
222 * package version and name information used in addition to SBML Level&nbsp;3 Core.  A
223 * common approach to using libSBML's {@link SBMLNamespaces} facilities is to create an
224 * package namespace object somewhere in a program once, then hand that object
225 * as needed to object constructors of that package that accept it as and
226 * argument, such as this one.
227   <p>
228   * @param renderns the {@link RenderPkgNamespaces} object.
229   <p>
230   * <p>
231 * @note Attempting to add an object to an {@link SBMLDocument} having a different
232 * combination of SBML Level, Version and XML namespaces than the object
233 * itself will result in an error at the time a caller attempts to make the
234 * addition.  A parent object must have compatible Level, Version and XML
235 * namespaces.  (Strictly speaking, a parent may also have more XML
236 * namespaces than a child, but the reverse is not permitted.)  The
237 * restriction is necessary to ensure that an SBML model has a consistent
238 * overall structure.  This requires callers to manage their objects
239 * carefully, but the benefit is increased flexibility in how models can be
240 * created by permitting callers to create objects bottom-up if desired.  In
241 * situations where objects are not yet attached to parents (e.g.,
242 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help
243 * libSBML determine such things as whether it is valid to assign a
244 * particular value to an attribute.  For packages, this means that the 
245 * parent object to which this package element is being added must have
246 * been created with the package namespace, or that the package namespace
247 * was added to it, even if that parent is not a package object itself.
248   */ public
249 Polygon(RenderPkgNamespaces renderns) throws org.sbml.libsbml.SBMLConstructorException {
250    this(libsbmlJNI.new_Polygon__SWIG_4(RenderPkgNamespaces.getCPtr(renderns), renderns), true);
251  }
252
253  
254/**
255   * Creates a new {@link Polygon} object from the given {@link XMLNode} object.
256   * The {@link XMLNode} object has to contain a valid XML representation of a 
257   * {@link Polygon} object as defined in the render extension specification.
258   * This method is normally called when render information is read from a file and 
259   * should normally not have to be called explicitly.
260   <p>
261   * @param node the {@link XMLNode} object reference that describes the {@link Polygon}
262   * object to be instantiated.
263   <p>
264   * @param l2version an integer indicating the version of SBML Level&nbsp;2
265   */ public
266 Polygon(XMLNode node, long l2version) throws org.sbml.libsbml.SBMLConstructorException {
267    this(libsbmlJNI.new_Polygon__SWIG_5(XMLNode.getCPtr(node), node, l2version), true);
268  }
269
270  
271/**
272   * Creates a new {@link Polygon} object from the given {@link XMLNode} object.
273   * The {@link XMLNode} object has to contain a valid XML representation of a 
274   * {@link Polygon} object as defined in the render extension specification.
275   * This method is normally called when render information is read from a file and 
276   * should normally not have to be called explicitly.
277   <p>
278   * @param node the {@link XMLNode} object reference that describes the {@link Polygon}
279   * object to be instantiated.
280   <p>
281   * @param l2version an integer indicating the version of SBML Level&nbsp;2
282   */ public
283 Polygon(XMLNode node) throws org.sbml.libsbml.SBMLConstructorException {
284    this(libsbmlJNI.new_Polygon__SWIG_6(XMLNode.getCPtr(node), node), true);
285  }
286
287  
288/**
289   * Instanciates a polygon with the given <code>id</code> and no elements.
290   * All attributes inherited from GraphicalPrimitive are set as described
291   * in the corresponding constructor of that class (
292   * @param renderns the {@link SBMLNamespaces} object for the SBML 'render' package
293   * @param id id string for the polygon
294   <p>
295   * <p>
296 * @warning <span class='warning'>This constructor is deprecated. The new
297 * libSBML API uses constructors that either take the SBML Level and Version,
298 * <em>or</em> take an {@link SBMLNamespaces} object.</span>
299   <p>
300   * @see GraphicalPrimitive2D)
301   */ public
302 Polygon(RenderPkgNamespaces renderns, String id) throws org.sbml.libsbml.SBMLConstructorException {
303    this(libsbmlJNI.new_Polygon__SWIG_7(RenderPkgNamespaces.getCPtr(renderns), renderns, id), true);
304  }
305
306  
307/**
308   * Copy constructor for {@link Polygon}.
309   <p>
310   * @param orig the {@link Polygon} instance to copy.
311   */ public
312 Polygon(Polygon orig) throws org.sbml.libsbml.SBMLConstructorException {
313    this(libsbmlJNI.new_Polygon__SWIG_8(Polygon.getCPtr(orig), orig), true);
314  }
315
316  
317/**
318   * Creates and returns a deep copy of this {@link Polygon} object.
319   <p>
320   * @return a (deep) copy of this {@link Polygon} object.
321   */ public
322 Polygon cloneObject() {
323    long cPtr = libsbmlJNI.Polygon_cloneObject(swigCPtr, this);
324    return (cPtr == 0) ? null : new Polygon(cPtr, true);
325  }
326
327  
328/**
329   * Returns the {@link ListOfCurveElements} from this {@link Polygon}.
330   <p>
331   * @return the {@link ListOfCurveElements} from this {@link Polygon}.
332   <p>
333   * <p>
334 * @note
335 * The pointer that is returned by this function is not owned by the caller,
336 * but may be queried and modified.  Any changes made will be reflected in any
337 * resulting SBML document containing the pointer's parent.
338   <p>
339   * @see #addElement(RenderPoint object)
340   * @see #createCubicBezier()
341   * @see #getElementBySId(String sid)
342   * @see #getElement(long n)
343   * @see #getNumElements()
344   * @see #removeElement(String sid)
345   * @see #removeElement(long n)
346   */ public
347 ListOfCurveElements getListOfElements() {
348    long cPtr = libsbmlJNI.Polygon_getListOfElements__SWIG_0(swigCPtr, this);
349    return (cPtr == 0) ? null : new ListOfCurveElements(cPtr, false);
350  }
351
352  
353/**
354   * Get a {@link RenderPoint} from the {@link Polygon}.
355   <p>
356   * @param n a long integer representing the index of the {@link RenderPoint} to
357   * retrieve.
358   <p>
359   * @return the nth {@link RenderPoint} in the {@link ListOfCurveElements} within this
360   * {@link Polygon} or <code>null</code> if no such object exists.
361   <p>
362   * <p>
363 * @note
364 * The pointer that is returned by this function is not owned by the caller,
365 * but may be queried and modified.  Any changes made will be reflected in any
366 * resulting SBML document containing the pointer's parent.
367   <p>
368   * @see #addElement(RenderPoint object)
369   * @see #createCubicBezier()
370   * @see #getElementBySId(String sid)
371   * @see #getNumElements()
372   * @see #removeElement(String sid)
373   * @see #removeElement(long n)
374   */ public
375 RenderPoint getElement(long n) {
376  return (RenderPoint) libsbml.DowncastSBase(libsbmlJNI.Polygon_getElement__SWIG_0(swigCPtr, this, n), false);
377}
378
379  
380/**
381   * Adds a copy of the given {@link RenderPoint} to this {@link Polygon}.
382   <p>
383   * @param rp the {@link RenderPoint} object to add.
384   <p>
385   * <p>
386 * @return integer value indicating success/failure of the
387 * function.   The possible values
388 * returned by this function are:
389   * <ul>
390   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
391   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
392   * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT}
393   * <li> {@link libsbmlConstants#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH}
394   * <li> {@link libsbmlConstants#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH}
395   * <li> {@link libsbmlConstants#LIBSBML_PKG_VERSION_MISMATCH LIBSBML_PKG_VERSION_MISMATCH}
396   * <li> {@link libsbmlConstants#LIBSBML_DUPLICATE_OBJECT_ID LIBSBML_DUPLICATE_OBJECT_ID}
397   *
398   * </ul> <p>
399   * <p>
400 * @note This method should be used with some caution.  The fact that this
401 * method <em>copies</em> the object passed to it means that the caller will be
402 * left holding a physically different object instance than the one contained
403 * inside this object.  Changes made to the original object instance (such as
404 * resetting attribute values) will <em>not affect the instance in this
405 * object</em>.  In addition, the caller should make sure to free the
406 * original object if it is no longer being used, or else a memory leak will
407 * result.  Please see other methods on this class (particularly a
408 * corresponding method whose name begins with the word <code>create</code>)
409 * for alternatives that do not lead to these issues.
410   <p>
411   * @see #createCubicBezier()
412   * @see #getElementBySId(String sid)
413   * @see #getElement(long n)
414   * @see #getNumElements()
415   * @see #removeElement(String sid)
416   * @see #removeElement(long n)
417   */ public
418 int addElement(RenderPoint rp) {
419    return libsbmlJNI.Polygon_addElement(swigCPtr, this, RenderPoint.getCPtr(rp), rp);
420  }
421
422  
423/**
424   * Get the number of {@link RenderPoint} objects in this {@link Polygon}.
425   <p>
426   * @return the number of {@link RenderPoint} objects in this {@link Polygon}.
427   <p>
428   * @see #addElement(RenderPoint object)
429   * @see #createCubicBezier()
430   * @see #getElementBySId(String sid)
431   * @see #getElement(long n)
432   * @see #removeElement(String sid)
433   * @see #removeElement(long n)
434   */ public
435 long getNumElements() {
436    return libsbmlJNI.Polygon_getNumElements(swigCPtr, this);
437  }
438
439  
440/**
441   * Creates a new {@link RenderPoint} object, adds it to this {@link Polygon} object and
442   * returns the {@link RenderPoint} object created.
443   <p>
444   * @return a new {@link RenderPoint} object instance.
445   <p>
446   * <p>
447 * @note
448 * The pointer that is returned by this function is not owned by the caller,
449 * but may be queried and modified.  Any changes made will be reflected in any
450 * resulting SBML document containing the pointer's parent.
451   <p>
452   * @see #addElement(RenderPoint object)
453   * @see #getElementBySId(String sid)
454   * @see #getElement(long n)
455   * @see #getNumElements()
456   * @see #removeElement(String sid)
457   * @see #removeElement(long n)
458   */ public
459 RenderPoint createPoint() {
460  return (RenderPoint) libsbml.DowncastSBase(libsbmlJNI.Polygon_createPoint(swigCPtr, this), false);
461}
462
463  
464/**
465   * Creates a new {@link RenderCubicBezier} object, adds it to this {@link Polygon} object and
466   * returns the {@link RenderCubicBezier} object created.
467   <p>
468   * @return a new {@link RenderCubicBezier} object instance.
469   <p>
470   * <p>
471 * @note
472 * The pointer that is returned by this function is not owned by the caller,
473 * but may be queried and modified.  Any changes made will be reflected in any
474 * resulting SBML document containing the pointer's parent.
475   <p>
476   * @see #addElement(RenderPoint object)
477   * @see #getElementBySId(String sid)
478   * @see #getElement(long n)
479   * @see #getNumElements()
480   * @see #removeElement(String sid)
481   * @see #removeElement(long n)
482   */ public
483 RenderCubicBezier createCubicBezier() {
484    long cPtr = libsbmlJNI.Polygon_createCubicBezier(swigCPtr, this);
485    return (cPtr == 0) ? null : new RenderCubicBezier(cPtr, false);
486  }
487
488  
489/**
490   * Removes the nth {@link RenderPoint} from this {@link Polygon} and returns a pointer to it.
491   <p>
492   * @param n a long integer representing the index of the {@link RenderPoint} to
493   * remove.
494   <p>
495   * @return a pointer to the nth {@link RenderPoint} in this {@link Polygon}.
496   <p>
497   * <p>
498 * @warning
499 * <span class='warning'>The pointer that is returned by this function is owned
500 * by the caller, who is responsible for deleting it.  Any changes made to the
501 * element will not be reflected in any resulting SBML document unless the
502 * element is added to an SBML Document.  Even in this case, the element's
503 * deletion is still the responsibility of the caller with two exceptions: if
504 * it is used as the 'disownedItem' in the * {@link ListOf#appendAndOwn()} or {@link ListOf#insertAndOwn()} 
505 * functions.  All other functions in libsbml add a copy of the element,
506 * and do not transfer ownership of the pointer.</span>
507   <p>
508   * @see #addElement(RenderPoint object)
509   * @see #createCubicBezier()
510   * @see #getElementBySId(String sid)
511   * @see #getElement(long n)
512   * @see #getNumElements()
513   * @see #removeElement(String sid)
514   */ public
515 RenderPoint removeElement(long n) {
516  return (RenderPoint) libsbml.DowncastSBase(libsbmlJNI.Polygon_removeElement__SWIG_0(swigCPtr, this, n), false);
517}
518
519  
520/**
521  * Removes the {@link RenderPoint} with the given id from this 
522  * {@link Polygon} and returns a pointer to it.
523  <p>
524  * @param sid the ID of the {@link RenderPoint} to remove.
525  <p>
526  * @return a pointer to the removed {@link RenderPoint}.
527  <p>
528  * <p>
529 * @warning
530 * <span class='warning'>The pointer that is returned by this function is owned
531 * by the caller, who is responsible for deleting it.  Any changes made to the
532 * element will not be reflected in any resulting SBML document unless the
533 * element is added to an SBML Document.  Even in this case, the element's
534 * deletion is still the responsibility of the caller with two exceptions: if
535 * it is used as the 'disownedItem' in the * {@link ListOf#appendAndOwn()} or {@link ListOf#insertAndOwn()} 
536 * functions.  All other functions in libsbml add a copy of the element,
537 * and do not transfer ownership of the pointer.</span>
538  <p>
539  * @see #addElement(RenderPoint object)
540  * @see #createCubicBezier()
541  * @see #getElementBySId(String sid)
542  * @see #getElement(long n)
543  * @see #getNumElements()
544  * @see #removeElement(long n)
545  */ public
546 RenderPoint removeElement(String sid) {
547  return (RenderPoint) libsbml.DowncastSBase(libsbmlJNI.Polygon_removeElement__SWIG_1(swigCPtr, this, sid), false);
548}
549
550  
551/**
552   * Returns the XML element name of this {@link Polygon} object.
553   <p>
554   * For {@link Polygon}, the XML element name is always <code>'polygon'.</code>
555   <p>
556   * @return the name of this element, i.e. <code>'polygon'.</code>
557   */ public
558 String getElementName() {
559    return libsbmlJNI.Polygon_getElementName(swigCPtr, this);
560  }
561
562  
563/**
564   * Returns the libSBML type code for this {@link Polygon} object.
565   <p>
566   * <p>
567 * LibSBML attaches an identifying code to every kind of SBML object.  These
568 * are integer constants known as <em>SBML type codes</em>.  The names of all
569 * the codes begin with the characters <code>SBML_</code>.
570 * In the Java language interface for libSBML, the
571 * type codes are defined as static integer constants in the interface class
572 * {@link libsbmlConstants}.    Note that different Level&nbsp;3
573 * package plug-ins may use overlapping type codes; to identify the package
574 * to which a given object belongs, call the 
575 * <code>{@link SBase#getPackageName()}
576 * </code>
577 * method on the object.
578 <p>
579 * The exception to this is lists:  all SBML-style list elements have the type 
580 * {@link libsbmlConstants#SBML_LIST_OF SBML_LIST_OF}, regardless of what package they 
581 * are from.
582   <p>
583   * @return the SBML type code for this object:
584   * {@link libsbmlConstants#SBML_RENDER_POLYGON SBML_RENDER_POLYGON}.
585   <p>
586   * <p>
587 * @warning <span class='warning'>The specific integer values of the possible
588 * type codes may be reused by different libSBML plug-ins for SBML Level&nbsp;3.
589 * packages,  To fully identify the correct code, <strong>it is necessary to
590 * invoke both getPackageName() and getTypeCode()</strong> (or 
591 * {@link ListOf#getItemTypeCode()}).</span>
592   <p>
593   * @see #getElementName()
594   * @see #getPackageName()
595   */ public
596 int getTypeCode() {
597    return libsbmlJNI.Polygon_getTypeCode(swigCPtr, this);
598  }
599
600  
601/** * @internal */ public
602 void connectToChild() {
603    libsbmlJNI.Polygon_connectToChild(swigCPtr, this);
604  }
605
606  
607/** * @internal */ public
608 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) {
609    libsbmlJNI.Polygon_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag);
610  }
611
612  
613/**
614   * Returns the first child element that has the given <code>id</code> in the model-wide
615   * SId namespace, or <code>null</code> if no such object is found.
616   <p>
617   * @param id a string representing the id attribute of the object to
618   * retrieve.
619   <p>
620   * @return a pointer to the {@link SBase} element with the given <code>id</code>. If no such
621   * object is found, this method returns <code>null.</code>
622   */ public
623 SBase getElementBySId(String id) {
624  return libsbml.DowncastSBase(libsbmlJNI.Polygon_getElementBySId(swigCPtr, this, id), false);
625}
626
627  
628/**
629   * Returns the first child element that has the given <code>metaid</code>, or <code>null</code>
630   * if no such object is found.
631   <p>
632   * @param metaid a string representing the metaid attribute of the object to
633   * retrieve.
634   <p>
635   * @return a pointer to the {@link SBase} element with the given <code>metaid</code>. If no
636   * such object is found this method returns <code>null.</code>
637   */ public
638 SBase getElementByMetaId(String metaid) {
639  return libsbml.DowncastSBase(libsbmlJNI.Polygon_getElementByMetaId(swigCPtr, this, metaid), false);
640}
641
642  
643/**
644   * Creates an {@link XMLNode} object from this {@link Polygon} object.
645   <p>
646   * @return the {@link XMLNode} with the XML representation for the 
647   * {@link Polygon} object.
648   */ public
649 XMLNode toXML() {
650    return new XMLNode(libsbmlJNI.Polygon_toXML(swigCPtr, this), true);
651  }
652
653}