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-fbc"><a href="group__fbc.html">fbc</a></span>
013 {@link Association} of a gene product with a {@link Reaction}
014 <p>
015 * In the SBML Level&nbsp;3 <a href='../../../extensions-summary.html#fbc'>Flux Balance Constraints</a> (&ldquo;fbc&rdquo;) package
016 * representation format, a {@link GeneProduct} object represents a single gene or
017 * implied gene product.  The gene or gene product is identified using the
018 * required attribute 'label', which is a text string.  (This attribute is
019 * separate from the usual SBML 'id' attribute, which is used to
020 * cross-reference entities within an SBML model.)  A {@link GeneProduct} object can
021 * also possess an optional 'associatedSpecies' attribute; if this a
022 * attribute is defined, it should have a value of type <code>SIdRef</code>
023 * and be the identifier of a {@link Species} object defined in the enclosing {@link Model}.
024 * An 'associatedSpecies', if it exists, is interpreted to be a species
025 * associated with the gene or gene product that is represented by the
026 * {@link GeneProduct} object.
027 <p>
028 * <p>
029 * @note This class of objects was introduced in Version&nbsp;2 of the
030 * SBML Level&nbsp;3 Flux Balance Constraints (&ldquo;fbc&rdquo;)
031 * specification.  In Version&nbsp;1 of &ldquo;fbc&rdquo;, the information
032 * encoded by this class can be stored instead using the {@link Association} and
033 * {@link GeneAssociation} annotation classes.  Please see the Version&nbsp;1 and
034 * Version&nbsp;2 &ldquo;fbc&rdquo; specifications for more details.
035 */
036
037public class GeneProduct extends SBase {
038   private long swigCPtr;
039
040   protected GeneProduct(long cPtr, boolean cMemoryOwn)
041   {
042     super(libsbmlJNI.GeneProduct_SWIGUpcast(cPtr), cMemoryOwn);
043     swigCPtr = cPtr;
044   }
045
046   protected static long getCPtr(GeneProduct obj)
047   {
048     return (obj == null) ? 0 : obj.swigCPtr;
049   }
050
051   protected static long getCPtrAndDisown (GeneProduct obj)
052   {
053     long ptr = 0;
054
055     if (obj != null)
056     {
057       ptr             = obj.swigCPtr;
058       obj.swigCMemOwn = false;
059     }
060
061     return ptr;
062   }
063
064  protected void finalize() {
065    delete();
066  }
067
068  public synchronized void delete() {
069    if (swigCPtr != 0) {
070      if (swigCMemOwn) {
071        swigCMemOwn = false;
072        libsbmlJNI.delete_GeneProduct(swigCPtr);
073      }
074      swigCPtr = 0;
075    }
076    super.delete();
077  }
078
079  
080/**
081   * Creates a new {@link GeneProduct} with the given SBML Level, Version, and
082   * &ldquo;fbc&rdquo;package version.
083   <p>
084   * @param level a long integer, the SBML Level to assign to this {@link GeneProduct}.
085   <p>
086   * @param version a long integer, the SBML Version to assign to this {@link GeneProduct}.
087   <p>
088   * @param pkgVersion a long integer, the SBML Fbc Version to assign to this {@link GeneProduct}.
089   <p>
090   * <p>
091 * @note Attempting to add an object to an {@link SBMLDocument} having a different
092 * combination of SBML Level, Version and XML namespaces than the object
093 * itself will result in an error at the time a caller attempts to make the
094 * addition.  A parent object must have compatible Level, Version and XML
095 * namespaces.  (Strictly speaking, a parent may also have more XML
096 * namespaces than a child, but the reverse is not permitted.)  The
097 * restriction is necessary to ensure that an SBML model has a consistent
098 * overall structure.  This requires callers to manage their objects
099 * carefully, but the benefit is increased flexibility in how models can be
100 * created by permitting callers to create objects bottom-up if desired.  In
101 * situations where objects are not yet attached to parents (e.g.,
102 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help
103 * libSBML determine such things as whether it is valid to assign a
104 * particular value to an attribute.  For packages, this means that the 
105 * parent object to which this package element is being added must have
106 * been created with the package namespace, or that the package namespace
107 * was added to it, even if that parent is not a package object itself.
108   */ public
109 GeneProduct(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException {
110    this(libsbmlJNI.new_GeneProduct__SWIG_0(level, version, pkgVersion), true);
111  }
112
113  
114/**
115   * Creates a new {@link GeneProduct} with the given SBML Level, Version, and
116   * &ldquo;fbc&rdquo;package version.
117   <p>
118   * @param level a long integer, the SBML Level to assign to this {@link GeneProduct}.
119   <p>
120   * @param version a long integer, the SBML Version to assign to this {@link GeneProduct}.
121   <p>
122   * @param pkgVersion a long integer, the SBML Fbc Version to assign to this {@link GeneProduct}.
123   <p>
124   * <p>
125 * @note Attempting to add an object to an {@link SBMLDocument} having a different
126 * combination of SBML Level, Version and XML namespaces than the object
127 * itself will result in an error at the time a caller attempts to make the
128 * addition.  A parent object must have compatible Level, Version and XML
129 * namespaces.  (Strictly speaking, a parent may also have more XML
130 * namespaces than a child, but the reverse is not permitted.)  The
131 * restriction is necessary to ensure that an SBML model has a consistent
132 * overall structure.  This requires callers to manage their objects
133 * carefully, but the benefit is increased flexibility in how models can be
134 * created by permitting callers to create objects bottom-up if desired.  In
135 * situations where objects are not yet attached to parents (e.g.,
136 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help
137 * libSBML determine such things as whether it is valid to assign a
138 * particular value to an attribute.  For packages, this means that the 
139 * parent object to which this package element is being added must have
140 * been created with the package namespace, or that the package namespace
141 * was added to it, even if that parent is not a package object itself.
142   */ public
143 GeneProduct(long level, long version) throws org.sbml.libsbml.SBMLConstructorException {
144    this(libsbmlJNI.new_GeneProduct__SWIG_1(level, version), true);
145  }
146
147  
148/**
149   * Creates a new {@link GeneProduct} with the given SBML Level, Version, and
150   * &ldquo;fbc&rdquo;package version.
151   <p>
152   * @param level a long integer, the SBML Level to assign to this {@link GeneProduct}.
153   <p>
154   * @param version a long integer, the SBML Version to assign to this {@link GeneProduct}.
155   <p>
156   * @param pkgVersion a long integer, the SBML Fbc Version to assign to this {@link GeneProduct}.
157   <p>
158   * <p>
159 * @note Attempting to add an object to an {@link SBMLDocument} having a different
160 * combination of SBML Level, Version and XML namespaces than the object
161 * itself will result in an error at the time a caller attempts to make the
162 * addition.  A parent object must have compatible Level, Version and XML
163 * namespaces.  (Strictly speaking, a parent may also have more XML
164 * namespaces than a child, but the reverse is not permitted.)  The
165 * restriction is necessary to ensure that an SBML model has a consistent
166 * overall structure.  This requires callers to manage their objects
167 * carefully, but the benefit is increased flexibility in how models can be
168 * created by permitting callers to create objects bottom-up if desired.  In
169 * situations where objects are not yet attached to parents (e.g.,
170 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help
171 * libSBML determine such things as whether it is valid to assign a
172 * particular value to an attribute.  For packages, this means that the 
173 * parent object to which this package element is being added must have
174 * been created with the package namespace, or that the package namespace
175 * was added to it, even if that parent is not a package object itself.
176   */ public
177 GeneProduct(long level) throws org.sbml.libsbml.SBMLConstructorException {
178    this(libsbmlJNI.new_GeneProduct__SWIG_2(level), true);
179  }
180
181  
182/**
183   * Creates a new {@link GeneProduct} with the given SBML Level, Version, and
184   * &ldquo;fbc&rdquo;package version.
185   <p>
186   * @param level a long integer, the SBML Level to assign to this {@link GeneProduct}.
187   <p>
188   * @param version a long integer, the SBML Version to assign to this {@link GeneProduct}.
189   <p>
190   * @param pkgVersion a long integer, the SBML Fbc Version to assign to this {@link GeneProduct}.
191   <p>
192   * <p>
193 * @note Attempting to add an object to an {@link SBMLDocument} having a different
194 * combination of SBML Level, Version and XML namespaces than the object
195 * itself will result in an error at the time a caller attempts to make the
196 * addition.  A parent object must have compatible Level, Version and XML
197 * namespaces.  (Strictly speaking, a parent may also have more XML
198 * namespaces than a child, but the reverse is not permitted.)  The
199 * restriction is necessary to ensure that an SBML model has a consistent
200 * overall structure.  This requires callers to manage their objects
201 * carefully, but the benefit is increased flexibility in how models can be
202 * created by permitting callers to create objects bottom-up if desired.  In
203 * situations where objects are not yet attached to parents (e.g.,
204 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help
205 * libSBML determine such things as whether it is valid to assign a
206 * particular value to an attribute.  For packages, this means that the 
207 * parent object to which this package element is being added must have
208 * been created with the package namespace, or that the package namespace
209 * was added to it, even if that parent is not a package object itself.
210   */ public
211 GeneProduct() throws org.sbml.libsbml.SBMLConstructorException {
212    this(libsbmlJNI.new_GeneProduct__SWIG_3(), true);
213  }
214
215  
216/**
217   * Creates a new {@link GeneProduct} with the given {@link FbcPkgNamespaces} object.
218   <p>
219   * <p>
220 * The package namespaces object used in this constructor is derived from a
221 * {@link SBMLNamespaces} object, which encapsulates SBML Level/Version/namespaces
222 * information.  It is used to communicate the SBML Level, Version, and 
223 * package version and name information used in addition to SBML Level&nbsp;3 Core.  A
224 * common approach to using libSBML's {@link SBMLNamespaces} facilities is to create an
225 * package namespace object somewhere in a program once, then hand that object
226 * as needed to object constructors of that package that accept it as and
227 * argument, such as this one.
228   <p>
229   * @param fbcns the {@link FbcPkgNamespaces} object.
230   <p>
231   * <p>
232 * @note Attempting to add an object to an {@link SBMLDocument} having a different
233 * combination of SBML Level, Version and XML namespaces than the object
234 * itself will result in an error at the time a caller attempts to make the
235 * addition.  A parent object must have compatible Level, Version and XML
236 * namespaces.  (Strictly speaking, a parent may also have more XML
237 * namespaces than a child, but the reverse is not permitted.)  The
238 * restriction is necessary to ensure that an SBML model has a consistent
239 * overall structure.  This requires callers to manage their objects
240 * carefully, but the benefit is increased flexibility in how models can be
241 * created by permitting callers to create objects bottom-up if desired.  In
242 * situations where objects are not yet attached to parents (e.g.,
243 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help
244 * libSBML determine such things as whether it is valid to assign a
245 * particular value to an attribute.  For packages, this means that the 
246 * parent object to which this package element is being added must have
247 * been created with the package namespace, or that the package namespace
248 * was added to it, even if that parent is not a package object itself.
249   */ public
250 GeneProduct(FbcPkgNamespaces fbcns) throws org.sbml.libsbml.SBMLConstructorException {
251    this(libsbmlJNI.new_GeneProduct__SWIG_4(FbcPkgNamespaces.getCPtr(fbcns), fbcns), true);
252  }
253
254  
255/**
256   * Copy constructor for {@link GeneProduct}.
257   <p>
258   * @param orig the {@link GeneProduct} instance to copy.
259   */ public
260 GeneProduct(GeneProduct orig) throws org.sbml.libsbml.SBMLConstructorException {
261    this(libsbmlJNI.new_GeneProduct__SWIG_5(GeneProduct.getCPtr(orig), orig), true);
262  }
263
264  
265/**
266   * Creates and returns a deep copy of this {@link GeneProduct} object.
267   <p>
268   * @return a (deep) copy of this {@link GeneProduct} object.
269   */ public
270 GeneProduct cloneObject() {
271    long cPtr = libsbmlJNI.GeneProduct_cloneObject(swigCPtr, this);
272    return (cPtr == 0) ? null : new GeneProduct(cPtr, true);
273  }
274
275  
276/**
277   * Returns the value of the 'id' attribute of this {@link GeneProduct}.
278   <p>
279   * @note Because of the inconsistent behavior of this function with 
280   * respect to assignments and rules, it is now recommended to
281   * use the getIdAttribute() function instead.
282   <p>
283   * <p>
284 * The identifier given by an object's 'id' attribute value
285 * is used to identify the object within the SBML model definition.
286 * Other objects can refer to the component using this identifier.  The
287 * data type of 'id' is always <code>SId</code> or a type derived
288 * from that, such as <code>UnitSId</code>, depending on the object in 
289 * question.  All data types are defined as follows:
290 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'>
291 *   letter .= 'a'..'z','A'..'Z'
292 *   digit  .= '0'..'9'
293 *   idChar .= letter | digit | '_'
294 *   SId    .= ( letter | '_' ) idChar*
295 * </pre>
296 <p>
297 * The characters <code>(</code> and <code>)</code> are used for grouping, the
298 * character <code>*</code> 'zero or more times', and the character
299 * <code>|</code> indicates logical 'or'.  The equality of SBML identifiers is
300 * determined by an exact character sequence match; i.e., comparisons must be
301 * performed in a case-sensitive manner.  This applies to all uses of <code>SId</code>, 
302 * <code>SIdRef</code>, and derived types.
303 <p>
304 * In SBML Level&nbsp;3 Version&nbsp;2, the 'id' and 'name' attributes were
305 * moved to {@link SBase} directly, instead of being defined individually for many
306 * (but not all) objects.  Libsbml has for a long time provided functions
307 * defined on {@link SBase} itself to get, set, check, and unset those attributes, which 
308 * would fail or otherwise return empty strings if executed on any object 
309 * for which those attributes were not defined.  Now that all {@link SBase} objects 
310 * define those attributes, those functions now succeed for any object with 
311 * the appropriate level and version.
312 <p>
313 * The exception to this rule is that for {@link InitialAssignment}, {@link EventAssignment}, 
314 * {@link AssignmentRule}, and {@link RateRule} objects, the getId() function and the isSetId() 
315 * functions (though not the setId() or unsetId() functions) would instead 
316 * reference the value of the 'variable' attribute (for the rules and event 
317 * assignments) or the 'symbol' attribute (for initial assignments).  
318 * The {@link AlgebraicRule} fell into this category as well, though because it 
319 * contained neither a 'variable' nor a 'symbol' attribute, getId() would 
320 * always return an empty string, and isSetId() would always return <code>false.</code>
321 * For this reason, four new functions are now provided 
322 * (getIdAttribute(), setIdAttribute(String), 
323 * isSetIdAttribute(), and unsetIdAttribute()) that will always
324 * act on the actual 'id' attribute, regardless of the object's type.  The
325 * new functions should be used instead of the old ones unless the old behavior
326 * is somehow necessary.
327 <p>
328 * Regardless of the level and version of the SBML, these functions allow
329 * client applications to use more generalized code in some situations 
330 * (for instance, when manipulating objects that are all known to have 
331 * identifiers).  If the object in question does not posess an 'id' attribute 
332 * according to the SBML specification for the Level and Version in use,
333 * libSBML will not allow the identifier to be set, nor will it read or 
334 * write 'id' attributes for those objects.
335   <p>
336   * @return the id of this {@link GeneProduct}.
337   <p>
338   * @see #getIdAttribute()
339   * @see #setIdAttribute(String sid)
340   * @see #isSetIdAttribute()
341   * @see #unsetIdAttribute()
342   */ public
343 String getId() {
344    return libsbmlJNI.GeneProduct_getId(swigCPtr, this);
345  }
346
347  
348/**
349   * Returns the value of the 'name' attribute of this {@link GeneProduct} object.
350   <p>
351   * <p>
352 * <p>
353 * In SBML Level&nbsp;3 Version&nbsp;2, the 'id' and 'name' attributes were
354 * moved to {@link SBase} directly, instead of being defined individually for many
355 * (but not all) objects.  Libsbml has for a long time provided functions
356 * defined on {@link SBase} itself to get, set, and unset those attributes, which 
357 * would fail or otherwise return empty strings if executed on any object 
358 * for which those attributes were not defined.  Now that all {@link SBase} objects 
359 * define those attributes, those functions now succeed for any object with 
360 * the appropriate level and version.
361 <p>
362 * The 'name' attribute is
363 * optional and is not intended to be used for cross-referencing purposes
364 * within a model.  Its purpose instead is to provide a human-readable
365 * label for the component.  The data type of 'name' is the type
366 * <code>string</code> defined in XML Schema.  SBML imposes no
367 * restrictions as to the content of 'name' attributes beyond those
368 * restrictions defined by the <code>string</code> type in XML Schema.
369 <p>
370 * The recommended practice for handling 'name' is as follows.  If a
371 * software tool has the capability for displaying the content of 'name'
372 * attributes, it should display this content to the user as a
373 * component's label instead of the component's 'id'.  If the user
374 * interface does not have this capability (e.g., because it cannot
375 * display or use special characters in symbol names), or if the 'name'
376 * attribute is missing on a given component, then the user interface
377 * should display the value of the 'id' attribute instead.  (Script
378 * language interpreters are especially likely to display 'id' instead of
379 * 'name'.)
380 <p>
381 * As a consequence of the above, authors of systems that automatically
382 * generate the values of 'id' attributes should be aware some systems
383 * may display the 'id''s to the user.  Authors therefore may wish to
384 * take some care to have their software create 'id' values that are: (a)
385 * reasonably easy for humans to type and read; and (b) likely to be
386 * meaningful, for example by making the 'id' attribute be an abbreviated
387 * form of the name attribute value.
388 <p>
389 * An additional point worth mentioning is although there are
390 * restrictions on the uniqueness of 'id' values, there are no
391 * restrictions on the uniqueness of 'name' values in a model.  This
392 * allows software applications leeway in assigning component identifiers.
393 <p>
394 * Regardless of the level and version of the SBML, these functions allow
395 * client applications to use more generalized code in some situations 
396 * (for instance, when manipulating objects that are all known to have 
397 * names).  If the object in question does not posess a 'name' attribute 
398 * according to the SBML specification for the Level and Version in use,
399 * libSBML will not allow the name to be set, nor will it read or 
400 * write 'name' attributes for those objects.
401 <p>
402 * @return the name of this SBML object, or the empty string if not set or unsettable.
403 <p>
404 * @see #getIdAttribute()
405 * @see #isSetName()
406 * @see #setName(String sid)
407 * @see #unsetName()
408   */ public
409 String getName() {
410    return libsbmlJNI.GeneProduct_getName(swigCPtr, this);
411  }
412
413  
414/**
415   * Returns the value of the 'label' attribute of this {@link GeneProduct}.
416   <p>
417   * @return the value of the 'label' attribute of this {@link GeneProduct} as a
418   * string.
419   */ public
420 String getLabel() {
421    return libsbmlJNI.GeneProduct_getLabel(swigCPtr, this);
422  }
423
424  
425/**
426   * Returns the value of the 'associatedSpecies' attribute of this
427   * {@link GeneProduct}.
428   <p>
429   * @return the value of the 'associatedSpecies' attribute of this
430   * {@link GeneProduct} as a string.
431   */ public
432 String getAssociatedSpecies() {
433    return libsbmlJNI.GeneProduct_getAssociatedSpecies(swigCPtr, this);
434  }
435
436  
437/**
438   * Predicate returning <code>true</code> if this {@link GeneProduct}'s 'id' attribute is set.
439   <p>
440   * <p>
441 * @note Because of the inconsistent behavior of this function with 
442 * respect to assignments and rules, it is now recommended to
443 * use the isSetIdAttribute() function instead.
444 <p>
445 * <p>
446 * The identifier given by an object's 'id' attribute value
447 * is used to identify the object within the SBML model definition.
448 * Other objects can refer to the component using this identifier.  The
449 * data type of 'id' is always <code>SId</code> or a type derived
450 * from that, such as <code>UnitSId</code>, depending on the object in 
451 * question.  All data types are defined as follows:
452 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'>
453 *   letter .= 'a'..'z','A'..'Z'
454 *   digit  .= '0'..'9'
455 *   idChar .= letter | digit | '_'
456 *   SId    .= ( letter | '_' ) idChar*
457 * </pre>
458 <p>
459 * The characters <code>(</code> and <code>)</code> are used for grouping, the
460 * character <code>*</code> 'zero or more times', and the character
461 * <code>|</code> indicates logical 'or'.  The equality of SBML identifiers is
462 * determined by an exact character sequence match; i.e., comparisons must be
463 * performed in a case-sensitive manner.  This applies to all uses of <code>SId</code>, 
464 * <code>SIdRef</code>, and derived types.
465 <p>
466 * In SBML Level&nbsp;3 Version&nbsp;2, the 'id' and 'name' attributes were
467 * moved to {@link SBase} directly, instead of being defined individually for many
468 * (but not all) objects.  Libsbml has for a long time provided functions
469 * defined on {@link SBase} itself to get, set, check, and unset those attributes, which 
470 * would fail or otherwise return empty strings if executed on any object 
471 * for which those attributes were not defined.  Now that all {@link SBase} objects 
472 * define those attributes, those functions now succeed for any object with 
473 * the appropriate level and version.
474 <p>
475 * The exception to this rule is that for {@link InitialAssignment}, {@link EventAssignment}, 
476 * {@link AssignmentRule}, and {@link RateRule} objects, the getId() function and the isSetId() 
477 * functions (though not the setId() or unsetId() functions) would instead 
478 * reference the value of the 'variable' attribute (for the rules and event 
479 * assignments) or the 'symbol' attribute (for initial assignments).  
480 * The {@link AlgebraicRule} fell into this category as well, though because it 
481 * contained neither a 'variable' nor a 'symbol' attribute, getId() would 
482 * always return an empty string, and isSetId() would always return <code>false.</code>
483 * For this reason, four new functions are now provided 
484 * (getIdAttribute(), setIdAttribute(String), 
485 * isSetIdAttribute(), and unsetIdAttribute()) that will always
486 * act on the actual 'id' attribute, regardless of the object's type.  The
487 * new functions should be used instead of the old ones unless the old behavior
488 * is somehow necessary.
489 <p>
490 * Regardless of the level and version of the SBML, these functions allow
491 * client applications to use more generalized code in some situations 
492 * (for instance, when manipulating objects that are all known to have 
493 * identifiers).  If the object in question does not posess an 'id' attribute 
494 * according to the SBML specification for the Level and Version in use,
495 * libSBML will not allow the identifier to be set, nor will it read or 
496 * write 'id' attributes for those objects.
497 <p>
498 * @return <code>true</code> if the 'id' attribute of this SBML object is
499 * set, <code>false</code> otherwise.
500 <p>
501 * @see #getIdAttribute()
502 * @see #setIdAttribute(String sid)
503 * @see #unsetIdAttribute()
504 * @see #isSetIdAttribute()
505   */ public
506 boolean isSetId() {
507    return libsbmlJNI.GeneProduct_isSetId(swigCPtr, this);
508  }
509
510  
511/**
512   * Predicate returning <code>true</code> if this {@link GeneProduct}'s 'name' attribute is
513   * set.
514   <p>
515   * <p>
516 * <p>
517 * In SBML Level&nbsp;3 Version&nbsp;2, the 'id' and 'name' attributes were
518 * moved to {@link SBase} directly, instead of being defined individually for many
519 * (but not all) objects.  Libsbml has for a long time provided functions
520 * defined on {@link SBase} itself to get, set, and unset those attributes, which 
521 * would fail or otherwise return empty strings if executed on any object 
522 * for which those attributes were not defined.  Now that all {@link SBase} objects 
523 * define those attributes, those functions now succeed for any object with 
524 * the appropriate level and version.
525 <p>
526 * The 'name' attribute is
527 * optional and is not intended to be used for cross-referencing purposes
528 * within a model.  Its purpose instead is to provide a human-readable
529 * label for the component.  The data type of 'name' is the type
530 * <code>string</code> defined in XML Schema.  SBML imposes no
531 * restrictions as to the content of 'name' attributes beyond those
532 * restrictions defined by the <code>string</code> type in XML Schema.
533 <p>
534 * The recommended practice for handling 'name' is as follows.  If a
535 * software tool has the capability for displaying the content of 'name'
536 * attributes, it should display this content to the user as a
537 * component's label instead of the component's 'id'.  If the user
538 * interface does not have this capability (e.g., because it cannot
539 * display or use special characters in symbol names), or if the 'name'
540 * attribute is missing on a given component, then the user interface
541 * should display the value of the 'id' attribute instead.  (Script
542 * language interpreters are especially likely to display 'id' instead of
543 * 'name'.)
544 <p>
545 * As a consequence of the above, authors of systems that automatically
546 * generate the values of 'id' attributes should be aware some systems
547 * may display the 'id''s to the user.  Authors therefore may wish to
548 * take some care to have their software create 'id' values that are: (a)
549 * reasonably easy for humans to type and read; and (b) likely to be
550 * meaningful, for example by making the 'id' attribute be an abbreviated
551 * form of the name attribute value.
552 <p>
553 * An additional point worth mentioning is although there are
554 * restrictions on the uniqueness of 'id' values, there are no
555 * restrictions on the uniqueness of 'name' values in a model.  This
556 * allows software applications leeway in assigning component identifiers.
557 <p>
558 * Regardless of the level and version of the SBML, these functions allow
559 * client applications to use more generalized code in some situations 
560 * (for instance, when manipulating objects that are all known to have 
561 * names).  If the object in question does not posess a 'name' attribute 
562 * according to the SBML specification for the Level and Version in use,
563 * libSBML will not allow the name to be set, nor will it read or 
564 * write 'name' attributes for those objects.
565 <p>
566 * @return <code>true</code> if the 'name' attribute of this SBML object is
567 * set, <code>false</code> otherwise.
568 <p>
569 * @see #getName()
570 * @see #setName(String sid)
571 * @see #unsetName()
572   */ public
573 boolean isSetName() {
574    return libsbmlJNI.GeneProduct_isSetName(swigCPtr, this);
575  }
576
577  
578/**
579   * Predicate returning <code>true</code> if this {@link GeneProduct}'s 'label' attribute is
580   * set.
581   <p>
582   * @return <code>true</code> if this {@link GeneProduct}'s 'label' attribute has been set,
583   * otherwise <code>false</code> is returned.
584   */ public
585 boolean isSetLabel() {
586    return libsbmlJNI.GeneProduct_isSetLabel(swigCPtr, this);
587  }
588
589  
590/**
591   * Predicate returning <code>true</code> if this {@link GeneProduct}'s 'associatedSpecies'
592   * attribute is set.
593   <p>
594   * @return <code>true</code> if this {@link GeneProduct}'s 'associatedSpecies' attribute has
595   * been set, otherwise <code>false</code> is returned.
596   */ public
597 boolean isSetAssociatedSpecies() {
598    return libsbmlJNI.GeneProduct_isSetAssociatedSpecies(swigCPtr, this);
599  }
600
601  
602/**
603   * Sets the value of the 'id' attribute of this {@link GeneProduct}.
604   <p>
605   * <p>
606 * The string <code>sid</code> is copied.
607 <p>
608 * <p>
609 * The identifier given by an object's 'id' attribute value
610 * is used to identify the object within the SBML model definition.
611 * Other objects can refer to the component using this identifier.  The
612 * data type of 'id' is always <code>SId</code> or a type derived
613 * from that, such as <code>UnitSId</code>, depending on the object in 
614 * question.  All data types are defined as follows:
615 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'>
616 *   letter .= 'a'..'z','A'..'Z'
617 *   digit  .= '0'..'9'
618 *   idChar .= letter | digit | '_'
619 *   SId    .= ( letter | '_' ) idChar*
620 * </pre>
621 <p>
622 * The characters <code>(</code> and <code>)</code> are used for grouping, the
623 * character <code>*</code> 'zero or more times', and the character
624 * <code>|</code> indicates logical 'or'.  The equality of SBML identifiers is
625 * determined by an exact character sequence match; i.e., comparisons must be
626 * performed in a case-sensitive manner.  This applies to all uses of <code>SId</code>, 
627 * <code>SIdRef</code>, and derived types.
628 <p>
629 * In SBML Level&nbsp;3 Version&nbsp;2, the 'id' and 'name' attributes were
630 * moved to {@link SBase} directly, instead of being defined individually for many
631 * (but not all) objects.  Libsbml has for a long time provided functions
632 * defined on {@link SBase} itself to get, set, check, and unset those attributes, which 
633 * would fail or otherwise return empty strings if executed on any object 
634 * for which those attributes were not defined.  Now that all {@link SBase} objects 
635 * define those attributes, those functions now succeed for any object with 
636 * the appropriate level and version.
637 <p>
638 * The exception to this rule is that for {@link InitialAssignment}, {@link EventAssignment}, 
639 * {@link AssignmentRule}, and {@link RateRule} objects, the getId() function and the isSetId() 
640 * functions (though not the setId() or unsetId() functions) would instead 
641 * reference the value of the 'variable' attribute (for the rules and event 
642 * assignments) or the 'symbol' attribute (for initial assignments).  
643 * The {@link AlgebraicRule} fell into this category as well, though because it 
644 * contained neither a 'variable' nor a 'symbol' attribute, getId() would 
645 * always return an empty string, and isSetId() would always return <code>false.</code>
646 * For this reason, four new functions are now provided 
647 * (getIdAttribute(), setIdAttribute(String), 
648 * isSetIdAttribute(), and unsetIdAttribute()) that will always
649 * act on the actual 'id' attribute, regardless of the object's type.  The
650 * new functions should be used instead of the old ones unless the old behavior
651 * is somehow necessary.
652 <p>
653 * Regardless of the level and version of the SBML, these functions allow
654 * client applications to use more generalized code in some situations 
655 * (for instance, when manipulating objects that are all known to have 
656 * identifiers).  If the object in question does not posess an 'id' attribute 
657 * according to the SBML specification for the Level and Version in use,
658 * libSBML will not allow the identifier to be set, nor will it read or 
659 * write 'id' attributes for those objects.
660 <p>
661 * @param sid the string to use as the identifier of this object.
662 <p>
663 * <p>
664 * @return integer value indicating success/failure of the
665 * function.   The possible values
666 * returned by this function are:
667 * <ul>
668 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
669 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
670 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE}
671 *
672 * </ul> <p>
673 * @see #getIdAttribute()
674 * @see #setIdAttribute(String sid)
675 * @see #isSetIdAttribute()
676 * @see #unsetIdAttribute()
677   */ public
678 int setId(String sid) {
679    return libsbmlJNI.GeneProduct_setId(swigCPtr, this, sid);
680  }
681
682  
683/**
684   * Sets the value of the 'name' attribute of this {@link GeneProduct}.
685   <p>
686   * <p>
687 * The string in <code>name</code> is copied.
688 <p>
689 * @param name the new name for the SBML object.
690 <p>
691 * <p>
692 * @return integer value indicating success/failure of the
693 * function.   The possible values
694 * returned by this function are:
695 * <ul>
696 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
697 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
698 *
699 * </ul>
700   */ public
701 int setName(String name) {
702    return libsbmlJNI.GeneProduct_setName(swigCPtr, this, name);
703  }
704
705  
706/**
707   * Sets the value of the 'label' attribute of this {@link GeneProduct}.
708   <p>
709   * @param label the value of the 'label' attribute to be
710   * set.
711   <p>
712   * <p>
713 * @return integer value indicating success/failure of the
714 * function.   The possible values
715 * returned by this function are:
716   * <ul>
717   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
718   * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
719   * </ul>
720   */ public
721 int setLabel(String label) {
722    return libsbmlJNI.GeneProduct_setLabel(swigCPtr, this, label);
723  }
724
725  
726/**
727   * Sets the value of the 'associatedSpecies' attribute of this {@link GeneProduct}.
728   <p>
729   * @param associatedSpecies the value of the
730   * 'associatedSpecies' attribute to be set.
731   <p>
732   * <p>
733 * @return integer value indicating success/failure of the
734 * function.   The possible values
735 * returned by this function are:
736   * <ul>
737   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
738   * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
739   * </ul>
740   */ public
741 int setAssociatedSpecies(String associatedSpecies) {
742    return libsbmlJNI.GeneProduct_setAssociatedSpecies(swigCPtr, this, associatedSpecies);
743  }
744
745  
746/**
747   * Unsets the value of the 'id' attribute of this {@link GeneProduct}.
748   <p>
749   * <p>
750 * <p>
751 * The identifier given by an object's 'id' attribute value
752 * is used to identify the object within the SBML model definition.
753 * Other objects can refer to the component using this identifier.  The
754 * data type of 'id' is always <code>SId</code> or a type derived
755 * from that, such as <code>UnitSId</code>, depending on the object in 
756 * question.  All data types are defined as follows:
757 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'>
758 *   letter .= 'a'..'z','A'..'Z'
759 *   digit  .= '0'..'9'
760 *   idChar .= letter | digit | '_'
761 *   SId    .= ( letter | '_' ) idChar*
762 * </pre>
763 <p>
764 * The characters <code>(</code> and <code>)</code> are used for grouping, the
765 * character <code>*</code> 'zero or more times', and the character
766 * <code>|</code> indicates logical 'or'.  The equality of SBML identifiers is
767 * determined by an exact character sequence match; i.e., comparisons must be
768 * performed in a case-sensitive manner.  This applies to all uses of <code>SId</code>, 
769 * <code>SIdRef</code>, and derived types.
770 <p>
771 * In SBML Level&nbsp;3 Version&nbsp;2, the 'id' and 'name' attributes were
772 * moved to {@link SBase} directly, instead of being defined individually for many
773 * (but not all) objects.  Libsbml has for a long time provided functions
774 * defined on {@link SBase} itself to get, set, check, and unset those attributes, which 
775 * would fail or otherwise return empty strings if executed on any object 
776 * for which those attributes were not defined.  Now that all {@link SBase} objects 
777 * define those attributes, those functions now succeed for any object with 
778 * the appropriate level and version.
779 <p>
780 * The exception to this rule is that for {@link InitialAssignment}, {@link EventAssignment}, 
781 * {@link AssignmentRule}, and {@link RateRule} objects, the getId() function and the isSetId() 
782 * functions (though not the setId() or unsetId() functions) would instead 
783 * reference the value of the 'variable' attribute (for the rules and event 
784 * assignments) or the 'symbol' attribute (for initial assignments).  
785 * The {@link AlgebraicRule} fell into this category as well, though because it 
786 * contained neither a 'variable' nor a 'symbol' attribute, getId() would 
787 * always return an empty string, and isSetId() would always return <code>false.</code>
788 * For this reason, four new functions are now provided 
789 * (getIdAttribute(), setIdAttribute(String), 
790 * isSetIdAttribute(), and unsetIdAttribute()) that will always
791 * act on the actual 'id' attribute, regardless of the object's type.  The
792 * new functions should be used instead of the old ones unless the old behavior
793 * is somehow necessary.
794 <p>
795 * Regardless of the level and version of the SBML, these functions allow
796 * client applications to use more generalized code in some situations 
797 * (for instance, when manipulating objects that are all known to have 
798 * identifiers).  If the object in question does not posess an 'id' attribute 
799 * according to the SBML specification for the Level and Version in use,
800 * libSBML will not allow the identifier to be set, nor will it read or 
801 * write 'id' attributes for those objects.
802 <p>
803 * <p>
804 * @return integer value indicating success/failure of the
805 * function.   The possible values
806 * returned by this function are:
807 * <ul>
808 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
809 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
810 *
811 * </ul> <p>
812 * @see #getIdAttribute()
813 * @see #setIdAttribute(String sid)
814 * @see #isSetIdAttribute()
815 * @see #unsetIdAttribute()
816   */ public
817 int unsetId() {
818    return libsbmlJNI.GeneProduct_unsetId(swigCPtr, this);
819  }
820
821  
822/**
823   * Unsets the value of the 'name' attribute of this {@link GeneProduct}.
824   <p>
825   * <p>
826 * <p>
827 * In SBML Level&nbsp;3 Version&nbsp;2, the 'id' and 'name' attributes were
828 * moved to {@link SBase} directly, instead of being defined individually for many
829 * (but not all) objects.  Libsbml has for a long time provided functions
830 * defined on {@link SBase} itself to get, set, and unset those attributes, which 
831 * would fail or otherwise return empty strings if executed on any object 
832 * for which those attributes were not defined.  Now that all {@link SBase} objects 
833 * define those attributes, those functions now succeed for any object with 
834 * the appropriate level and version.
835 <p>
836 * The 'name' attribute is
837 * optional and is not intended to be used for cross-referencing purposes
838 * within a model.  Its purpose instead is to provide a human-readable
839 * label for the component.  The data type of 'name' is the type
840 * <code>string</code> defined in XML Schema.  SBML imposes no
841 * restrictions as to the content of 'name' attributes beyond those
842 * restrictions defined by the <code>string</code> type in XML Schema.
843 <p>
844 * The recommended practice for handling 'name' is as follows.  If a
845 * software tool has the capability for displaying the content of 'name'
846 * attributes, it should display this content to the user as a
847 * component's label instead of the component's 'id'.  If the user
848 * interface does not have this capability (e.g., because it cannot
849 * display or use special characters in symbol names), or if the 'name'
850 * attribute is missing on a given component, then the user interface
851 * should display the value of the 'id' attribute instead.  (Script
852 * language interpreters are especially likely to display 'id' instead of
853 * 'name'.)
854 <p>
855 * As a consequence of the above, authors of systems that automatically
856 * generate the values of 'id' attributes should be aware some systems
857 * may display the 'id''s to the user.  Authors therefore may wish to
858 * take some care to have their software create 'id' values that are: (a)
859 * reasonably easy for humans to type and read; and (b) likely to be
860 * meaningful, for example by making the 'id' attribute be an abbreviated
861 * form of the name attribute value.
862 <p>
863 * An additional point worth mentioning is although there are
864 * restrictions on the uniqueness of 'id' values, there are no
865 * restrictions on the uniqueness of 'name' values in a model.  This
866 * allows software applications leeway in assigning component identifiers.
867 <p>
868 * Regardless of the level and version of the SBML, these functions allow
869 * client applications to use more generalized code in some situations 
870 * (for instance, when manipulating objects that are all known to have 
871 * names).  If the object in question does not posess a 'name' attribute 
872 * according to the SBML specification for the Level and Version in use,
873 * libSBML will not allow the name to be set, nor will it read or 
874 * write 'name' attributes for those objects.
875 <p>
876 * <p>
877 * @return integer value indicating success/failure of the
878 * function.   The possible values
879 * returned by this function are:
880 * <ul>
881 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
882 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
883 *
884 * </ul> <p>
885 * @see #getName()
886 * @see #setName(String sid)
887 * @see #isSetName()
888   */ public
889 int unsetName() {
890    return libsbmlJNI.GeneProduct_unsetName(swigCPtr, this);
891  }
892
893  
894/**
895   * Unsets the value of the 'label' attribute of this {@link GeneProduct}.
896   <p>
897   * <p>
898 * @return integer value indicating success/failure of the
899 * function.   The possible values
900 * returned by this function are:
901   * <ul>
902   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
903   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
904   * </ul>
905   */ public
906 int unsetLabel() {
907    return libsbmlJNI.GeneProduct_unsetLabel(swigCPtr, this);
908  }
909
910  
911/**
912   * Unsets the value of the 'associatedSpecies' attribute of this
913   * {@link GeneProduct}.
914   <p>
915   * <p>
916 * @return integer value indicating success/failure of the
917 * function.   The possible values
918 * returned by this function are:
919   * <ul>
920   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
921   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
922   * </ul>
923   */ public
924 int unsetAssociatedSpecies() {
925    return libsbmlJNI.GeneProduct_unsetAssociatedSpecies(swigCPtr, this);
926  }
927
928  
929/**
930   * <p>
931 * Replaces all uses of a given <code>SIdRef</code> type attribute value with another
932 * value.
933 <p>
934 * <p>
935 * In SBML, object identifiers are of a data type called <code>SId</code>.
936 * In SBML Level&nbsp;3, an explicit data type called <code>SIdRef</code> was
937 * introduced for attribute values that refer to <code>SId</code> values; in
938 * previous Levels of SBML, this data type did not exist and attributes were
939 * simply described to as 'referring to an identifier', but the effective
940 * data type was the same as <code>SIdRef</code> in Level&nbsp;3.  These and
941 * other methods of libSBML refer to the type <code>SIdRef</code> for all
942 * Levels of SBML, even if the corresponding SBML specification did not
943 * explicitly name the data type.
944 <p>
945 * This method works by looking at all attributes and (if appropriate)
946 * mathematical formulas in MathML content, comparing the referenced
947 * identifiers to the value of <code>oldid</code>.  If any matches are found, the
948 * matching values are replaced with <code>newid</code>.  The method does <em>not</em>
949 * descend into child elements.
950 <p>
951 * @param oldid the old identifier.
952 * @param newid the new identifier.
953   */ public
954 void renameSIdRefs(String oldid, String newid) {
955    libsbmlJNI.GeneProduct_renameSIdRefs(swigCPtr, this, oldid, newid);
956  }
957
958  
959/**
960   * Returns the XML element name of this object.
961   <p>
962   * For {@link GeneProduct}, the XML element name is always <code>'geneProduct'.</code>
963   <p>
964   * @return the name of this element, i.e. <code>'geneProduct'.</code>
965   */ public
966 String getElementName() {
967    return libsbmlJNI.GeneProduct_getElementName(swigCPtr, this);
968  }
969
970  
971/**
972   * Returns the libSBML type code for this SBML object.
973   <p>
974   * <p>
975 * LibSBML attaches an identifying code to every kind of SBML object.  These
976 * are integer constants known as <em>SBML type codes</em>.  The names of all
977 * the codes begin with the characters <code>SBML_</code>.
978 * In the Java language interface for libSBML, the
979 * type codes are defined as static integer constants in the interface class
980 * {@link libsbmlConstants}.    Note that different Level&nbsp;3
981 * package plug-ins may use overlapping type codes; to identify the package
982 * to which a given object belongs, call the 
983 * <code>{@link SBase#getPackageName()}
984 * </code>
985 * method on the object.
986   <p>
987   * @return the SBML type code for this object:
988   * {@link libsbmlConstants#SBML_FBC_GENEPRODUCT SBML_FBC_GENEPRODUCT} (default).
989   <p>
990   * <p>
991 * @warning <span class='warning'>The specific integer values of the possible
992 * type codes may be reused by different libSBML plug-ins for SBML Level&nbsp;3.
993 * packages,  To fully identify the correct code, <strong>it is necessary to
994 * invoke both getTypeCode() and getPackageName()</strong>.</span>
995   <p>
996   * @see #getElementName()
997   * @see #getPackageName()
998   */ public
999 int getTypeCode() {
1000    return libsbmlJNI.GeneProduct_getTypeCode(swigCPtr, this);
1001  }
1002
1003  
1004/**
1005   * Predicate returning <code>true</code> if all the required attributes
1006   * for this {@link GeneProduct} object have been set.
1007   <p>
1008   * @note The required attributes for a {@link GeneProduct} object are:
1009   * <ul>
1010   * <li> 'id'
1011   * <li> 'label'
1012   *
1013   * </ul> <p>
1014   * @return a boolean value indicating whether all the required
1015   * attributes for this object have been defined.
1016   */ public
1017 boolean hasRequiredAttributes() {
1018    return libsbmlJNI.GeneProduct_hasRequiredAttributes(swigCPtr, this);
1019  }
1020
1021  
1022/** * @internal */ public
1023 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) {
1024    libsbmlJNI.GeneProduct_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag);
1025  }
1026
1027}