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 *  A <em>species type</em> in SBML Level 2.
013 <p>
014 * The term <em>species</em> <em>type</em> refers to reacting entities independent of
015 * location.  These include simple ions (e.g., protons, calcium), simple
016 * molecules (e.g., glucose, ATP), large molecules (e.g., RNA,
017 * polysaccharides, and proteins), and others.
018 <p>
019 * SBML Level&nbsp;2 Versions&nbsp;2&ndash;4 provide an explicit
020 * {@link SpeciesType} class of object to enable {@link Species} objects of the same type
021 * to be related together.  {@link SpeciesType} is a conceptual construct; the
022 * existence of {@link SpeciesType} objects in a model has no effect on the model's
023 * numerical interpretation.  Except for the requirement for uniqueness of
024 * species/species type combinations located in compartments, simulators
025 * and other numerical analysis software may ignore {@link SpeciesType} definitions
026 * and references to them in a model.
027 <p>
028 * There is no mechanism in SBML Level 2 for representing hierarchies of
029 * species types.  One {@link SpeciesType} object cannot be the subtype of another
030 * {@link SpeciesType} object; SBML provides no means of defining such
031 * relationships.
032 <p>
033 * As with other major structures in SBML, {@link SpeciesType} has a mandatory
034 * attribute, 'id', used to give the species type an identifier.  The
035 * identifier must be a text string conforming to the identifer syntax
036 * permitted in SBML.  {@link SpeciesType} also has an optional 'name' attribute,
037 * of type <code>string.</code>  The 'id' and 'name' must be used according to the
038 * guidelines described in the SBML specification (e.g., Section 3.3 in
039 * the Level&nbsp;2 Version&nbsp;4 specification).
040 <p>
041 * {@link SpeciesType} was introduced in SBML Level 2 Version 2.  It is not
042 * available in SBML Level&nbsp;1 nor in Level&nbsp;3.
043 <p>
044 * @see Species
045 * @see ListOfSpeciesTypes
046 * @see CompartmentType
047 * @see ListOfCompartmentTypes
048 */
049
050public class SpeciesType extends SBase {
051   private long swigCPtr;
052
053   protected SpeciesType(long cPtr, boolean cMemoryOwn)
054   {
055     super(libsbmlJNI.SpeciesType_SWIGUpcast(cPtr), cMemoryOwn);
056     swigCPtr = cPtr;
057   }
058
059   protected static long getCPtr(SpeciesType obj)
060   {
061     return (obj == null) ? 0 : obj.swigCPtr;
062   }
063
064   protected static long getCPtrAndDisown (SpeciesType obj)
065   {
066     long ptr = 0;
067
068     if (obj != null)
069     {
070       ptr             = obj.swigCPtr;
071       obj.swigCMemOwn = false;
072     }
073
074     return ptr;
075   }
076
077  protected void finalize() {
078    delete();
079  }
080
081  public synchronized void delete() {
082    if (swigCPtr != 0) {
083      if (swigCMemOwn) {
084        swigCMemOwn = false;
085        libsbmlJNI.delete_SpeciesType(swigCPtr);
086      }
087      swigCPtr = 0;
088    }
089    super.delete();
090  }
091
092  
093/**
094   * Creates a new {@link SpeciesType} using the given SBML <code>level</code> and <code>version</code>
095   * values.
096   <p>
097   * @param level a long integer, the SBML Level to assign to this {@link SpeciesType}.
098   <p>
099   * @param version a long integer, the SBML Version to assign to this
100   * {@link SpeciesType}.
101   <p>
102   * <p>
103 * @throws SBMLConstructorException
104 * Thrown if the given <code>level</code> and <code>version</code> combination are invalid
105 * or if this object is incompatible with the given level and version.
106   <p>
107   * <p>
108 * @note Attempting to add an object to an {@link SBMLDocument} having a different
109 * combination of SBML Level, Version and XML namespaces than the object
110 * itself will result in an error at the time a caller attempts to make the
111 * addition.  A parent object must have compatible Level, Version and XML
112 * namespaces.  (Strictly speaking, a parent may also have more XML
113 * namespaces than a child, but the reverse is not permitted.)  The
114 * restriction is necessary to ensure that an SBML model has a consistent
115 * overall structure.  This requires callers to manage their objects
116 * carefully, but the benefit is increased flexibility in how models can be
117 * created by permitting callers to create objects bottom-up if desired.  In
118 * situations where objects are not yet attached to parents (e.g.,
119 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help
120 * libSBML determine such things as whether it is valid to assign a
121 * particular value to an attribute.
122   */ public
123 SpeciesType(long level, long version) throws org.sbml.libsbml.SBMLConstructorException {
124    this(libsbmlJNI.new_SpeciesType__SWIG_0(level, version), true);
125  }
126
127  
128/**
129   * Creates a new {@link SpeciesType} using the given {@link SBMLNamespaces} object
130   * <code>sbmlns</code>.
131   <p>
132   * <p>
133 * The {@link SBMLNamespaces} object encapsulates SBML Level/Version/namespaces
134 * information.  It is used to communicate the SBML Level, Version, and (in
135 * Level&nbsp;3) packages used in addition to SBML Level&nbsp;3 Core.  A
136 * common approach to using libSBML's {@link SBMLNamespaces} facilities is to create an
137 * {@link SBMLNamespaces} object somewhere in a program once, then hand that object
138 * as needed to object constructors that accept {@link SBMLNamespaces} as arguments. 
139   <p>
140   * It is worth emphasizing that although this constructor does not take
141   * an identifier argument, in SBML Level&nbsp;2 and beyond, the 'id'
142   * (identifier) attribute of a {@link SpeciesType} object is required to have a value.
143   * Thus, callers are cautioned to assign a value after calling this
144   * constructor.  Setting the identifier can be accomplished using the
145   * method {@link SBase#setId(String)}.
146   <p>
147   * @param sbmlns an {@link SBMLNamespaces} object.
148   <p>
149   * <p>
150 * @throws SBMLConstructorException
151 * Thrown if the given <code>sbmlns</code> is inconsistent or incompatible
152 * with this object.
153   <p>
154   * <p>
155 * @note Attempting to add an object to an {@link SBMLDocument} having a different
156 * combination of SBML Level, Version and XML namespaces than the object
157 * itself will result in an error at the time a caller attempts to make the
158 * addition.  A parent object must have compatible Level, Version and XML
159 * namespaces.  (Strictly speaking, a parent may also have more XML
160 * namespaces than a child, but the reverse is not permitted.)  The
161 * restriction is necessary to ensure that an SBML model has a consistent
162 * overall structure.  This requires callers to manage their objects
163 * carefully, but the benefit is increased flexibility in how models can be
164 * created by permitting callers to create objects bottom-up if desired.  In
165 * situations where objects are not yet attached to parents (e.g.,
166 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help
167 * libSBML determine such things as whether it is valid to assign a
168 * particular value to an attribute.
169   */ public
170 SpeciesType(SBMLNamespaces sbmlns) throws org.sbml.libsbml.SBMLConstructorException {
171    this(libsbmlJNI.new_SpeciesType__SWIG_1(SBMLNamespaces.getCPtr(sbmlns), sbmlns), true);
172  }
173
174  
175/**
176   * Copy constructor; creates a copy of this {@link SpeciesType}.
177   <p>
178   * @param orig the object to copy.
179   */ public
180 SpeciesType(SpeciesType orig) throws org.sbml.libsbml.SBMLConstructorException {
181    this(libsbmlJNI.new_SpeciesType__SWIG_2(SpeciesType.getCPtr(orig), orig), true);
182  }
183
184  
185/**
186   * Creates and returns a deep copy of this {@link SpeciesType} object.
187   <p>
188   * @return the (deep) copy of this {@link SpeciesType} object.
189   */ public
190 SpeciesType cloneObject() {
191    long cPtr = libsbmlJNI.SpeciesType_cloneObject(swigCPtr, this);
192    return (cPtr == 0) ? null : new SpeciesType(cPtr, true);
193  }
194
195  
196/**
197   * Returns the value of the 'id' attribute of this {@link SpeciesType}.
198   <p>
199   * @note Because of the inconsistent behavior of this function with 
200   * respect to assignments and rules, it is now recommended to
201   * use the getIdAttribute() function instead.
202   <p>
203   * <p>
204 * The identifier given by an object's 'id' attribute value
205 * is used to identify the object within the SBML model definition.
206 * Other objects can refer to the component using this identifier.  The
207 * data type of 'id' is always <code>SId</code> or a type derived
208 * from that, such as <code>UnitSId</code>, depending on the object in 
209 * question.  All data types are defined as follows:
210 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'>
211 *   letter .= 'a'..'z','A'..'Z'
212 *   digit  .= '0'..'9'
213 *   idChar .= letter | digit | '_'
214 *   SId    .= ( letter | '_' ) idChar*
215 * </pre>
216 <p>
217 * The characters <code>(</code> and <code>)</code> are used for grouping, the
218 * character <code>*</code> 'zero or more times', and the character
219 * <code>|</code> indicates logical 'or'.  The equality of SBML identifiers is
220 * determined by an exact character sequence match; i.e., comparisons must be
221 * performed in a case-sensitive manner.  This applies to all uses of <code>SId</code>, 
222 * <code>SIdRef</code>, and derived types.
223 <p>
224 * In SBML Level&nbsp;3 Version&nbsp;2, the 'id' and 'name' attributes were
225 * moved to {@link SBase} directly, instead of being defined individually for many
226 * (but not all) objects.  Libsbml has for a long time provided functions
227 * defined on {@link SBase} itself to get, set, check, and unset those attributes, which 
228 * would fail or otherwise return empty strings if executed on any object 
229 * for which those attributes were not defined.  Now that all {@link SBase} objects 
230 * define those attributes, those functions now succeed for any object with 
231 * the appropriate level and version.
232 <p>
233 * The exception to this rule is that for {@link InitialAssignment}, {@link EventAssignment}, 
234 * {@link AssignmentRule}, and {@link RateRule} objects, the getId() function and the isSetId() 
235 * functions (though not the setId() or unsetId() functions) would instead 
236 * reference the value of the 'variable' attribute (for the rules and event 
237 * assignments) or the 'symbol' attribute (for initial assignments).  
238 * The {@link AlgebraicRule} fell into this category as well, though because it 
239 * contained neither a 'variable' nor a 'symbol' attribute, getId() would 
240 * always return an empty string, and isSetId() would always return <code>false.</code>
241 * For this reason, four new functions are now provided 
242 * (getIdAttribute(), setIdAttribute(String), 
243 * isSetIdAttribute(), and unsetIdAttribute()) that will always
244 * act on the actual 'id' attribute, regardless of the object's type.  The
245 * new functions should be used instead of the old ones unless the old behavior
246 * is somehow necessary.
247 <p>
248 * Regardless of the level and version of the SBML, these functions allow
249 * client applications to use more generalized code in some situations 
250 * (for instance, when manipulating objects that are all known to have 
251 * identifiers).  If the object in question does not posess an 'id' attribute 
252 * according to the SBML specification for the Level and Version in use,
253 * libSBML will not allow the identifier to be set, nor will it read or 
254 * write 'id' attributes for those objects.
255   <p>
256   * @return the id of this {@link SpeciesType}.
257   <p>
258   * @see #getIdAttribute()
259   * @see #setIdAttribute(String sid)
260   * @see #isSetIdAttribute()
261   * @see #unsetIdAttribute()
262   */ public
263 String getId() {
264    return libsbmlJNI.SpeciesType_getId(swigCPtr, this);
265  }
266
267  
268/**
269   * Returns the value of the 'name' attribute of this {@link SpeciesType} object.
270   <p>
271   * <p>
272 * <p>
273 * In SBML Level&nbsp;3 Version&nbsp;2, the 'id' and 'name' attributes were
274 * moved to {@link SBase} directly, instead of being defined individually for many
275 * (but not all) objects.  Libsbml has for a long time provided functions
276 * defined on {@link SBase} itself to get, set, and unset those attributes, which 
277 * would fail or otherwise return empty strings if executed on any object 
278 * for which those attributes were not defined.  Now that all {@link SBase} objects 
279 * define those attributes, those functions now succeed for any object with 
280 * the appropriate level and version.
281 <p>
282 * The 'name' attribute is
283 * optional and is not intended to be used for cross-referencing purposes
284 * within a model.  Its purpose instead is to provide a human-readable
285 * label for the component.  The data type of 'name' is the type
286 * <code>string</code> defined in XML Schema.  SBML imposes no
287 * restrictions as to the content of 'name' attributes beyond those
288 * restrictions defined by the <code>string</code> type in XML Schema.
289 <p>
290 * The recommended practice for handling 'name' is as follows.  If a
291 * software tool has the capability for displaying the content of 'name'
292 * attributes, it should display this content to the user as a
293 * component's label instead of the component's 'id'.  If the user
294 * interface does not have this capability (e.g., because it cannot
295 * display or use special characters in symbol names), or if the 'name'
296 * attribute is missing on a given component, then the user interface
297 * should display the value of the 'id' attribute instead.  (Script
298 * language interpreters are especially likely to display 'id' instead of
299 * 'name'.)
300 <p>
301 * As a consequence of the above, authors of systems that automatically
302 * generate the values of 'id' attributes should be aware some systems
303 * may display the 'id''s to the user.  Authors therefore may wish to
304 * take some care to have their software create 'id' values that are: (a)
305 * reasonably easy for humans to type and read; and (b) likely to be
306 * meaningful, for example by making the 'id' attribute be an abbreviated
307 * form of the name attribute value.
308 <p>
309 * An additional point worth mentioning is although there are
310 * restrictions on the uniqueness of 'id' values, there are no
311 * restrictions on the uniqueness of 'name' values in a model.  This
312 * allows software applications leeway in assigning component identifiers.
313 <p>
314 * Regardless of the level and version of the SBML, these functions allow
315 * client applications to use more generalized code in some situations 
316 * (for instance, when manipulating objects that are all known to have 
317 * names).  If the object in question does not posess a 'name' attribute 
318 * according to the SBML specification for the Level and Version in use,
319 * libSBML will not allow the name to be set, nor will it read or 
320 * write 'name' attributes for those objects.
321 <p>
322 * @return the name of this SBML object, or the empty string if not set or unsettable.
323 <p>
324 * @see #getIdAttribute()
325 * @see #isSetName()
326 * @see #setName(String sid)
327 * @see #unsetName()
328   */ public
329 String getName() {
330    return libsbmlJNI.SpeciesType_getName(swigCPtr, this);
331  }
332
333  
334/**
335   * Predicate returning <code>true</code> if this
336   * {@link SpeciesType}'s 'id' attribute is set.
337   <p>
338   * <p>
339 * @note Because of the inconsistent behavior of this function with 
340 * respect to assignments and rules, it is now recommended to
341 * use the isSetIdAttribute() function instead.
342 <p>
343 * <p>
344 * The identifier given by an object's 'id' attribute value
345 * is used to identify the object within the SBML model definition.
346 * Other objects can refer to the component using this identifier.  The
347 * data type of 'id' is always <code>SId</code> or a type derived
348 * from that, such as <code>UnitSId</code>, depending on the object in 
349 * question.  All data types are defined as follows:
350 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'>
351 *   letter .= 'a'..'z','A'..'Z'
352 *   digit  .= '0'..'9'
353 *   idChar .= letter | digit | '_'
354 *   SId    .= ( letter | '_' ) idChar*
355 * </pre>
356 <p>
357 * The characters <code>(</code> and <code>)</code> are used for grouping, the
358 * character <code>*</code> 'zero or more times', and the character
359 * <code>|</code> indicates logical 'or'.  The equality of SBML identifiers is
360 * determined by an exact character sequence match; i.e., comparisons must be
361 * performed in a case-sensitive manner.  This applies to all uses of <code>SId</code>, 
362 * <code>SIdRef</code>, and derived types.
363 <p>
364 * In SBML Level&nbsp;3 Version&nbsp;2, the 'id' and 'name' attributes were
365 * moved to {@link SBase} directly, instead of being defined individually for many
366 * (but not all) objects.  Libsbml has for a long time provided functions
367 * defined on {@link SBase} itself to get, set, check, and unset those attributes, which 
368 * would fail or otherwise return empty strings if executed on any object 
369 * for which those attributes were not defined.  Now that all {@link SBase} objects 
370 * define those attributes, those functions now succeed for any object with 
371 * the appropriate level and version.
372 <p>
373 * The exception to this rule is that for {@link InitialAssignment}, {@link EventAssignment}, 
374 * {@link AssignmentRule}, and {@link RateRule} objects, the getId() function and the isSetId() 
375 * functions (though not the setId() or unsetId() functions) would instead 
376 * reference the value of the 'variable' attribute (for the rules and event 
377 * assignments) or the 'symbol' attribute (for initial assignments).  
378 * The {@link AlgebraicRule} fell into this category as well, though because it 
379 * contained neither a 'variable' nor a 'symbol' attribute, getId() would 
380 * always return an empty string, and isSetId() would always return <code>false.</code>
381 * For this reason, four new functions are now provided 
382 * (getIdAttribute(), setIdAttribute(String), 
383 * isSetIdAttribute(), and unsetIdAttribute()) that will always
384 * act on the actual 'id' attribute, regardless of the object's type.  The
385 * new functions should be used instead of the old ones unless the old behavior
386 * is somehow necessary.
387 <p>
388 * Regardless of the level and version of the SBML, these functions allow
389 * client applications to use more generalized code in some situations 
390 * (for instance, when manipulating objects that are all known to have 
391 * identifiers).  If the object in question does not posess an 'id' attribute 
392 * according to the SBML specification for the Level and Version in use,
393 * libSBML will not allow the identifier to be set, nor will it read or 
394 * write 'id' attributes for those objects.
395 <p>
396 * @return <code>true</code> if the 'id' attribute of this SBML object is
397 * set, <code>false</code> otherwise.
398 <p>
399 * @see #getIdAttribute()
400 * @see #setIdAttribute(String sid)
401 * @see #unsetIdAttribute()
402 * @see #isSetIdAttribute()
403   */ public
404 boolean isSetId() {
405    return libsbmlJNI.SpeciesType_isSetId(swigCPtr, this);
406  }
407
408  
409/**
410   * Predicate returning <code>true</code> if this
411   * {@link SpeciesType}'s 'name' attribute is set.
412   <p>
413   * <p>
414 * <p>
415 * In SBML Level&nbsp;3 Version&nbsp;2, the 'id' and 'name' attributes were
416 * moved to {@link SBase} directly, instead of being defined individually for many
417 * (but not all) objects.  Libsbml has for a long time provided functions
418 * defined on {@link SBase} itself to get, set, and unset those attributes, which 
419 * would fail or otherwise return empty strings if executed on any object 
420 * for which those attributes were not defined.  Now that all {@link SBase} objects 
421 * define those attributes, those functions now succeed for any object with 
422 * the appropriate level and version.
423 <p>
424 * The 'name' attribute is
425 * optional and is not intended to be used for cross-referencing purposes
426 * within a model.  Its purpose instead is to provide a human-readable
427 * label for the component.  The data type of 'name' is the type
428 * <code>string</code> defined in XML Schema.  SBML imposes no
429 * restrictions as to the content of 'name' attributes beyond those
430 * restrictions defined by the <code>string</code> type in XML Schema.
431 <p>
432 * The recommended practice for handling 'name' is as follows.  If a
433 * software tool has the capability for displaying the content of 'name'
434 * attributes, it should display this content to the user as a
435 * component's label instead of the component's 'id'.  If the user
436 * interface does not have this capability (e.g., because it cannot
437 * display or use special characters in symbol names), or if the 'name'
438 * attribute is missing on a given component, then the user interface
439 * should display the value of the 'id' attribute instead.  (Script
440 * language interpreters are especially likely to display 'id' instead of
441 * 'name'.)
442 <p>
443 * As a consequence of the above, authors of systems that automatically
444 * generate the values of 'id' attributes should be aware some systems
445 * may display the 'id''s to the user.  Authors therefore may wish to
446 * take some care to have their software create 'id' values that are: (a)
447 * reasonably easy for humans to type and read; and (b) likely to be
448 * meaningful, for example by making the 'id' attribute be an abbreviated
449 * form of the name attribute value.
450 <p>
451 * An additional point worth mentioning is although there are
452 * restrictions on the uniqueness of 'id' values, there are no
453 * restrictions on the uniqueness of 'name' values in a model.  This
454 * allows software applications leeway in assigning component identifiers.
455 <p>
456 * Regardless of the level and version of the SBML, these functions allow
457 * client applications to use more generalized code in some situations 
458 * (for instance, when manipulating objects that are all known to have 
459 * names).  If the object in question does not posess a 'name' attribute 
460 * according to the SBML specification for the Level and Version in use,
461 * libSBML will not allow the name to be set, nor will it read or 
462 * write 'name' attributes for those objects.
463 <p>
464 * @return <code>true</code> if the 'name' attribute of this SBML object is
465 * set, <code>false</code> otherwise.
466 <p>
467 * @see #getName()
468 * @see #setName(String sid)
469 * @see #unsetName()
470   */ public
471 boolean isSetName() {
472    return libsbmlJNI.SpeciesType_isSetName(swigCPtr, this);
473  }
474
475  
476/**
477   * Sets the value of the 'id' attribute of this {@link SpeciesType}.
478   <p>
479   * <p>
480 * The string <code>sid</code> is copied.
481 <p>
482 * <p>
483 * The identifier given by an object's 'id' attribute value
484 * is used to identify the object within the SBML model definition.
485 * Other objects can refer to the component using this identifier.  The
486 * data type of 'id' is always <code>SId</code> or a type derived
487 * from that, such as <code>UnitSId</code>, depending on the object in 
488 * question.  All data types are defined as follows:
489 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'>
490 *   letter .= 'a'..'z','A'..'Z'
491 *   digit  .= '0'..'9'
492 *   idChar .= letter | digit | '_'
493 *   SId    .= ( letter | '_' ) idChar*
494 * </pre>
495 <p>
496 * The characters <code>(</code> and <code>)</code> are used for grouping, the
497 * character <code>*</code> 'zero or more times', and the character
498 * <code>|</code> indicates logical 'or'.  The equality of SBML identifiers is
499 * determined by an exact character sequence match; i.e., comparisons must be
500 * performed in a case-sensitive manner.  This applies to all uses of <code>SId</code>, 
501 * <code>SIdRef</code>, and derived types.
502 <p>
503 * In SBML Level&nbsp;3 Version&nbsp;2, the 'id' and 'name' attributes were
504 * moved to {@link SBase} directly, instead of being defined individually for many
505 * (but not all) objects.  Libsbml has for a long time provided functions
506 * defined on {@link SBase} itself to get, set, check, and unset those attributes, which 
507 * would fail or otherwise return empty strings if executed on any object 
508 * for which those attributes were not defined.  Now that all {@link SBase} objects 
509 * define those attributes, those functions now succeed for any object with 
510 * the appropriate level and version.
511 <p>
512 * The exception to this rule is that for {@link InitialAssignment}, {@link EventAssignment}, 
513 * {@link AssignmentRule}, and {@link RateRule} objects, the getId() function and the isSetId() 
514 * functions (though not the setId() or unsetId() functions) would instead 
515 * reference the value of the 'variable' attribute (for the rules and event 
516 * assignments) or the 'symbol' attribute (for initial assignments).  
517 * The {@link AlgebraicRule} fell into this category as well, though because it 
518 * contained neither a 'variable' nor a 'symbol' attribute, getId() would 
519 * always return an empty string, and isSetId() would always return <code>false.</code>
520 * For this reason, four new functions are now provided 
521 * (getIdAttribute(), setIdAttribute(String), 
522 * isSetIdAttribute(), and unsetIdAttribute()) that will always
523 * act on the actual 'id' attribute, regardless of the object's type.  The
524 * new functions should be used instead of the old ones unless the old behavior
525 * is somehow necessary.
526 <p>
527 * Regardless of the level and version of the SBML, these functions allow
528 * client applications to use more generalized code in some situations 
529 * (for instance, when manipulating objects that are all known to have 
530 * identifiers).  If the object in question does not posess an 'id' attribute 
531 * according to the SBML specification for the Level and Version in use,
532 * libSBML will not allow the identifier to be set, nor will it read or 
533 * write 'id' attributes for those objects.
534 <p>
535 * @param sid the string to use as the identifier of this object.
536 <p>
537 * <p>
538 * @return integer value indicating success/failure of the
539 * function.   The possible values
540 * returned by this function are:
541 * <ul>
542 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
543 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
544 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE}
545 *
546 * </ul> <p>
547 * @see #getIdAttribute()
548 * @see #setIdAttribute(String sid)
549 * @see #isSetIdAttribute()
550 * @see #unsetIdAttribute()
551   */ public
552 int setId(String sid) {
553    return libsbmlJNI.SpeciesType_setId(swigCPtr, this, sid);
554  }
555
556  
557/**
558   * Sets the value of the 'name' attribute of this {@link SpeciesType}.
559   <p>
560   * <p>
561 * The string in <code>name</code> is copied.
562 <p>
563 * @param name the new name for the SBML object.
564 <p>
565 * <p>
566 * @return integer value indicating success/failure of the
567 * function.   The possible values
568 * returned by this function are:
569 * <ul>
570 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
571 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
572 *
573 * </ul>
574   */ public
575 int setName(String name) {
576    return libsbmlJNI.SpeciesType_setName(swigCPtr, this, name);
577  }
578
579  
580/**
581   * Unsets the value of the 'name' attribute of this {@link SpeciesType}.
582   <p>
583   * <p>
584 * <p>
585 * In SBML Level&nbsp;3 Version&nbsp;2, the 'id' and 'name' attributes were
586 * moved to {@link SBase} directly, instead of being defined individually for many
587 * (but not all) objects.  Libsbml has for a long time provided functions
588 * defined on {@link SBase} itself to get, set, and unset those attributes, which 
589 * would fail or otherwise return empty strings if executed on any object 
590 * for which those attributes were not defined.  Now that all {@link SBase} objects 
591 * define those attributes, those functions now succeed for any object with 
592 * the appropriate level and version.
593 <p>
594 * The 'name' attribute is
595 * optional and is not intended to be used for cross-referencing purposes
596 * within a model.  Its purpose instead is to provide a human-readable
597 * label for the component.  The data type of 'name' is the type
598 * <code>string</code> defined in XML Schema.  SBML imposes no
599 * restrictions as to the content of 'name' attributes beyond those
600 * restrictions defined by the <code>string</code> type in XML Schema.
601 <p>
602 * The recommended practice for handling 'name' is as follows.  If a
603 * software tool has the capability for displaying the content of 'name'
604 * attributes, it should display this content to the user as a
605 * component's label instead of the component's 'id'.  If the user
606 * interface does not have this capability (e.g., because it cannot
607 * display or use special characters in symbol names), or if the 'name'
608 * attribute is missing on a given component, then the user interface
609 * should display the value of the 'id' attribute instead.  (Script
610 * language interpreters are especially likely to display 'id' instead of
611 * 'name'.)
612 <p>
613 * As a consequence of the above, authors of systems that automatically
614 * generate the values of 'id' attributes should be aware some systems
615 * may display the 'id''s to the user.  Authors therefore may wish to
616 * take some care to have their software create 'id' values that are: (a)
617 * reasonably easy for humans to type and read; and (b) likely to be
618 * meaningful, for example by making the 'id' attribute be an abbreviated
619 * form of the name attribute value.
620 <p>
621 * An additional point worth mentioning is although there are
622 * restrictions on the uniqueness of 'id' values, there are no
623 * restrictions on the uniqueness of 'name' values in a model.  This
624 * allows software applications leeway in assigning component identifiers.
625 <p>
626 * Regardless of the level and version of the SBML, these functions allow
627 * client applications to use more generalized code in some situations 
628 * (for instance, when manipulating objects that are all known to have 
629 * names).  If the object in question does not posess a 'name' attribute 
630 * according to the SBML specification for the Level and Version in use,
631 * libSBML will not allow the name to be set, nor will it read or 
632 * write 'name' attributes for those objects.
633 <p>
634 * <p>
635 * @return integer value indicating success/failure of the
636 * function.   The possible values
637 * returned by this function are:
638 * <ul>
639 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
640 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
641 *
642 * </ul> <p>
643 * @see #getName()
644 * @see #setName(String sid)
645 * @see #isSetName()
646   */ public
647 int unsetName() {
648    return libsbmlJNI.SpeciesType_unsetName(swigCPtr, this);
649  }
650
651  
652/**
653   * Returns the libSBML type code for this SBML object.
654   <p>
655   * <p>
656 * LibSBML attaches an identifying code to every kind of SBML object.  These
657 * are integer constants known as <em>SBML type codes</em>.  The names of all
658 * the codes begin with the characters <code>SBML_</code>.
659 * In the Java language interface for libSBML, the
660 * type codes are defined as static integer constants in the interface class
661 * {@link libsbmlConstants}.    Note that different Level&nbsp;3
662 * package plug-ins may use overlapping type codes; to identify the package
663 * to which a given object belongs, call the 
664 * <code>{@link SBase#getPackageName()}
665 * </code>
666 * method on the object.
667   <p>
668   * @return the SBML type code for this object:
669   * {@link libsbmlConstants#SBML_SPECIES_TYPE SBML_SPECIES_TYPE} (default).
670   <p>
671   * <p>
672 * @warning <span class='warning'>The specific integer values of the possible
673 * type codes may be reused by different libSBML plug-ins for SBML Level&nbsp;3.
674 * packages,  To fully identify the correct code, <strong>it is necessary to
675 * invoke both getTypeCode() and getPackageName()</strong>.</span>
676   <p>
677   * @see #getElementName()
678   * @see #getPackageName()
679   */ public
680 int getTypeCode() {
681    return libsbmlJNI.SpeciesType_getTypeCode(swigCPtr, this);
682  }
683
684  
685/**
686   * Returns the XML element name of this object, which for
687   * {@link SpeciesType}, is always <code>'compartmentType'.</code>
688   <p>
689   * @return the name of this element, i.e., <code>'compartmentType'.</code>
690   */ public
691 String getElementName() {
692    return libsbmlJNI.SpeciesType_getElementName(swigCPtr, this);
693  }
694
695  
696/**
697   * Predicate returning <code>true</code> if
698   * all the required attributes for this {@link SpeciesType} object
699   * have been set.
700   <p>
701   * The required attributes for a {@link SpeciesType} object are:
702   * <ul>
703   * <li> 'id'
704   *
705   * </ul> <p>
706   * @return <code>true</code> if the required attributes have been set, <code>false</code>
707   * otherwise.
708   */ public
709 boolean hasRequiredAttributes() {
710    return libsbmlJNI.SpeciesType_hasRequiredAttributes(swigCPtr, this);
711  }
712
713}