1 //------------------------------------------------------------------------------
2 // <auto-generated />
3 //
4 // This file was automatically generated by SWIG (http://www.swig.org).
5 // Version 4.0.2
6 //
7 // Do not make changes to this file unless you know what you are doing--modify
8 // the SWIG interface file instead.
9 //------------------------------------------------------------------------------
10 
11 namespace libsbml {
12 
13  using System;
14  using System.Runtime.InteropServices;
15 
16 /**
17  * @sbmlpackage{core}
18  *
19 @htmlinclude pkg-marker-core.html A <em>compartment type</em> in SBML Level&nbsp;2.
20  *
21  * SBML Level&nbsp;2 Versions&nbsp;2&ndash;4 provide the <em>compartment
22  * type</em> as a grouping construct that can be used to establish a
23  * relationship between multiple Compartment objects.  A CompartmentType
24  * object only has an identity, and this identity can only be used to
25  * indicate that particular Compartment objects in the model belong to this
26  * type.  This may be useful for conveying a modeling intention, such as
27  * when a model contains many similar compartments, either by their
28  * biological function or the reactions they carry.  Without a compartment
29  * type construct, it would be impossible within SBML itself to indicate
30  * that all of the compartments share an underlying conceptual relationship
31  * because each SBML compartment must be given a unique and separate
32  * identity.  A CompartmentType has no mathematical meaning in
33  * SBML---it has no effect on a model's mathematical interpretation.
34  * Simulators and other numerical analysis software may ignore
35  * CompartmentType definitions and references to them in a model.
36  *
37  * There is no mechanism in SBML Level 2 for representing hierarchies of
38  * compartment types.  One CompartmentType instance cannot be the subtype
39  * of another CompartmentType instance; SBML provides no means of defining
40  * such relationships.
41  *
42  * As with other major structures in SBML, CompartmentType has a mandatory
43  * attribute, 'id', used to give the compartment type an identifier.  The
44  * identifier must be a text %string conforming to the identifer syntax
45  * permitted in SBML.  CompartmentType also has an optional 'name'
46  * attribute, of type @c string.  The 'id' and 'name' must be used
47  * according to the guidelines described in the SBML specification (e.g.,
48  * Section 3.3 in the Level 2 Version 4 specification).
49  *
50  * CompartmentType was introduced in SBML Level 2 Version 2.  It is not
51  * available in SBML Level&nbsp;1 nor in Level&nbsp;3.
52  *
53  * @see Compartment
54  * @see ListOfCompartmentTypes
55  * @see SpeciesType
56  * @see ListOfSpeciesTypes
57  *
58  *
59  *
60  */
61 
62 public class CompartmentType : SBase {
63 	private HandleRef swigCPtr;
64 
CompartmentType(IntPtr cPtr, bool cMemoryOwn)65 	internal CompartmentType(IntPtr cPtr, bool cMemoryOwn) : base(libsbmlPINVOKE.CompartmentType_SWIGUpcast(cPtr), cMemoryOwn)
66 	{
67 		//super(libsbmlPINVOKE.CompartmentTypeUpcast(cPtr), cMemoryOwn);
68 		swigCPtr = new HandleRef(this, cPtr);
69 	}
70 
getCPtr(CompartmentType obj)71 	internal static HandleRef getCPtr(CompartmentType obj)
72 	{
73 		return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
74 	}
75 
getCPtrAndDisown(CompartmentType obj)76 	internal static HandleRef getCPtrAndDisown (CompartmentType obj)
77 	{
78 		HandleRef ptr = new HandleRef(null, IntPtr.Zero);
79 
80 		if (obj != null)
81 		{
82 			ptr             = obj.swigCPtr;
83 			obj.swigCMemOwn = false;
84 		}
85 
86 		return ptr;
87 	}
88 
Dispose(bool disposing)89   protected override void Dispose(bool disposing) {
90     lock(this) {
91       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
92         if (swigCMemOwn) {
93           swigCMemOwn = false;
94           libsbmlPINVOKE.delete_CompartmentType(swigCPtr);
95         }
96         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
97       }
98       base.Dispose(disposing);
99     }
100   }
101 
102 
103 /**
104    * Creates a new CompartmentType object using the given SBML @p level and
105    * @p version values.
106    *
107    * @param level a long integer, the SBML Level to assign to this
108    * CompartmentType.
109    *
110    * @param version a long integer, the SBML Version to assign to this
111    * CompartmentType.
112    *
113    *
114  * @throws SBMLConstructorException
115  * Thrown if the given @p level and @p version combination are invalid
116  * or if this object is incompatible with the given level and version.
117  *
118  *
119    *
120    *
121  * @note Attempting to add an object to an SBMLDocument having a different
122  * combination of SBML Level, Version and XML namespaces than the object
123  * itself will result in an error at the time a caller attempts to make the
124  * addition.  A parent object must have compatible Level, Version and XML
125  * namespaces.  (Strictly speaking, a parent may also have more XML
126  * namespaces than a child, but the reverse is not permitted.)  The
127  * restriction is necessary to ensure that an SBML model has a consistent
128  * overall structure.  This requires callers to manage their objects
129  * carefully, but the benefit is increased flexibility in how models can be
130  * created by permitting callers to create objects bottom-up if desired.  In
131  * situations where objects are not yet attached to parents (e.g.,
132  * SBMLDocument), knowledge of the intented SBML Level and Version help
133  * libSBML determine such things as whether it is valid to assign a
134  * particular value to an attribute.
135  *
136  *
137    */ public
CompartmentType(long level, long version)138  CompartmentType(long level, long version) : this(libsbmlPINVOKE.new_CompartmentType__SWIG_0(level, version), true) {
139     if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
140   }
141 
142 
143 /**
144    * Creates a new CompartmentType object using the given SBMLNamespaces
145    * object @p sbmlns.
146    *
147    *
148  *
149  * The SBMLNamespaces object encapsulates SBML Level/Version/namespaces
150  * information.  It is used to communicate the SBML Level, Version, and (in
151  * Level&nbsp;3) packages used in addition to SBML Level&nbsp;3 Core.  A
152  * common approach to using libSBML's SBMLNamespaces facilities is to create an
153  * SBMLNamespaces object somewhere in a program once, then hand that object
154  * as needed to object constructors that accept SBMLNamespaces as arguments.
155  *
156  *
157    *
158    * It is worth emphasizing that although this constructor does not take an
159    * identifier argument, in SBML Level&nbsp;2 and beyond, the 'id'
160    * (identifier) attribute of a CompartmentType object is required to have a
161    * value.  Thus, callers are cautioned to assign a value after calling this
162    * constructor.  Setting the identifier can be accomplished using the
163    * method setId(@if java String@endif).
164    *
165    * @param sbmlns an SBMLNamespaces object.
166    *
167    *
168  * @throws SBMLConstructorException
169  * Thrown if the given @p sbmlns is inconsistent or incompatible
170  * with this object.
171  *
172  *
173    *
174    *
175  * @note Attempting to add an object to an SBMLDocument having a different
176  * combination of SBML Level, Version and XML namespaces than the object
177  * itself will result in an error at the time a caller attempts to make the
178  * addition.  A parent object must have compatible Level, Version and XML
179  * namespaces.  (Strictly speaking, a parent may also have more XML
180  * namespaces than a child, but the reverse is not permitted.)  The
181  * restriction is necessary to ensure that an SBML model has a consistent
182  * overall structure.  This requires callers to manage their objects
183  * carefully, but the benefit is increased flexibility in how models can be
184  * created by permitting callers to create objects bottom-up if desired.  In
185  * situations where objects are not yet attached to parents (e.g.,
186  * SBMLDocument), knowledge of the intented SBML Level and Version help
187  * libSBML determine such things as whether it is valid to assign a
188  * particular value to an attribute.
189  *
190  *
191    */ public
CompartmentType(SBMLNamespaces sbmlns)192  CompartmentType(SBMLNamespaces sbmlns) : this(libsbmlPINVOKE.new_CompartmentType__SWIG_1(SBMLNamespaces.getCPtr(sbmlns)), true) {
193     if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
194   }
195 
196 
197 /**
198    * Copy constructor; creates a copy of this CompartmentType object.
199    *
200    * @param orig the object to copy.
201    */ public
CompartmentType(CompartmentType orig)202  CompartmentType(CompartmentType orig) : this(libsbmlPINVOKE.new_CompartmentType__SWIG_2(CompartmentType.getCPtr(orig)), true) {
203     if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
204   }
205 
206 
207 /**
208    * Creates and returns a deep copy of this CompartmentType object.
209    *
210    * @return the (deep) copy of this CompartmentType object.
211    */ public new
clone()212  CompartmentType clone() {
213     global::System.IntPtr cPtr = libsbmlPINVOKE.CompartmentType_clone(swigCPtr);
214     CompartmentType ret = (cPtr == global::System.IntPtr.Zero) ? null : new CompartmentType(cPtr, true);
215     return ret;
216   }
217 
218 
219 /**
220    * Returns the value of the 'id' attribute of this CompartmentType.
221    *
222    * @note Because of the inconsistent behavior of this function with
223    * respect to assignments and rules, it is now recommended to
224    * use the getIdAttribute() function instead.
225    *
226    *
227  *
228  * The identifier given by an object's 'id' attribute value
229  * is used to identify the object within the SBML model definition.
230  * Other objects can refer to the component using this identifier.  The
231  * data type of 'id' is always <code>SId</code> or a type derived
232  * from that, such as <code>UnitSId</code>, depending on the object in
233  * question.  All data types are defined as follows:
234  * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'>
235  *   letter ::= 'a'..'z','A'..'Z'
236  *   digit  ::= '0'..'9'
237  *   idChar ::= letter | digit | '_'
238  *   SId    ::= ( letter | '_' ) idChar*
239  * </pre>
240  * The characters <code>(</code> and <code>)</code> are used for grouping,
241  * the character <code>*</code> 'zero or more times', and the character
242  * <code>|</code> indicates logical 'or'.  The equality of SBML identifiers
243  * is determined by an exact character sequence match; i.e., comparisons must
244  * be performed in a case-sensitive manner.  This applies to all uses of
245  * <code>SId</code>, <code>SIdRef</code>, and derived types.
246  *
247  * Users need to be aware of some important API issues that are the result of
248  * the history of SBML and libSBML.  Prior to SBML Level&nbsp;3
249  * Version&nbsp;2, SBML defined 'id' and 'name' attributes on only a subset
250  * of SBML objects.  To simplify the work of programmers, libSBML's API
251  * provided get, set, check, and unset on the SBase object class itself
252  * instead of on individual subobject classes. This made the
253  * get/set/etc. methods uniformly available on all objects in the libSBML
254  * API.  LibSBML simply returned empty strings or otherwise did not act when
255  * the methods were applied to SBML objects that were not defined by the SBML
256  * specification to have 'id' or 'name' attributes.  Additional complications
257  * arose with the rule and assignment objects: InitialAssignment,
258  * EventAssignment, AssignmentRule, and RateRule.  In early versions of SBML,
259  * the rule object hierarchy was different, and in addition, then as now,
260  * they possess different attributes: 'variable' (for the rules and event
261  * assignments), 'symbol' (for initial assignments), or neither (for
262  * algebraic rules).  Prior to SBML Level&nbsp;3 Version&nbsp;2, getId()
263  * would always return an empty string, and isSetId() would always return @c
264  * false for objects of these classes.
265  *
266  * With the addition of 'id' and 'name' attributes on SBase in Level&nbsp;3
267  * Version&nbsp;2, it became necessary to introduce a new way to interact
268  * with the attributes more consistently in libSBML to avoid breaking
269  * backward compatibility in the behavior of the original 'id' methods.  For
270  * this reason, libSBML provides four functions (getIdAttribute(),
271  * setIdAttribute(@if java String@endif), isSetIdAttribute(), and
272  * unsetIdAttribute()) that always act on the actual 'id' attribute inherited
273  * from SBase, regardless of the object's type.  <strong>These new methods
274  * should be used instead of the older getId()/setId()/etc. methods</strong>
275  * unless the old behavior is somehow necessary.  Regardless of the Level and
276  * Version of the SBML, these functions allow client applications to use more
277  * generalized code in some situations (for instance, when manipulating
278  * objects that are all known to have identifiers).  If the object in
279  * question does not posess an 'id' attribute according to the SBML
280  * specification for the Level and Version in use, libSBML will not allow the
281  * identifier to be set, nor will it read or write 'id' attributes for those
282  * objects.
283  *
284  *
285    *
286    * @return the id of this CompartmentType.
287    *
288    * @see getIdAttribute()
289    * @see setIdAttribute(string sid)
290    * @see isSetIdAttribute()
291    * @see unsetIdAttribute()
292    */ public new
getId()293  string getId() {
294     string ret = libsbmlPINVOKE.CompartmentType_getId(swigCPtr);
295     return ret;
296   }
297 
298 
299 /**
300    * Returns the value of the 'name' attribute of this CompartmentType object.
301    *
302    *
303  *
304  *
305  * In SBML Level&nbsp;3 Version&nbsp;2, the 'id' and 'name' attributes were
306  * moved to SBase directly, instead of being defined individually for many
307  * (but not all) objects.  LibSBML has for a long time provided functions
308  * defined on SBase itself to get, set, and unset those attributes, which
309  * would fail or otherwise return empty strings if executed on any object
310  * for which those attributes were not defined.  Now that all SBase objects
311  * define those attributes, those functions now succeed for any object with
312  * the appropriate level and version.
313  *
314  * The 'name' attribute is
315  * optional and is not intended to be used for cross-referencing purposes
316  * within a model.  Its purpose instead is to provide a human-readable
317  * label for the component.  The data type of 'name' is the type
318  * <code>string</code> defined in XML Schema.  SBML imposes no
319  * restrictions as to the content of 'name' attributes beyond those
320  * restrictions defined by the <code>string</code> type in XML Schema.
321  *
322  * The recommended practice for handling 'name' is as follows.  If a
323  * software tool has the capability for displaying the content of 'name'
324  * attributes, it should display this content to the user as a
325  * component's label instead of the component's 'id'.  If the user
326  * interface does not have this capability (e.g., because it cannot
327  * display or use special characters in symbol names), or if the 'name'
328  * attribute is missing on a given component, then the user interface
329  * should display the value of the 'id' attribute instead.  (Script
330  * language interpreters are especially likely to display 'id' instead of
331  * 'name'.)
332  *
333  * As a consequence of the above, authors of systems that automatically
334  * generate the values of 'id' attributes should be aware some systems
335  * may display the 'id''s to the user.  Authors therefore may wish to
336  * take some care to have their software create 'id' values that are: (a)
337  * reasonably easy for humans to type and read; and (b) likely to be
338  * meaningful, for example by making the 'id' attribute be an abbreviated
339  * form of the name attribute value.
340  *
341  * An additional point worth mentioning is although there are
342  * restrictions on the uniqueness of 'id' values, there are no
343  * restrictions on the uniqueness of 'name' values in a model.  This
344  * allows software applications leeway in assigning component identifiers.
345  *
346  * Regardless of the level and version of the SBML, these functions allow
347  * client applications to use more generalized code in some situations
348  * (for instance, when manipulating objects that are all known to have
349  * names).  If the object in question does not posess a 'name' attribute
350  * according to the SBML specification for the Level and Version in use,
351  * libSBML will not allow the name to be set, nor will it read or
352  * write 'name' attributes for those objects.
353  *
354  *
355  *
356  * @return the name of this SBML object, or the empty string if not set or unsettable.
357  *
358  * @see getIdAttribute()
359  * @see isSetName()
360  * @see setName(string sid)
361  * @see unsetName()
362  *
363  *
364    */ public new
getName()365  string getName() {
366     string ret = libsbmlPINVOKE.CompartmentType_getName(swigCPtr);
367     return ret;
368   }
369 
370 
371 /**
372    * Predicate returning @c true if this CompartmentType object's 'id'
373    * attribute is set.
374    *
375    *
376  *
377  *
378  * The identifier given by an object's 'id' attribute value
379  * is used to identify the object within the SBML model definition.
380  * Other objects can refer to the component using this identifier.  The
381  * data type of 'id' is always <code>SId</code> or a type derived
382  * from that, such as <code>UnitSId</code>, depending on the object in
383  * question.  All data types are defined as follows:
384  * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'>
385  *   letter ::= 'a'..'z','A'..'Z'
386  *   digit  ::= '0'..'9'
387  *   idChar ::= letter | digit | '_'
388  *   SId    ::= ( letter | '_' ) idChar*
389  * </pre>
390  * The characters <code>(</code> and <code>)</code> are used for grouping,
391  * the character <code>*</code> 'zero or more times', and the character
392  * <code>|</code> indicates logical 'or'.  The equality of SBML identifiers
393  * is determined by an exact character sequence match; i.e., comparisons must
394  * be performed in a case-sensitive manner.  This applies to all uses of
395  * <code>SId</code>, <code>SIdRef</code>, and derived types.
396  *
397  * Users need to be aware of some important API issues that are the result of
398  * the history of SBML and libSBML.  Prior to SBML Level&nbsp;3
399  * Version&nbsp;2, SBML defined 'id' and 'name' attributes on only a subset
400  * of SBML objects.  To simplify the work of programmers, libSBML's API
401  * provided get, set, check, and unset on the SBase object class itself
402  * instead of on individual subobject classes. This made the
403  * get/set/etc. methods uniformly available on all objects in the libSBML
404  * API.  LibSBML simply returned empty strings or otherwise did not act when
405  * the methods were applied to SBML objects that were not defined by the SBML
406  * specification to have 'id' or 'name' attributes.  Additional complications
407  * arose with the rule and assignment objects: InitialAssignment,
408  * EventAssignment, AssignmentRule, and RateRule.  In early versions of SBML,
409  * the rule object hierarchy was different, and in addition, then as now,
410  * they possess different attributes: 'variable' (for the rules and event
411  * assignments), 'symbol' (for initial assignments), or neither (for
412  * algebraic rules).  Prior to SBML Level&nbsp;3 Version&nbsp;2, getId()
413  * would always return an empty string, and isSetId() would always return @c
414  * false for objects of these classes.
415  *
416  * With the addition of 'id' and 'name' attributes on SBase in Level&nbsp;3
417  * Version&nbsp;2, it became necessary to introduce a new way to interact
418  * with the attributes more consistently in libSBML to avoid breaking
419  * backward compatibility in the behavior of the original 'id' methods.  For
420  * this reason, libSBML provides four functions (getIdAttribute(),
421  * setIdAttribute(@if java String@endif), isSetIdAttribute(), and
422  * unsetIdAttribute()) that always act on the actual 'id' attribute inherited
423  * from SBase, regardless of the object's type.  <strong>These new methods
424  * should be used instead of the older getId()/setId()/etc. methods</strong>
425  * unless the old behavior is somehow necessary.  Regardless of the Level and
426  * Version of the SBML, these functions allow client applications to use more
427  * generalized code in some situations (for instance, when manipulating
428  * objects that are all known to have identifiers).  If the object in
429  * question does not posess an 'id' attribute according to the SBML
430  * specification for the Level and Version in use, libSBML will not allow the
431  * identifier to be set, nor will it read or write 'id' attributes for those
432  * objects.
433  *
434  *
435  *
436  * @return @c true if the 'id' attribute of this SBML object is
437  * set, @c false otherwise.
438  *
439  * @note Because of the inconsistent behavior of this function with
440  * respect to assignments and rules, it is recommended that callers
441  * use isSetIdAttribute() instead.
442  *
443  * @see getIdAttribute()
444  * @see setIdAttribute(string sid)
445  * @see unsetIdAttribute()
446  * @see isSetIdAttribute()
447  *
448  *
449    */ public new
isSetId()450  bool isSetId() {
451     bool ret = libsbmlPINVOKE.CompartmentType_isSetId(swigCPtr);
452     return ret;
453   }
454 
455 
456 /**
457    * Predicate returning @c true if this CompartmentType object's 'name'
458    * attribute is set.
459    *
460    *
461  *
462  *
463  * In SBML Level&nbsp;3 Version&nbsp;2, the 'id' and 'name' attributes were
464  * moved to SBase directly, instead of being defined individually for many
465  * (but not all) objects.  LibSBML has for a long time provided functions
466  * defined on SBase itself to get, set, and unset those attributes, which
467  * would fail or otherwise return empty strings if executed on any object
468  * for which those attributes were not defined.  Now that all SBase objects
469  * define those attributes, those functions now succeed for any object with
470  * the appropriate level and version.
471  *
472  * The 'name' attribute is
473  * optional and is not intended to be used for cross-referencing purposes
474  * within a model.  Its purpose instead is to provide a human-readable
475  * label for the component.  The data type of 'name' is the type
476  * <code>string</code> defined in XML Schema.  SBML imposes no
477  * restrictions as to the content of 'name' attributes beyond those
478  * restrictions defined by the <code>string</code> type in XML Schema.
479  *
480  * The recommended practice for handling 'name' is as follows.  If a
481  * software tool has the capability for displaying the content of 'name'
482  * attributes, it should display this content to the user as a
483  * component's label instead of the component's 'id'.  If the user
484  * interface does not have this capability (e.g., because it cannot
485  * display or use special characters in symbol names), or if the 'name'
486  * attribute is missing on a given component, then the user interface
487  * should display the value of the 'id' attribute instead.  (Script
488  * language interpreters are especially likely to display 'id' instead of
489  * 'name'.)
490  *
491  * As a consequence of the above, authors of systems that automatically
492  * generate the values of 'id' attributes should be aware some systems
493  * may display the 'id''s to the user.  Authors therefore may wish to
494  * take some care to have their software create 'id' values that are: (a)
495  * reasonably easy for humans to type and read; and (b) likely to be
496  * meaningful, for example by making the 'id' attribute be an abbreviated
497  * form of the name attribute value.
498  *
499  * An additional point worth mentioning is although there are
500  * restrictions on the uniqueness of 'id' values, there are no
501  * restrictions on the uniqueness of 'name' values in a model.  This
502  * allows software applications leeway in assigning component identifiers.
503  *
504  * Regardless of the level and version of the SBML, these functions allow
505  * client applications to use more generalized code in some situations
506  * (for instance, when manipulating objects that are all known to have
507  * names).  If the object in question does not posess a 'name' attribute
508  * according to the SBML specification for the Level and Version in use,
509  * libSBML will not allow the name to be set, nor will it read or
510  * write 'name' attributes for those objects.
511  *
512  *
513  *
514  * @return @c true if the 'name' attribute of this SBML object is
515  * set, @c false otherwise.
516  *
517  * @see getName()
518  * @see setName(string sid)
519  * @see unsetName()
520  *
521  *
522    */ public new
isSetName()523  bool isSetName() {
524     bool ret = libsbmlPINVOKE.CompartmentType_isSetName(swigCPtr);
525     return ret;
526   }
527 
528 
529 /**
530    * Sets the value of the 'id' attribute of this CompartmentType.
531    *
532    *
533  *
534  * The string @p sid is copied.
535  *
536  *
537  *
538  * The identifier given by an object's 'id' attribute value
539  * is used to identify the object within the SBML model definition.
540  * Other objects can refer to the component using this identifier.  The
541  * data type of 'id' is always <code>SId</code> or a type derived
542  * from that, such as <code>UnitSId</code>, depending on the object in
543  * question.  All data types are defined as follows:
544  * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'>
545  *   letter ::= 'a'..'z','A'..'Z'
546  *   digit  ::= '0'..'9'
547  *   idChar ::= letter | digit | '_'
548  *   SId    ::= ( letter | '_' ) idChar*
549  * </pre>
550  * The characters <code>(</code> and <code>)</code> are used for grouping,
551  * the character <code>*</code> 'zero or more times', and the character
552  * <code>|</code> indicates logical 'or'.  The equality of SBML identifiers
553  * is determined by an exact character sequence match; i.e., comparisons must
554  * be performed in a case-sensitive manner.  This applies to all uses of
555  * <code>SId</code>, <code>SIdRef</code>, and derived types.
556  *
557  * Users need to be aware of some important API issues that are the result of
558  * the history of SBML and libSBML.  Prior to SBML Level&nbsp;3
559  * Version&nbsp;2, SBML defined 'id' and 'name' attributes on only a subset
560  * of SBML objects.  To simplify the work of programmers, libSBML's API
561  * provided get, set, check, and unset on the SBase object class itself
562  * instead of on individual subobject classes. This made the
563  * get/set/etc. methods uniformly available on all objects in the libSBML
564  * API.  LibSBML simply returned empty strings or otherwise did not act when
565  * the methods were applied to SBML objects that were not defined by the SBML
566  * specification to have 'id' or 'name' attributes.  Additional complications
567  * arose with the rule and assignment objects: InitialAssignment,
568  * EventAssignment, AssignmentRule, and RateRule.  In early versions of SBML,
569  * the rule object hierarchy was different, and in addition, then as now,
570  * they possess different attributes: 'variable' (for the rules and event
571  * assignments), 'symbol' (for initial assignments), or neither (for
572  * algebraic rules).  Prior to SBML Level&nbsp;3 Version&nbsp;2, getId()
573  * would always return an empty string, and isSetId() would always return @c
574  * false for objects of these classes.
575  *
576  * With the addition of 'id' and 'name' attributes on SBase in Level&nbsp;3
577  * Version&nbsp;2, it became necessary to introduce a new way to interact
578  * with the attributes more consistently in libSBML to avoid breaking
579  * backward compatibility in the behavior of the original 'id' methods.  For
580  * this reason, libSBML provides four functions (getIdAttribute(),
581  * setIdAttribute(@if java String@endif), isSetIdAttribute(), and
582  * unsetIdAttribute()) that always act on the actual 'id' attribute inherited
583  * from SBase, regardless of the object's type.  <strong>These new methods
584  * should be used instead of the older getId()/setId()/etc. methods</strong>
585  * unless the old behavior is somehow necessary.  Regardless of the Level and
586  * Version of the SBML, these functions allow client applications to use more
587  * generalized code in some situations (for instance, when manipulating
588  * objects that are all known to have identifiers).  If the object in
589  * question does not posess an 'id' attribute according to the SBML
590  * specification for the Level and Version in use, libSBML will not allow the
591  * identifier to be set, nor will it read or write 'id' attributes for those
592  * objects.
593  *
594  *
595  *
596  * @param sid the string to use as the identifier of this object.
597  *
598  *
599  * @return integer value indicating success/failure of the
600  * function.  @if clike The value is drawn from the
601  * enumeration #OperationReturnValues_t. @endif The possible values
602  * returned by this function are:
603  * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink
604  * @li @link libsbml#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE@endlink
605  * @li @link libsbml#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE@endlink
606  *
607  * @see getIdAttribute()
608  * @see setIdAttribute(string sid)
609  * @see isSetIdAttribute()
610  * @see unsetIdAttribute()
611  *
612  *
613    */ public new
setId(string sid)614  int setId(string sid) {
615     int ret = libsbmlPINVOKE.CompartmentType_setId(swigCPtr, sid);
616     return ret;
617   }
618 
619 
620 /**
621    * Sets the value of the 'name' attribute of this CompartmentType.
622    *
623    *
624  *
625  *
626  * The string in @p name is copied.
627  *
628  * @param name the new name for the SBML object.
629  *
630  *
631  * @return integer value indicating success/failure of the
632  * function.  @if clike The value is drawn from the
633  * enumeration #OperationReturnValues_t. @endif The possible values
634  * returned by this function are:
635  * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink
636  * @li @link libsbml#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE@endlink
637  *
638  *
639    */ public new
setName(string name)640  int setName(string name) {
641     int ret = libsbmlPINVOKE.CompartmentType_setName(swigCPtr, name);
642     return ret;
643   }
644 
645 
646 /**
647    * Unsets the value of the 'name' attribute of this CompartmentType object.
648    *
649    *
650  *
651  *
652  * In SBML Level&nbsp;3 Version&nbsp;2, the 'id' and 'name' attributes were
653  * moved to SBase directly, instead of being defined individually for many
654  * (but not all) objects.  LibSBML has for a long time provided functions
655  * defined on SBase itself to get, set, and unset those attributes, which
656  * would fail or otherwise return empty strings if executed on any object
657  * for which those attributes were not defined.  Now that all SBase objects
658  * define those attributes, those functions now succeed for any object with
659  * the appropriate level and version.
660  *
661  * The 'name' attribute is
662  * optional and is not intended to be used for cross-referencing purposes
663  * within a model.  Its purpose instead is to provide a human-readable
664  * label for the component.  The data type of 'name' is the type
665  * <code>string</code> defined in XML Schema.  SBML imposes no
666  * restrictions as to the content of 'name' attributes beyond those
667  * restrictions defined by the <code>string</code> type in XML Schema.
668  *
669  * The recommended practice for handling 'name' is as follows.  If a
670  * software tool has the capability for displaying the content of 'name'
671  * attributes, it should display this content to the user as a
672  * component's label instead of the component's 'id'.  If the user
673  * interface does not have this capability (e.g., because it cannot
674  * display or use special characters in symbol names), or if the 'name'
675  * attribute is missing on a given component, then the user interface
676  * should display the value of the 'id' attribute instead.  (Script
677  * language interpreters are especially likely to display 'id' instead of
678  * 'name'.)
679  *
680  * As a consequence of the above, authors of systems that automatically
681  * generate the values of 'id' attributes should be aware some systems
682  * may display the 'id''s to the user.  Authors therefore may wish to
683  * take some care to have their software create 'id' values that are: (a)
684  * reasonably easy for humans to type and read; and (b) likely to be
685  * meaningful, for example by making the 'id' attribute be an abbreviated
686  * form of the name attribute value.
687  *
688  * An additional point worth mentioning is although there are
689  * restrictions on the uniqueness of 'id' values, there are no
690  * restrictions on the uniqueness of 'name' values in a model.  This
691  * allows software applications leeway in assigning component identifiers.
692  *
693  * Regardless of the level and version of the SBML, these functions allow
694  * client applications to use more generalized code in some situations
695  * (for instance, when manipulating objects that are all known to have
696  * names).  If the object in question does not posess a 'name' attribute
697  * according to the SBML specification for the Level and Version in use,
698  * libSBML will not allow the name to be set, nor will it read or
699  * write 'name' attributes for those objects.
700  *
701  *
702  *
703  *
704  * @return integer value indicating success/failure of the
705  * function.  @if clike The value is drawn from the
706  * enumeration #OperationReturnValues_t. @endif The possible values
707  * returned by this function are:
708  * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink
709  * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink
710  *
711  * @see getName()
712  * @see setName(string sid)
713  * @see isSetName()
714  *
715  *
716    */ public new
unsetName()717  int unsetName() {
718     int ret = libsbmlPINVOKE.CompartmentType_unsetName(swigCPtr);
719     return ret;
720   }
721 
722 
723 /**
724    * Returns the libSBML type code for this SBML object.
725    *
726    *
727  *
728  * LibSBML attaches an identifying code to every kind of SBML object.  These
729  * are integer constants known as <em>SBML type codes</em>.  The names of all
730  * the codes begin with the characters <code>SBML_</code>.
731  * @if clike The set of possible type codes for core elements is defined in
732  * the enumeration #SBMLTypeCode_t, and in addition, libSBML plug-ins for
733  * SBML Level&nbsp;3 packages define their own extra enumerations of type
734  * codes (e.g., #SBMLLayoutTypeCode_t for the Level&nbsp;3 Layout
735  * package).@endif@if java In the Java language interface for libSBML, the
736  * type codes are defined as static integer constants in the interface class
737  * {@link libsbmlConstants}.  @endif@if python In the Python language
738  * interface for libSBML, the type codes are defined as static integer
739  * constants in the interface class @link libsbml@endlink.@endif@if csharp In
740  * the C# language interface for libSBML, the type codes are defined as
741  * static integer constants in the interface class
742  * @link libsbmlcs.libsbml@endlink.@endif  Note that different Level&nbsp;3
743  * package plug-ins may use overlapping type codes; to identify the package
744  * to which a given object belongs, call the
745  * <code>@if conly SBase_getPackageName()
746  * @else SBase::getPackageName()
747  * @endif</code>
748  * method on the object.
749  *
750  * The exception to this is lists:  all SBML-style list elements have the type
751  * @link libsbml#SBML_LIST_OF SBML_LIST_OF@endlink, regardless of what package they
752  * are from.
753  *
754  *
755    *
756    * @return the SBML type code for this object:
757    * @link libsbml#SBML_COMPARTMENT_TYPE SBML_COMPARTMENT_TYPE@endlink (default).
758    *
759    *
760  * @warning <span class='warning'>The specific integer values of the possible
761  * type codes may be reused by different libSBML plug-ins for SBML Level&nbsp;3.
762  * packages,  To fully identify the correct code, <strong>it is necessary to
763  * invoke both getPackageName() and getTypeCode()</strong> (or
764  * ListOf::getItemTypeCode()).</span>
765  *
766  *
767    *
768    * @see getElementName()
769    * @see getPackageName()
770    */ public new
getTypeCode()771  int getTypeCode() {
772     int ret = libsbmlPINVOKE.CompartmentType_getTypeCode(swigCPtr);
773     return ret;
774   }
775 
776 
777 /**
778    * Returns the XML element name of this object
779    *
780    * For CompartmentType, the element name is always @c 'compartmentType'.
781    *
782    * @return the name of this element.
783    *
784    * @see getTypeCode()
785    * @see getPackageName()
786    */ public new
getElementName()787  string getElementName() {
788     string ret = libsbmlPINVOKE.CompartmentType_getElementName(swigCPtr);
789     return ret;
790   }
791 
792 
793 /**
794    * Predicate returning @c true if all the required attributes for this
795    * CompartmentType object have been set.
796    *
797    * The required attributes for a CompartmentType object are:
798    * @li 'id'
799    *
800    * @return @c true if the required attributes have been set, @c false
801    * otherwise.
802    */ public new
hasRequiredAttributes()803  bool hasRequiredAttributes() {
804     bool ret = libsbmlPINVOKE.CompartmentType_hasRequiredAttributes(swigCPtr);
805     return ret;
806   }
807 
808 }
809 
810 }
811