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 Abstract Syntax Tree (AST) representation of a 20 * mathematical expression. 21 * 22 * @htmlinclude not-sbml-warning.html 23 * 24 * Abstract Syntax Trees (ASTs) are a simple kind of data structure used in 25 * libSBML for storing mathematical expressions. The ASTNode is the 26 * cornerstone of libSBML's AST representation. An AST 'node' represents the 27 * most basic, indivisible part of a mathematical formula and come in many 28 * types. For instance, there are node types to represent numbers (with 29 * subtypes to distinguish integer, real, and rational numbers), names 30 * (e.g., constants or variables), simple mathematical operators, logical 31 * or relational operators and functions. LibSBML ASTs provide a canonical, 32 * in-memory representation for all mathematical formulas regardless of 33 * their original format (which might be MathML or might be text strings). 34 * 35 * 36 * 37 * An AST @em node in libSBML is a recursive tree structure; each node has a 38 * type, a pointer to a value, and a list of children nodes. Each ASTNode 39 * node may have none, one, two, or more children depending on its type. 40 * There are node types to represent numbers (with subtypes to distinguish 41 * integer, real, and rational numbers), names (e.g., constants or 42 * variables), simple mathematical operators, logical or relational operators 43 * and functions. The following diagram illustrates an example of how the 44 * mathematical expression <code>'1 + 2'</code> is represented as an AST with 45 * one @em plus node having two @em integer children nodes for the numbers 46 * <code>1</code> and <code>2</code>. The figure also shows the 47 * corresponding MathML representation: 48 * 49 * @htmlinclude astnode-illustration.html 50 * 51 * The following are other noteworthy points about the AST representation 52 * in libSBML: 53 54 * @li A numerical value represented in MathML as a real number with an 55 * exponent is preserved as such in the AST node representation, even if the 56 * number could be stored in a @c double data type. This is done so that 57 * when an SBML model is read in and then written out again, the amount of 58 * change introduced by libSBML to the SBML during the round-trip activity is 59 * minimized. 60 * 61 * @li Rational numbers are represented in an AST node using separate 62 * numerator and denominator values. These can be retrieved using the 63 * methods ASTNode::getNumerator() and ASTNode::getDenominator(). 64 * 65 * @li The children of an ASTNode are other ASTNode objects. The list of 66 * children is empty for nodes that are leaf elements, such as numbers. 67 * For nodes that are actually roots of expression subtrees, the list of 68 * children points to the parsed objects that make up the rest of the 69 * expression. 70 * 71 * For many applications, the details of ASTs are irrelevant because libSBML 72 * provides text-string based translation functions such as 73 * @sbmlfunction{formulaToL3String, ASTNode} and 74 * @sbmlfunction{parseL3Formula, String}. If you find the complexity 75 * of using the AST representation of expressions too high for your purposes, 76 * perhaps the string-based functions will be more suitable. 77 * 78 * 79 * 80 * @if clike <h3><a class='anchor' name='ASTNodeType_t'> 81 * ASTNodeType_t</a></h3> @else <h3><a class='anchor' 82 * name='ASTNodeType_t'>The set of possible %ASTNode types</a></h3> @endif 83 * 84 * 85 * 86 * Every ASTNode has an associated type code to indicate whether, for 87 * example, it holds a number or stands for an arithmetic operator. 88 * @if clike The type is recorded as a value drawn from the enumeration 89 * #ASTNodeType_t.@endif 90 * @if java The type is recorded as a value drawn from a 91 * set of static integer constants defined in the class @link 92 * libsbml.libsbml@endlink. Their names begin with the characters @c AST_.@endif 93 * @if python The type is recorded as a value drawn from a 94 * set of static integer constants defined in the class @link 95 * libsbml@endlink. Their names begin with the characters @c AST_.@endif 96 * @if csharp The type is recorded as a value drawn from a 97 * set of static integer constants defined in the class @link 98 * libsbml@endlink. Their names begin with the characters @c AST_.@endif 99 * The list of possible types is quite long, because it covers all the 100 * mathematical functions that are permitted in SBML. The values are shown 101 * in the following table: 102 * 103 * @htmlinclude astnode-types.html 104 * 105 * The types have the following meanings: 106 * 107 * @li If the node is basic mathematical operator (e.g., @c '+'), then the 108 * node's type will be @link libsbml#AST_PLUS AST_PLUS@endlink, 109 * @link libsbml#AST_MINUS AST_MINUS@endlink, 110 * @link libsbml#AST_TIMES AST_TIMES@endlink, 111 * @link libsbml#AST_DIVIDE AST_DIVIDE@endlink, or 112 * @link libsbml#AST_POWER AST_POWER@endlink, as appropriate. 113 * 114 * @li If the node is a predefined function or operator from %SBML 115 * Level 1 (in the string-based formula syntax used in Level 1) or 116 * %SBML Level 2 and 3 (in the subset of MathML used in SBML 117 * Levels 2 and 3), then the node's type 118 * will be either <code style='margin-right: 0'>AST_FUNCTION_</code><span 119 * class='placeholder-nospace'>X</span>, <code style='margin-right: 0'>AST_LOGICAL_</code><span 120 * class='placeholder-nospace'>X</span>, or <code style='margin-right: 0'>AST_RELATIONAL_</code><span 121 * class='placeholder-nospace'>X</span>, as appropriate. (Examples: 122 * @link libsbml#AST_FUNCTION_LOG AST_FUNCTION_LOG@endlink, 123 * @link libsbml#AST_RELATIONAL_LEQ AST_RELATIONAL_LEQ@endlink.) 124 * 125 * @li If the node refers to a user-defined function, the node's type will 126 * be @link libsbml#AST_FUNCTION AST_FUNCTION@endlink (because it holds the 127 * name of the function). 128 * 129 * @li If the node is a lambda expression, its type will be 130 * @link libsbml#AST_LAMBDA AST_LAMBDA@endlink. 131 * 132 * @li If the node is a predefined constant (@c 'ExponentialE', @c 'Pi', 133 * @c 'True' or @c 'False'), then the node's type will be 134 * @link libsbml#AST_CONSTANT_E AST_CONSTANT_E@endlink, 135 * @link libsbml#AST_CONSTANT_PI AST_CONSTANT_PI@endlink, 136 * @link libsbml#AST_CONSTANT_TRUE AST_CONSTANT_TRUE@endlink, or 137 * @link libsbml#AST_CONSTANT_FALSE AST_CONSTANT_FALSE@endlink. 138 * 139 * @li (Levels 2 and 3 only) If the node is the special MathML 140 * csymbol @c time, the value of the node will be 141 * @link libsbml#AST_NAME_TIME AST_NAME_TIME@endlink. (Note, however, that the 142 * MathML csymbol @c delay is translated into a node of type 143 * @link libsbml#AST_FUNCTION_DELAY AST_FUNCTION_DELAY@endlink. The difference is due to 144 * the fact that @c time is a single variable, whereas @c delay is actually a 145 * function taking arguments.) 146 * 147 * @li (Level 3 only) If the node is the special MathML csymbol 148 * @c avogadro, the value of the node will be 149 * @link libsbml#AST_NAME_AVOGADRO AST_NAME_AVOGADRO@endlink. 150 * 151 * @li (Level 3 Version 2+ only) If the node is the special MathML 152 * csymbol @c rateOf, the value of the node will be 153 * @link libsbml#AST_FUNCTION_RATE_OF AST_FUNCTION_RATE_OF@endlink. 154 * 155 * @li (Level 3 Version 2+ only) If the node is a MathML 156 * operator that originates in a package, it is included in the 157 * ASTNodeType_t list, but may not be legally used in an SBML document 158 * that does not include that package. This includes the node types from 159 * the 'Distributions' package (@link libsbml#AST_DISTRIB_FUNCTION_NORMAL AST_DISTRIB_FUNCTION_NORMAL@endlink, @link libsbml#AST_DISTRIB_FUNCTION_UNIFORM AST_DISTRIB_FUNCTION_UNIFORM@endlink, 160 * etc.), and elements from MathML that were not included in core. 161 * 162 * @li If the node contains a numerical value, its type will be 163 * @link libsbml#AST_INTEGER AST_INTEGER@endlink, 164 * @link libsbml#AST_REAL AST_REAL@endlink, 165 * @link libsbml#AST_REAL_E AST_REAL_E@endlink, or 166 * @link libsbml#AST_RATIONAL AST_RATIONAL@endlink, as appropriate. 167 * 168 * 169 * 170 * <h3><a class='anchor' name='math-convert'>Converting between ASTs and text strings</a></h3> 171 * 172 * The text-string form of mathematical formulas produced by 173 * @sbmlfunction{formulaToString,ASTNode_t} and @sbmlfunction{formulaToL3String,ASTNode_t}, 174 * and read by @sbmlfunction{parseFormula,String} and @sbmlfunction{parseL3Formula,String} 175 * are in a simple C-inspired infix notation. A 176 * formula in this text-string form can be handed to a program that 177 * understands SBML mathematical expressions, or used as part 178 * of a translation system. The libSBML distribution comes with an example 179 * program in the @c 'examples' subdirectory called @c translateMath that 180 * implements an interactive command-line demonstration of translating 181 * infix formulas into MathML and vice-versa. 182 * 183 * The formula strings may contain operators, function calls, symbols, and 184 * white space characters. The allowable white space characters are tab 185 * and space. The following are illustrative examples of formulas 186 * expressed in the syntax: 187 * 188 * @verbatim 189 0.10 * k4^2 190 @endverbatim 191 * @verbatim 192 (vm * s1)/(km + s1) 193 @endverbatim 194 * 195 * The following table shows the precedence rules in this syntax. In the 196 * Class column, @em operand implies the construct is an operand, @em 197 * prefix implies the operation is applied to the following arguments, @em 198 * unary implies there is one argument, and @em binary implies there are 199 * two arguments. The values in the Precedence column show how the order 200 * of different types of operation are determined. For example, the 201 * expression <em>a * b + c</em> is evaluated as <em>(a * b) + c</em> 202 * because the <code>*</code> operator has higher precedence. The 203 * Associates column shows how the order of similar precedence operations 204 * is determined; for example, <em>a - b + c</em> is evaluated as <em>(a - 205 * b) + c</em> because the <code>+</code> and <code>-</code> operators are 206 * left-associative. The precedence and associativity rules are taken from 207 * the C programming language, except for the symbol <code>^</code>, which 208 * is used in C for a different purpose. (Exponentiation can be invoked 209 * using either <code>^</code> or the function @c power.) 210 * 211 * @htmlinclude math-precedence-table.html 212 * 213 * A program parsing a formula in an SBML model should assume that names 214 * appearing in the formula are the identifiers of Species, Parameter, 215 * Compartment, FunctionDefinition, Reaction (in SBML Levels 2 216 * and 3), or SpeciesReference (in SBML Level 3 only) objects 217 * defined in a model. When a function call is involved, the syntax 218 * consists of a function identifier, followed by optional white space, 219 * followed by an opening parenthesis, followed by a sequence of zero or 220 * more arguments separated by commas (with each comma optionally preceded 221 * and/or followed by zero or more white space characters), followed by a 222 * closing parenthesis. There is an almost one-to-one mapping between the 223 * list of predefined functions available, and those defined in MathML. 224 * All of the MathML functions are recognized; this set is larger than the 225 * functions defined in SBML Level 1. In the subset of functions that 226 * overlap between MathML and SBML Level 1, there exist a few 227 * differences. The following table summarizes the differences between the 228 * predefined functions in SBML Level 1 and the MathML equivalents in 229 * SBML Levels 2 and 3: 230 * 231 * @htmlinclude math-functions.html 232 * 233 * 234 * @note 235 * Callers using SBML Level 3 are encouraged to use the facilities 236 * provided by libSBML's newer and more powerful Level 3-oriented 237 * formula parser and formatter. The entry points to this second system are 238 * @sbmlfunction{parseL3Formula, String} and 239 * @sbmlfunction{formulaToL3String, ASTNode}. The Level 1-oriented 240 * system (i.e., what is provided by @sbmlfunction{formulaToString, String} 241 * and @sbmlfunction{parseFormula, ASTNode}) is provided 242 * untouched for backwards compatibility. 243 * 244 * 245 * 246 * @see @sbmlfunction{parseL3Formula, String} 247 * @see @sbmlfunction{parseL3FormulaWithSettings, String\, L3ParserSettings} 248 * @see @sbmlfunction{parseL3FormulaWithModel, String\, Model} 249 * @see @sbmlfunction{parseFormula, String} 250 * @see @sbmlfunction{formulaToL3StringWithSettings, ASTNode\, L3ParserSettings} 251 * @see @sbmlfunction{formulaToL3String, ASTNode} 252 * @see @sbmlfunction{formulaToString, ASTNode} 253 * @see @sbmlfunction{getDefaultL3ParserSettings,} 254 */ 255 256 public class ASTNode : global::System.IDisposable { 257 private HandleRef swigCPtr; 258 protected bool swigCMemOwn; 259 ASTNode(IntPtr cPtr, bool cMemoryOwn)260 internal ASTNode(IntPtr cPtr, bool cMemoryOwn) 261 { 262 swigCMemOwn = cMemoryOwn; 263 swigCPtr = new HandleRef(this, cPtr); 264 } 265 getCPtr(ASTNode obj)266 internal static HandleRef getCPtr(ASTNode obj) 267 { 268 return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; 269 } 270 getCPtrAndDisown(ASTNode obj)271 internal static HandleRef getCPtrAndDisown (ASTNode obj) 272 { 273 HandleRef ptr = new HandleRef(null, IntPtr.Zero); 274 275 if (obj != null) 276 { 277 ptr = obj.swigCPtr; 278 obj.swigCMemOwn = false; 279 } 280 281 return ptr; 282 } 283 ~ASTNode()284 ~ASTNode() { 285 Dispose(false); 286 } 287 Dispose()288 public void Dispose() { 289 Dispose(true); 290 global::System.GC.SuppressFinalize(this); 291 } 292 Dispose(bool disposing)293 protected virtual void Dispose(bool disposing) { 294 lock(this) { 295 if (swigCPtr.Handle != global::System.IntPtr.Zero) { 296 if (swigCMemOwn) { 297 swigCMemOwn = false; 298 libsbmlPINVOKE.delete_ASTNode(swigCPtr); 299 } 300 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); 301 } 302 } 303 } 304 operator ==(ASTNode lhs, ASTNode rhs)305 public static bool operator==(ASTNode lhs, ASTNode rhs) 306 { 307 if((Object)lhs == (Object)rhs) 308 { 309 return true; 310 } 311 312 if( ((Object)lhs == null) || ((Object)rhs == null) ) 313 { 314 return false; 315 } 316 317 return (getCPtr(lhs).Handle.ToString() == getCPtr(rhs).Handle.ToString()); 318 } 319 operator !=(ASTNode lhs, ASTNode rhs)320 public static bool operator!=(ASTNode lhs, ASTNode rhs) 321 { 322 return !(lhs == rhs); 323 } 324 Equals(Object sb)325 public override bool Equals(Object sb) 326 { 327 if ( ! (sb is ASTNode) ) 328 { 329 return false; 330 } 331 332 return this == (ASTNode)sb; 333 } 334 GetHashCode()335 public override int GetHashCode() 336 { 337 return swigCPtr.Handle.ToInt32(); 338 } 339 340 341 /** 342 * Creates and returns a new ASTNode. 343 * 344 * Unless the argument @p type is given, the returned node will by default 345 * have a type of @link libsbml#AST_UNKNOWN AST_UNKNOWN@endlink. If the type 346 * isn't supplied when caling this constructor, the caller should set the 347 * node type to something else as soon as possible using @if clike 348 * setType()@else ASTNode::setType(int)@endif. 349 * 350 * @param type an optional @if clike #ASTNodeType_t@else type@endif 351 * code indicating the type of node to create. 352 * 353 * @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif 354 */ public ASTNode(int type)355 ASTNode(int type) : this(libsbmlPINVOKE.new_ASTNode__SWIG_0(type), true) { 356 } 357 358 359 /** 360 * Creates and returns a new ASTNode. 361 * 362 * Unless the argument @p type is given, the returned node will by default 363 * have a type of @link libsbml#AST_UNKNOWN AST_UNKNOWN@endlink. If the type 364 * isn't supplied when caling this constructor, the caller should set the 365 * node type to something else as soon as possible using @if clike 366 * setType()@else ASTNode::setType(int)@endif. 367 * 368 * @param type an optional @if clike #ASTNodeType_t@else type@endif 369 * code indicating the type of node to create. 370 * 371 * @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif 372 */ public ASTNode()373 ASTNode() : this(libsbmlPINVOKE.new_ASTNode__SWIG_1(), true) { 374 } 375 376 377 /** 378 * Copy constructor; creates a deep copy of the given ASTNode. 379 * 380 * @param orig the ASTNode to be copied. 381 */ public ASTNode(ASTNode orig)382 ASTNode(ASTNode orig) : this(libsbmlPINVOKE.new_ASTNode__SWIG_2(ASTNode.getCPtr(orig)), true) { 383 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 384 } 385 386 387 /** 388 * Frees the name of this ASTNode and sets it to @c null. 389 * 390 * This operation is only applicable to ASTNode objects corresponding to 391 * operators, numbers, or @link libsbml#AST_UNKNOWN AST_UNKNOWN@endlink. This 392 * method has no effect on other types of nodes. 393 * 394 * 395 * @return integer value indicating success/failure of the 396 * function. @if clike The value is drawn from the 397 * enumeration #OperationReturnValues_t. @endif The possible values 398 * returned by this function are: 399 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 400 * @li @link libsbml#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE@endlink 401 */ public freeName()402 int freeName() { 403 int ret = libsbmlPINVOKE.ASTNode_freeName(swigCPtr); 404 return ret; 405 } 406 407 408 /** 409 * Converts this ASTNode to a canonical form and returns @c true if 410 * successful, @c false otherwise. 411 * 412 * The rules determining the canonical form conversion are as follows: 413 * 414 * @li If the node type is @link libsbml#AST_NAME AST_NAME@endlink 415 * and the node name matches @c 'ExponentialE', @c 'Pi', @c 'True' or @c 416 * 'False' the node type is converted to the corresponding 417 * <code>AST_CONSTANT_</code><em><span class='placeholder'>X</span></em> type. 418 * 419 * @li If the node type is an @link libsbml#AST_FUNCTION AST_FUNCTION@endlink 420 * and the node name matches an SBML (MathML) function name, logical operator name, 421 * or relational operator name, the node is converted to the corresponding 422 * <code>AST_FUNCTION_</code><em><span class='placeholder'>X</span></em> or 423 * <code>AST_LOGICAL_</code><em><span class='placeholder'>X</span></em> type. 424 * 425 * SBML Level 1 function names are searched first; thus, for 426 * example, canonicalizing @c log will result in a node type of @link libsbml#AST_FUNCTION_LN AST_FUNCTION_LN@endlink. (See the SBML 427 * Level 1 Version 2 Specification, Appendix C.) 428 * 429 * Sometimes, canonicalization of a node results in a structural 430 * conversion of the node as a result of adding a child. For example, a 431 * node with the SBML Level 1 function name @c sqr and a single 432 * child node (the argument) will be transformed to a node of type 433 * @link libsbml#AST_FUNCTION_POWER AST_FUNCTION_POWER@endlink with 434 * two children. The first child will remain unchanged, but the second 435 * child will be an ASTNode of type @link libsbml#AST_INTEGER AST_INTEGER@endlink and a value of 2. The function names that result 436 * in structural changes are: @c log10, @c sqr, and @c sqrt. 437 */ public canonicalize()438 bool canonicalize() { 439 bool ret = libsbmlPINVOKE.ASTNode_canonicalize(swigCPtr); 440 return ret; 441 } 442 443 444 /** 445 * Adds the given node as a child of this ASTNode. 446 * 447 * Child nodes are added in-order, from left to right. 448 * 449 * @param disownedChild the ASTNode instance to add. 450 * @param inRead @c false by default; may be set to @c true when 451 * reading XML where there may be a lambda function with no 452 * bvar arguments. 453 * 454 * 455 * @return integer value indicating success/failure of the 456 * function. @if clike The value is drawn from the 457 * enumeration #OperationReturnValues_t. @endif The possible values 458 * returned by this function are: 459 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 460 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 461 * 462 * 463 * @warning Explicitly adding, removing or replacing children of an 464 * @if conly ASTNode_t structure@else ASTNode object@endif may change the 465 * structure of the mathematical formula it represents, and may even render 466 * the representation invalid. Callers need to be careful to use this method 467 * in the context of other operations to create complete and correct 468 * formulas. The method @if conly ASTNode_isWellFormedASTNode()@else 469 * ASTNode::isWellFormedASTNode()@endif may also be useful for checking the 470 * results of node modifications. 471 * 472 * 473 * @see prependChild(ASTNode disownedChild) 474 * @see replaceChild(unsigned int n, ASTNode disownedChild, bool delreplaced) 475 * @see insertChild(unsigned int n, ASTNode disownedChild) 476 * @see removeChild(unsigned int n) 477 * @see isWellFormedASTNode() 478 */ public addChild(ASTNode disownedChild, bool inRead)479 int addChild(ASTNode disownedChild, bool inRead) { 480 int ret = libsbmlPINVOKE.ASTNode_addChild__SWIG_0(swigCPtr, ASTNode.getCPtrAndDisown(disownedChild), inRead); 481 return ret; 482 } 483 484 485 /** 486 * Adds the given node as a child of this ASTNode. 487 * 488 * Child nodes are added in-order, from left to right. 489 * 490 * @param disownedChild the ASTNode instance to add. 491 * @param inRead @c false by default; may be set to @c true when 492 * reading XML where there may be a lambda function with no 493 * bvar arguments. 494 * 495 * 496 * @return integer value indicating success/failure of the 497 * function. @if clike The value is drawn from the 498 * enumeration #OperationReturnValues_t. @endif The possible values 499 * returned by this function are: 500 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 501 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 502 * 503 * 504 * @warning Explicitly adding, removing or replacing children of an 505 * @if conly ASTNode_t structure@else ASTNode object@endif may change the 506 * structure of the mathematical formula it represents, and may even render 507 * the representation invalid. Callers need to be careful to use this method 508 * in the context of other operations to create complete and correct 509 * formulas. The method @if conly ASTNode_isWellFormedASTNode()@else 510 * ASTNode::isWellFormedASTNode()@endif may also be useful for checking the 511 * results of node modifications. 512 * 513 * 514 * @see prependChild(ASTNode disownedChild) 515 * @see replaceChild(unsigned int n, ASTNode disownedChild, bool delreplaced) 516 * @see insertChild(unsigned int n, ASTNode disownedChild) 517 * @see removeChild(unsigned int n) 518 * @see isWellFormedASTNode() 519 */ public addChild(ASTNode disownedChild)520 int addChild(ASTNode disownedChild) { 521 int ret = libsbmlPINVOKE.ASTNode_addChild__SWIG_1(swigCPtr, ASTNode.getCPtrAndDisown(disownedChild)); 522 return ret; 523 } 524 525 526 /** 527 * Adds the given node as a child of this ASTNode. This method adds 528 * child nodes from right to left. 529 * 530 * @param disownedChild the ASTNode instance to add. 531 * Will become a child of the parent node. 532 * 533 * 534 * @return integer value indicating success/failure of the 535 * function. @if clike The value is drawn from the 536 * enumeration #OperationReturnValues_t. @endif The possible values 537 * returned by this function are: 538 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 539 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 540 * 541 * 542 * @warning Explicitly adding, removing or replacing children of an 543 * @if conly ASTNode_t structure@else ASTNode object@endif may change the 544 * structure of the mathematical formula it represents, and may even render 545 * the representation invalid. Callers need to be careful to use this method 546 * in the context of other operations to create complete and correct 547 * formulas. The method @if conly ASTNode_isWellFormedASTNode()@else 548 * ASTNode::isWellFormedASTNode()@endif may also be useful for checking the 549 * results of node modifications. 550 * 551 * 552 * @see addChild(ASTNode disownedChild) 553 * @see replaceChild(unsigned int n, ASTNode disownedChild, bool delreplaced) 554 * @see insertChild(unsigned int n, ASTNode disownedChild) 555 * @see removeChild(unsigned int n) 556 */ public prependChild(ASTNode disownedChild)557 int prependChild(ASTNode disownedChild) { 558 int ret = libsbmlPINVOKE.ASTNode_prependChild(swigCPtr, ASTNode.getCPtrAndDisown(disownedChild)); 559 return ret; 560 } 561 562 563 /** 564 * Removes the nth child of this ASTNode object. 565 * 566 * @param n unsigned int the index of the child to remove. 567 * 568 * 569 * @return integer value indicating success/failure of the 570 * function. @if clike The value is drawn from the 571 * enumeration #OperationReturnValues_t. @endif The possible values 572 * returned by this function are: 573 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 574 * @li @link libsbml#LIBSBML_INDEX_EXCEEDS_SIZE LIBSBML_INDEX_EXCEEDS_SIZE@endlink 575 * 576 * 577 * @warning Explicitly adding, removing or replacing children of an 578 * @if conly ASTNode_t structure@else ASTNode object@endif may change the 579 * structure of the mathematical formula it represents, and may even render 580 * the representation invalid. Callers need to be careful to use this method 581 * in the context of other operations to create complete and correct 582 * formulas. The method @if conly ASTNode_isWellFormedASTNode()@else 583 * ASTNode::isWellFormedASTNode()@endif may also be useful for checking the 584 * results of node modifications. 585 * 586 * 587 * @see addChild(ASTNode disownedChild) 588 * @see prependChild(ASTNode disownedChild) 589 * @see replaceChild(unsigned int n, ASTNode disownedChild, bool delreplaced) 590 * @see insertChild(unsigned int n, ASTNode disownedChild) 591 */ public removeChild(long n)592 int removeChild(long n) { 593 int ret = libsbmlPINVOKE.ASTNode_removeChild(swigCPtr, n); 594 return ret; 595 } 596 597 598 /** 599 * Replaces and optionally deletes the nth child of this ASTNode with the given ASTNode. 600 * 601 * @param n unsigned int the index of the child to replace. 602 * @param disownedChild ASTNode to replace the nth child. 603 * Will become a child of the parent node. 604 * @param delreplaced Boolean indicating whether to delete the replaced child. 605 * 606 * 607 * @return integer value indicating success/failure of the 608 * function. @if clike The value is drawn from the 609 * enumeration #OperationReturnValues_t. @endif The possible values 610 * returned by this function are: 611 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 612 * @li @link libsbml#LIBSBML_INDEX_EXCEEDS_SIZE LIBSBML_INDEX_EXCEEDS_SIZE@endlink 613 * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink 614 * 615 * 616 * @warning Explicitly adding, removing or replacing children of an 617 * @if conly ASTNode_t structure@else ASTNode object@endif may change the 618 * structure of the mathematical formula it represents, and may even render 619 * the representation invalid. Callers need to be careful to use this method 620 * in the context of other operations to create complete and correct 621 * formulas. The method @if conly ASTNode_isWellFormedASTNode()@else 622 * ASTNode::isWellFormedASTNode()@endif may also be useful for checking the 623 * results of node modifications. 624 * 625 * 626 * @see addChild(ASTNode disownedChild) 627 * @see prependChild(ASTNode disownedChild) 628 * @see insertChild(unsigned int n, ASTNode disownedChild) 629 * @see removeChild(unsigned int n) 630 */ public replaceChild(long n, ASTNode disownedChild, bool delreplaced)631 int replaceChild(long n, ASTNode disownedChild, bool delreplaced) { 632 int ret = libsbmlPINVOKE.ASTNode_replaceChild__SWIG_0(swigCPtr, n, ASTNode.getCPtrAndDisown(disownedChild), delreplaced); 633 return ret; 634 } 635 636 637 /** 638 * Replaces and optionally deletes the nth child of this ASTNode with the given ASTNode. 639 * 640 * @param n unsigned int the index of the child to replace. 641 * @param disownedChild ASTNode to replace the nth child. 642 * Will become a child of the parent node. 643 * @param delreplaced Boolean indicating whether to delete the replaced child. 644 * 645 * 646 * @return integer value indicating success/failure of the 647 * function. @if clike The value is drawn from the 648 * enumeration #OperationReturnValues_t. @endif The possible values 649 * returned by this function are: 650 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 651 * @li @link libsbml#LIBSBML_INDEX_EXCEEDS_SIZE LIBSBML_INDEX_EXCEEDS_SIZE@endlink 652 * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink 653 * 654 * 655 * @warning Explicitly adding, removing or replacing children of an 656 * @if conly ASTNode_t structure@else ASTNode object@endif may change the 657 * structure of the mathematical formula it represents, and may even render 658 * the representation invalid. Callers need to be careful to use this method 659 * in the context of other operations to create complete and correct 660 * formulas. The method @if conly ASTNode_isWellFormedASTNode()@else 661 * ASTNode::isWellFormedASTNode()@endif may also be useful for checking the 662 * results of node modifications. 663 * 664 * 665 * @see addChild(ASTNode disownedChild) 666 * @see prependChild(ASTNode disownedChild) 667 * @see insertChild(unsigned int n, ASTNode disownedChild) 668 * @see removeChild(unsigned int n) 669 */ public replaceChild(long n, ASTNode disownedChild)670 int replaceChild(long n, ASTNode disownedChild) { 671 int ret = libsbmlPINVOKE.ASTNode_replaceChild__SWIG_1(swigCPtr, n, ASTNode.getCPtrAndDisown(disownedChild)); 672 return ret; 673 } 674 675 676 /** 677 * Inserts the given ASTNode at point n in the list of children 678 * of this ASTNode. 679 * 680 * @param n unsigned int the index of the ASTNode being added. 681 * @param disownedChild ASTNode to insert as the nth child. 682 * 683 * 684 * @return integer value indicating success/failure of the 685 * function. @if clike The value is drawn from the 686 * enumeration #OperationReturnValues_t. @endif The possible values 687 * returned by this function are: 688 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 689 * @li @link libsbml#LIBSBML_INDEX_EXCEEDS_SIZE LIBSBML_INDEX_EXCEEDS_SIZE@endlink 690 * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink 691 * 692 * 693 * @warning Explicitly adding, removing or replacing children of an 694 * @if conly ASTNode_t structure@else ASTNode object@endif may change the 695 * structure of the mathematical formula it represents, and may even render 696 * the representation invalid. Callers need to be careful to use this method 697 * in the context of other operations to create complete and correct 698 * formulas. The method @if conly ASTNode_isWellFormedASTNode()@else 699 * ASTNode::isWellFormedASTNode()@endif may also be useful for checking the 700 * results of node modifications. 701 * 702 * 703 * @see addChild(ASTNode disownedChild) 704 * @see prependChild(ASTNode disownedChild) 705 * @see replaceChild(unsigned int n, ASTNode disownedChild, bool delreplaced) 706 * @see removeChild(unsigned int n) 707 */ public insertChild(long n, ASTNode disownedChild)708 int insertChild(long n, ASTNode disownedChild) { 709 int ret = libsbmlPINVOKE.ASTNode_insertChild(swigCPtr, n, ASTNode.getCPtrAndDisown(disownedChild)); 710 return ret; 711 } 712 713 714 /** 715 * Creates a recursive copy of this node and all its children. 716 * 717 * @return a copy of this ASTNode and all its children. The caller owns 718 * the returned ASTNode and is responsible for deleting it. 719 */ public deepCopy()720 ASTNode deepCopy() { 721 global::System.IntPtr cPtr = libsbmlPINVOKE.ASTNode_deepCopy(swigCPtr); 722 ASTNode ret = (cPtr == global::System.IntPtr.Zero) ? null : new ASTNode(cPtr, true); 723 return ret; 724 } 725 726 727 /** 728 * Returns the child at index n of this node. 729 * 730 * @param n the index of the child to get. 731 * 732 * @return the nth child of this ASTNode or @c null if this node has no nth 733 * child (<code>n > </code> 734 * @if clike getNumChildren()@else ASTNode::getNumChildren()@endif 735 * <code>- 1</code>). 736 * 737 * @see getNumChildren() 738 * @see getLeftChild() 739 * @see getRightChild() 740 */ public getChild(long n)741 ASTNode getChild(long n) { 742 global::System.IntPtr cPtr = libsbmlPINVOKE.ASTNode_getChild(swigCPtr, n); 743 ASTNode ret = (cPtr == global::System.IntPtr.Zero) ? null : new ASTNode(cPtr, false); 744 return ret; 745 } 746 747 748 /** 749 * Returns the left child of this node. 750 * 751 * @return the left child of this ASTNode. This is equivalent to calling 752 * @if clike getChild()@else ASTNode::getChild(unsigned int)@endif 753 * with an argument of @c 0. 754 * 755 * @see getNumChildren() 756 * @see getChild(@if java unsigned int@endif) 757 * @see getRightChild() 758 */ public getLeftChild()759 ASTNode getLeftChild() { 760 global::System.IntPtr cPtr = libsbmlPINVOKE.ASTNode_getLeftChild(swigCPtr); 761 ASTNode ret = (cPtr == global::System.IntPtr.Zero) ? null : new ASTNode(cPtr, false); 762 return ret; 763 } 764 765 766 /** 767 * Returns the right child of this node. 768 * 769 * @return the right child of this ASTNode, or @c null if this node has no 770 * right child. If 771 * @if clike getNumChildren()@else ASTNode::getNumChildren()@endif 772 * <code>> 1</code>, then this is equivalent to: 773 * @verbatim 774 getChild( getNumChildren() - 1 ); 775 @endverbatim 776 * 777 * @see getNumChildren() 778 * @see getLeftChild() 779 * @see getChild(@if java unsigned int@endif) 780 */ public getRightChild()781 ASTNode getRightChild() { 782 global::System.IntPtr cPtr = libsbmlPINVOKE.ASTNode_getRightChild(swigCPtr); 783 ASTNode ret = (cPtr == global::System.IntPtr.Zero) ? null : new ASTNode(cPtr, false); 784 return ret; 785 } 786 787 788 /** 789 * Returns the number of children of this node. 790 * 791 * @return the number of children of this ASTNode, or 0 is this node has 792 * no children. 793 */ public getNumChildren()794 long getNumChildren() { return (long)libsbmlPINVOKE.ASTNode_getNumChildren(swigCPtr); } 795 796 797 /** 798 * Adds the given XMLNode as a MathML <code><semantics></code> 799 * element to this ASTNode. 800 * 801 * @htmlinclude about-semantic-annotations.html 802 * 803 * @param disownedAnnotation the annotation to add. 804 * Will become a child of the parent node. 805 * 806 * 807 * @return integer value indicating success/failure of the 808 * function. @if clike The value is drawn from the 809 * enumeration #OperationReturnValues_t. @endif The possible values 810 * returned by this function are: 811 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 812 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 813 * 814 * 815 * @note Although SBML permits the use of the MathML 816 * <code><semantics></code> annotation construct, the truth is that 817 * this construct has so far (at this time of this writing, which is early 818 * 2014) seen very little use in SBML software. The full implications of 819 * using these annotations are still poorly understood. If you wish to 820 * use this construct, we urge you to discuss possible uses and applications 821 * on the SBML discussion lists, particularly <a target='_blank' 822 * href='http://sbml.org/Forums'>sbml-discuss</a> and/or <a target='_blank' 823 * href='http://sbml.org/Forums'>sbml-interoperability</a>. 824 * 825 * @see getNumSemanticsAnnotations() 826 * @see getSemanticsAnnotation(@if java unsigned int@endif) 827 */ public addSemanticsAnnotation(XMLNode disownedAnnotation)828 int addSemanticsAnnotation(XMLNode disownedAnnotation) { 829 int ret = libsbmlPINVOKE.ASTNode_addSemanticsAnnotation(swigCPtr, XMLNode.getCPtrAndDisown(disownedAnnotation)); 830 return ret; 831 } 832 833 834 /** 835 * Returns the number of MathML <code><semantics></code> element 836 * elements on this node. 837 * 838 * @htmlinclude about-semantic-annotations.html 839 * 840 * @return the number of annotations of this ASTNode. 841 * 842 * 843 * @note Although SBML permits the use of the MathML 844 * <code><semantics></code> annotation construct, the truth is that 845 * this construct has so far (at this time of this writing, which is early 846 * 2014) seen very little use in SBML software. The full implications of 847 * using these annotations are still poorly understood. If you wish to 848 * use this construct, we urge you to discuss possible uses and applications 849 * on the SBML discussion lists, particularly <a target='_blank' 850 * href='http://sbml.org/Forums'>sbml-discuss</a> and/or <a target='_blank' 851 * href='http://sbml.org/Forums'>sbml-interoperability</a>. 852 * 853 * @see addSemanticsAnnotation(@if java XMLNode@endif) 854 * @see getSemanticsAnnotation(@if java unsigned int@endif) 855 */ public getNumSemanticsAnnotations()856 long getNumSemanticsAnnotations() { return (long)libsbmlPINVOKE.ASTNode_getNumSemanticsAnnotations(swigCPtr); } 857 858 859 /** 860 * Returns the nth MathML <code><semantics></code> element on this 861 * ASTNode. 862 * 863 * @htmlinclude about-semantic-annotations.html 864 * 865 * @param n the index of the annotation to return. Callers should 866 * use ASTNode::getNumSemanticsAnnotations() to first find out how 867 * many annotations there are. 868 * 869 * @return the nth annotation inside this ASTNode, or @c null if this node has 870 * no nth annotation (<code>n ></code> 871 * @if clike getNumSemanticsAnnotations()@else ASTNode::getNumSemanticsAnnotations()@endif 872 * <code>- 1</code>). 873 * 874 * 875 * @note Although SBML permits the use of the MathML 876 * <code><semantics></code> annotation construct, the truth is that 877 * this construct has so far (at this time of this writing, which is early 878 * 2014) seen very little use in SBML software. The full implications of 879 * using these annotations are still poorly understood. If you wish to 880 * use this construct, we urge you to discuss possible uses and applications 881 * on the SBML discussion lists, particularly <a target='_blank' 882 * href='http://sbml.org/Forums'>sbml-discuss</a> and/or <a target='_blank' 883 * href='http://sbml.org/Forums'>sbml-interoperability</a>. 884 * 885 * @see getNumSemanticsAnnotations() 886 * @see addSemanticsAnnotation(@if java XMLNode@endif) 887 */ public getSemanticsAnnotation(long n)888 XMLNode getSemanticsAnnotation(long n) { 889 global::System.IntPtr cPtr = libsbmlPINVOKE.ASTNode_getSemanticsAnnotation(swigCPtr, n); 890 XMLNode ret = (cPtr == global::System.IntPtr.Zero) ? null : new XMLNode(cPtr, false); 891 return ret; 892 } 893 894 895 /** 896 * Returns the value of this node as a single character. 897 * 898 * This function should be called only when 899 * @if clike getType()@else ASTNode::getType()@endif returns 900 * @link libsbml#AST_PLUS AST_PLUS@endlink, 901 * @link libsbml#AST_MINUS AST_MINUS@endlink, 902 * @link libsbml#AST_TIMES AST_TIMES@endlink, 903 * @link libsbml#AST_DIVIDE AST_DIVIDE@endlink or 904 * @link libsbml#AST_POWER AST_POWER@endlink. 905 * 906 * @return the value of this ASTNode as a single character 907 */ public getCharacter()908 char getCharacter() { 909 char ret = libsbmlPINVOKE.ASTNode_getCharacter(swigCPtr); 910 return ret; 911 } 912 913 914 /** 915 * Returns the MathML @c id attribute value of this ASTNode. 916 * 917 * @return the MathML id of this ASTNode. 918 * 919 * @see isSetId() 920 * @see setId(string id) 921 * @see unsetId() 922 */ public getId()923 string getId() { 924 string ret = libsbmlPINVOKE.ASTNode_getId(swigCPtr); 925 return ret; 926 } 927 928 929 /** 930 * Returns the MathML @c class attribute value of this ASTNode. 931 * 932 * @return the MathML class of this ASTNode, or an empty string if it does not exist. 933 * 934 * @see isSetClass() 935 * @see @if java setClassName(string id)@else setClass()@endif 936 * @see unsetClass() 937 */ public getClass()938 string getClass() { 939 string ret = libsbmlPINVOKE.ASTNode_getClass(swigCPtr); 940 return ret; 941 } 942 943 944 /** 945 * Returns the MathML @c style attribute value of this ASTNode. 946 * 947 * @return the MathML style of this ASTNode, or an empty string if it does not exist. 948 * 949 * @see isSetStyle() 950 * @see setStyle(string id) 951 * @see unsetStyle() 952 */ public getStyle()953 string getStyle() { 954 string ret = libsbmlPINVOKE.ASTNode_getStyle(swigCPtr); 955 return ret; 956 } 957 958 959 /** 960 * Returns the value of this node as an integer. 961 * 962 * If this node type is @link libsbml#AST_RATIONAL AST_RATIONAL@endlink, this 963 * method returns the value of the numerator. 964 * 965 * @return the value of this ASTNode as a (<code>long</code>) integer if type @link libsbml#AST_INTEGER AST_INTEGER@endlink; the numerator if type @link libsbml#AST_RATIONAL AST_RATIONAL@endlink, and @c 0 otherwise. 966 * 967 * @note This function should be called only when 968 * @if clike getType()@else ASTNode::getType()@endif returns 969 * @link libsbml#AST_INTEGER AST_INTEGER@endlink or 970 * @link libsbml#AST_RATIONAL AST_RATIONAL@endlink. 971 * It will return @c 0 if the node type is @em not one of these, but since 972 * @c 0 may be a valid value for integer, it is important to be sure that 973 * the node type is one of the expected types in order to understand if 974 * @c 0 is the actual value. 975 * 976 * @see getNumerator() 977 * @see getDenominator() 978 */ public getInteger()979 int getInteger() { 980 int ret = libsbmlPINVOKE.ASTNode_getInteger(swigCPtr); 981 return ret; 982 } 983 984 985 /** 986 * Returns the value of this node as a string. 987 * 988 * This function may be called on nodes that (1) are not operators, i.e., 989 * nodes for which @if clike isOperator()@else 990 * ASTNode::isOperator()@endif returns @c false, and (2) are not numbers, 991 * i.e., @if clike isNumber()@else ASTNode::isNumber()@endif returns 992 * @c null. 993 * 994 * @return the value of this ASTNode as a string, or @c null if it is 995 * a node that does not have a name equivalent (e.g., if it is a number). 996 */ public getName()997 string getName() { 998 string ret = libsbmlPINVOKE.ASTNode_getName(swigCPtr); 999 return ret; 1000 } 1001 1002 1003 /** 1004 * Returns the value of this operator node as a string. 1005 * 1006 * This function may be called on nodes that are operators, i.e., nodes for 1007 * which @if clike isOperator()@else ASTNode::isOperator()@endif returns 1008 * @c true. 1009 * 1010 * @return the name of this operator ASTNode as a string (or @c null if not 1011 * an operator). 1012 */ public getOperatorName()1013 string getOperatorName() { 1014 string ret = libsbmlPINVOKE.ASTNode_getOperatorName(swigCPtr); 1015 return ret; 1016 } 1017 1018 1019 /** 1020 * Returns the value of the numerator of this node if of 1021 * type @link libsbml#AST_RATIONAL AST_RATIONAL@endlink, or the 1022 * numerical value of the node if of type 1023 * @link libsbml#AST_INTEGER AST_INTEGER@endlink; @c 0 otherwise. 1024 * 1025 * This function should be called only when 1026 * @if clike getType()@else ASTNode::getType()@endif returns 1027 * @link libsbml#AST_RATIONAL AST_RATIONAL@endlink or 1028 * @link libsbml#AST_INTEGER AST_INTEGER@endlink. 1029 * It will return @c 0 if the node type is another type, but since @c 0 may 1030 * be a valid value for the denominator of a rational number or of an integer, it is 1031 * important to be sure that the node type is the correct type in order to 1032 * correctly interpret the returned value. 1033 * 1034 * @return the value of the numerator of this ASTNode if 1035 * @link libsbml#AST_RATIONAL AST_RATIONAL@endlink, the value if 1036 * @link libsbml#AST_INTEGER AST_INTEGER@endlink, or @c 0 otherwise. 1037 * 1038 * @see getDenominator() 1039 * @see getInteger() 1040 */ public getNumerator()1041 int getNumerator() { 1042 int ret = libsbmlPINVOKE.ASTNode_getNumerator(swigCPtr); 1043 return ret; 1044 } 1045 1046 1047 /** 1048 * Returns the value of the denominator of this node. 1049 * 1050 * @return the value of the denominator of this ASTNode, or @c 1 (true) if 1051 * this node is not of type @link libsbml#AST_RATIONAL AST_RATIONAL@endlink. 1052 * 1053 * @note This function should be called only when 1054 * @if clike getType()@else ASTNode::getType()@endif returns 1055 * @link libsbml#AST_RATIONAL AST_RATIONAL@endlink. 1056 * It will return @c 1 if the node type is another type, but since @c 1 may 1057 * be a valid value for the denominator of a rational number, it is 1058 * important to be sure that the node type is the correct type in order to 1059 * correctly interpret the returned value. 1060 * 1061 * @see getNumerator() 1062 */ public getDenominator()1063 int getDenominator() { 1064 int ret = libsbmlPINVOKE.ASTNode_getDenominator(swigCPtr); 1065 return ret; 1066 } 1067 1068 1069 /** 1070 * Returns the real-numbered value of this node. 1071 * 1072 * This function performs the necessary arithmetic if the node type is 1073 * @link libsbml#AST_REAL_E AST_REAL_E@endlink (<em>mantissa * 1074 * 10<sup>exponent</sup></em>) or 1075 * @link libsbml#AST_RATIONAL AST_RATIONAL@endlink 1076 * (<em>numerator / denominator</em>). 1077 * 1078 * @return the value of this ASTNode as a real (double), or @c 0 1079 * if this is not a node that holds a number. 1080 * 1081 * @note This function should be called only when this ASTNode has a 1082 * numerical value type. It will return @c 0 if the node type is another 1083 * type, but since @c 0 may be a valid value, it is important to be sure 1084 * that the node type is the correct type in order to correctly interpret 1085 * the returned value. 1086 */ public getReal()1087 double getReal() { 1088 double ret = libsbmlPINVOKE.ASTNode_getReal(swigCPtr); 1089 return ret; 1090 } 1091 1092 1093 /** 1094 * Returns the mantissa value of this node. 1095 * 1096 * If @if clike getType()@else ASTNode::getType()@endif returns 1097 * @link libsbml#AST_REAL AST_REAL@endlink, this method is 1098 * identical to ASTNode::getReal(). 1099 * 1100 * @return the value of the mantissa of this ASTNode, or @c 0 if this 1101 * node is not a type that has a real-numbered value. 1102 * 1103 * @note This function should be called only when 1104 * @if clike getType()@else ASTNode::getType()@endif returns 1105 * @link libsbml#AST_REAL_E AST_REAL_E@endlink, 1106 * @link libsbml#AST_REAL AST_REAL@endlink or 1107 * @link libsbml#AST_NAME_AVOGADRO AST_NAME_AVOGADRO@endlink. It 1108 * will return @c 0 if the node type is another type, but since @c 0 may be 1109 * a valid value, it is important to be sure that the node type is the 1110 * correct type in order to correctly interpret the returned value. 1111 * 1112 * @see getExponent() 1113 */ public getMantissa()1114 double getMantissa() { 1115 double ret = libsbmlPINVOKE.ASTNode_getMantissa(swigCPtr); 1116 return ret; 1117 } 1118 1119 1120 /** 1121 * Returns the exponent value of this ASTNode. 1122 * 1123 * @return the value of the exponent of this ASTNode, or @c 0 if this 1124 * is not a type of node that has an exponent. 1125 * 1126 * @note This function should be called only when 1127 * @if clike getType()@else ASTNode::getType()@endif 1128 * returns @link libsbml#AST_REAL_E AST_REAL_E@endlink. 1129 * It will return @c 0 if the node type is another type, but since @c 0 may 1130 * be a valid value, it is important to be sure that the node type is the 1131 * correct type in order to correctly interpret the returned value. 1132 * 1133 * @see getMantissa() 1134 */ public getExponent()1135 int getExponent() { 1136 int ret = libsbmlPINVOKE.ASTNode_getExponent(swigCPtr); 1137 return ret; 1138 } 1139 1140 1141 /** 1142 * Returns the numerical value of this ASTNode. 1143 * 1144 * @return the numerical value of this ASTNode, or @c NaN if this 1145 * is not a type of node that has a numerical value. 1146 * 1147 * @note This function will return a numerical value (as a double) for 1148 * any ASTNode_t that represents a number, a constant such as 1149 * @link libsbml#AST_CONSTANT_PI AST_CONSTANT_PI@endlink, 1150 * @link libsbml#AST_CONSTANT_E AST_CONSTANT_E@endlink, or 1151 * @link libsbml#AST_NAME_AVOGADRO AST_NAME_AVOGADRO@endlink, or 1152 * @c 1 for nodes of type 1153 * @link libsbml#AST_CONSTANT_TRUE AST_CONSTANT_TRUE@endlink and @c 0 for nodes of type 1154 * @link libsbml#AST_CONSTANT_FALSE AST_CONSTANT_FALSE@endlink. It does not evaluate 1155 * the node in any way so, for example, it will not return the value of 1156 * a named ASTNode_t or attempt to evaluate a function. 1157 * This includes a node representing @c time i.e. nodes 1158 * of type @link libsbml#AST_NAME_TIME AST_NAME_TIME@endlink. 1159 */ public getValue()1160 double getValue() { 1161 double ret = libsbmlPINVOKE.ASTNode_getValue(swigCPtr); 1162 return ret; 1163 } 1164 1165 1166 /** 1167 * Returns the precedence of this node in the infix math syntax of SBML 1168 * Level 1. For more information about the infix syntax, see the 1169 * discussion about <a href='#math-convert'>text string formulas</a> at 1170 * the top of the documentation for ASTNode. 1171 * 1172 * @return an integer indicating the precedence of this ASTNode 1173 */ public getPrecedence()1174 int getPrecedence() { 1175 int ret = libsbmlPINVOKE.ASTNode_getPrecedence(swigCPtr); 1176 return ret; 1177 } 1178 1179 1180 /** 1181 * Returns the type of this ASTNode. 1182 * 1183 * The value returned is one of the Core AST type codes such as 1184 * @link libsbml#AST_LAMBDA AST_LAMBDA@endlink, 1185 * @link libsbml#AST_PLUS AST_PLUS@endlink, etc. 1186 * 1187 * @return the type of this ASTNode. 1188 */ public getType()1189 int getType() { 1190 int ret = libsbmlPINVOKE.ASTNode_getType(swigCPtr); 1191 return ret; 1192 } 1193 1194 1195 /** 1196 * Returns the units of this ASTNode. 1197 * 1198 * @htmlinclude about-sbml-units-attrib.html 1199 * 1200 * @return the units of this ASTNode. 1201 * 1202 * @note The <code>sbml:units</code> attribute is only available in SBML 1203 * Level 3. It may not be used in Levels 1–2 of SBML. 1204 * 1205 * @see @sbmlfunction{parseL3Formula, String} 1206 */ public getUnits()1207 string getUnits() { 1208 string ret = libsbmlPINVOKE.ASTNode_getUnits(swigCPtr); 1209 return ret; 1210 } 1211 1212 1213 /** 1214 * Returns @c true (nonzero) if this node is the special 1215 * symbol @c avogadro. The predicate returns @c false (zero) otherwise. 1216 * 1217 * SBML Level 3 introduced a predefined MathML <code><csymbol></code> 1218 * for the value of Avogadro's constant. LibSBML stores this internally as 1219 * a node of type @link libsbml#AST_NAME_AVOGADRO AST_NAME_AVOGADRO@endlink. 1220 * This method returns @c true if this node has that type. 1221 * 1222 * @return @c true if this ASTNode is the special symbol avogadro, 1223 * @c false otherwise. 1224 * 1225 * @see @sbmlfunction{parseL3Formula, String} 1226 */ public isAvogadro()1227 bool isAvogadro() { 1228 bool ret = libsbmlPINVOKE.ASTNode_isAvogadro(swigCPtr); 1229 return ret; 1230 } 1231 1232 1233 /** 1234 * Returns @c true if this node has a Boolean type. 1235 * 1236 * The ASTNode objects that have Boolean types are the logical operators, 1237 * relational operators, and the constants @c true or @c false. 1238 * 1239 * @return @c true if this ASTNode has a Boolean type, @c false otherwise. 1240 */ public isBoolean()1241 bool isBoolean() { 1242 bool ret = libsbmlPINVOKE.ASTNode_isBoolean(swigCPtr); 1243 return ret; 1244 } 1245 1246 1247 /** 1248 * Returns @c true (nonzero) if this node returns a Boolean type 1249 * or @c false (zero) otherwise. 1250 * 1251 * This function looks at the whole ASTNode rather than just the top 1252 * level of the ASTNode. Thus it will consider return values from 1253 * piecewise statements. In addition, if this ASTNode uses a function 1254 * call, the return value of the functionDefinition will be determined. 1255 * Note that this is only possible where the ASTNode can trace its parent 1256 * Model, that is, the ASTNode must represent the <code><math></code> element of some 1257 * SBML object that has already been added to an instance of an SBMLDocument. 1258 * If this is not the case, this function will return @c false unless 1259 * isBoolean() returns @c true. 1260 * 1261 * @see isBoolean() 1262 * 1263 * @return @c true if this ASTNode returns a Boolean, @c false otherwise. 1264 */ public returnsBoolean(Model model)1265 bool returnsBoolean(Model model) { 1266 bool ret = libsbmlPINVOKE.ASTNode_returnsBoolean__SWIG_0(swigCPtr, Model.getCPtr(model)); 1267 return ret; 1268 } 1269 1270 1271 /** 1272 * Returns @c true (nonzero) if this node returns a Boolean type 1273 * or @c false (zero) otherwise. 1274 * 1275 * This function looks at the whole ASTNode rather than just the top 1276 * level of the ASTNode. Thus it will consider return values from 1277 * piecewise statements. In addition, if this ASTNode uses a function 1278 * call, the return value of the functionDefinition will be determined. 1279 * Note that this is only possible where the ASTNode can trace its parent 1280 * Model, that is, the ASTNode must represent the <code><math></code> element of some 1281 * SBML object that has already been added to an instance of an SBMLDocument. 1282 * If this is not the case, this function will return @c false unless 1283 * isBoolean() returns @c true. 1284 * 1285 * @see isBoolean() 1286 * 1287 * @return @c true if this ASTNode returns a Boolean, @c false otherwise. 1288 */ public returnsBoolean()1289 bool returnsBoolean() { 1290 bool ret = libsbmlPINVOKE.ASTNode_returnsBoolean__SWIG_1(swigCPtr); 1291 return ret; 1292 } 1293 1294 1295 /** 1296 * Returns @c true (nonzero) if this node represents a MathML 1297 * constant (e.g., @c true, @c Pi). 1298 * 1299 * @return @c true if this ASTNode is a MathML constant, @c false otherwise. 1300 * 1301 * @note this function will also return @c true for nodes of type 1302 * @link libsbml#AST_NAME_AVOGADRO AST_NAME_AVOGADRO@endlink in SBML Level 3. 1303 */ public isConstant()1304 bool isConstant() { 1305 bool ret = libsbmlPINVOKE.ASTNode_isConstant(swigCPtr); 1306 return ret; 1307 } 1308 1309 1310 /** 1311 * Returns @c true (nonzero) if this node represents a MathML 1312 * ci element representing a value not a function (e.g., @c true, @c Pi). 1313 * 1314 * @return @c true if this ASTNode is a MathML ci element, @c false otherwise. 1315 */ public isCiNumber()1316 bool isCiNumber() { 1317 bool ret = libsbmlPINVOKE.ASTNode_isCiNumber(swigCPtr); 1318 return ret; 1319 } 1320 1321 1322 /** 1323 * Returns @c true (nonzero) if this node represents a MathML 1324 * constant with numeric value (e.g., @c Pi). 1325 * 1326 * @return @c true if this ASTNode is a MathML constant, @c false otherwise. 1327 * 1328 * @note this function will also return @c true for 1329 * @link libsbml#AST_NAME_AVOGADRO AST_NAME_AVOGADRO@endlink in SBML Level 3. 1330 */ public isConstantNumber()1331 bool isConstantNumber() { 1332 bool ret = libsbmlPINVOKE.ASTNode_isConstantNumber(swigCPtr); 1333 return ret; 1334 } 1335 1336 1337 /** 1338 * Returns @c true (nonzero) if this node represents a MathML 1339 * csymbol representing a function. 1340 * 1341 * @return @c true if this ASTNode is a MathML csymbol function, @c false otherwise. 1342 */ public isCSymbolFunction()1343 bool isCSymbolFunction() { 1344 bool ret = libsbmlPINVOKE.ASTNode_isCSymbolFunction(swigCPtr); 1345 return ret; 1346 } 1347 1348 1349 /** 1350 * Returns @c true if this node represents a function. 1351 * 1352 * The three types of functions in SBML are MathML functions (e.g., 1353 * <code>abs()</code>), SBML Level 1 functions (in the SBML 1354 * Level 1 math syntax), and user-defined functions (using 1355 * FunctionDefinition in SBML Level 2 and 3). 1356 * 1357 * @return @c true if this ASTNode is a function, @c false otherwise. 1358 */ public isFunction()1359 bool isFunction() { 1360 bool ret = libsbmlPINVOKE.ASTNode_isFunction(swigCPtr); 1361 return ret; 1362 } 1363 1364 1365 /** 1366 * Returns @c true (nonzero) if this node represents 1367 * the special IEEE 754 value infinity, @c false (zero) otherwise. 1368 * 1369 * @return @c true if this ASTNode is the special IEEE 754 value infinity, 1370 * @c false otherwise. 1371 */ public isInfinity()1372 bool isInfinity() { 1373 bool ret = libsbmlPINVOKE.ASTNode_isInfinity(swigCPtr); 1374 return ret; 1375 } 1376 1377 1378 /** 1379 * Returns @c true (nonzero) if this node contains an 1380 * integer value, @c false (zero) otherwise. 1381 * 1382 * @return @c true if this ASTNode is of type @link libsbml#AST_INTEGER AST_INTEGER@endlink, @c false otherwise. 1383 */ public isInteger()1384 bool isInteger() { 1385 bool ret = libsbmlPINVOKE.ASTNode_isInteger(swigCPtr); 1386 return ret; 1387 } 1388 1389 1390 /** 1391 * Returns @c true (nonzero) if this node is a MathML 1392 * <code><lambda></code>, @c false (zero) otherwise. 1393 * 1394 * @return @c true if this ASTNode is of type @link libsbml#AST_LAMBDA AST_LAMBDA@endlink, @c false otherwise. 1395 */ public isLambda()1396 bool isLambda() { 1397 bool ret = libsbmlPINVOKE.ASTNode_isLambda(swigCPtr); 1398 return ret; 1399 } 1400 1401 1402 /** 1403 * Returns @c true (nonzero) if this node represents a 1404 * @c log10 function, @c false (zero) otherwise. 1405 * 1406 * More precisely, this predicate returns @c true if the node type is 1407 * @link libsbml#AST_FUNCTION_LOG AST_FUNCTION_LOG@endlink with two 1408 * children, the first of which is an @link libsbml#AST_INTEGER AST_INTEGER@endlink equal to 10. 1409 * 1410 * @return @c true if the given ASTNode represents a log10() function, 1411 * @c false otherwise. 1412 * 1413 * @see @sbmlfunction{parseL3Formula, String} 1414 */ public isLog10()1415 bool isLog10() { 1416 bool ret = libsbmlPINVOKE.ASTNode_isLog10(swigCPtr); 1417 return ret; 1418 } 1419 1420 1421 /** 1422 * Returns @c true (nonzero) if this node is a MathML 1423 * logical operator. 1424 * 1425 * The possible MathML logical operators in SBML core are @c and, @c or, @c not, 1426 * @c xor, and (as of SBML Level 3 Version 2) @c implies. If 1427 * the node represents a logical operator defined in a Level 3 package, 1428 * it will also return @c true. 1429 * 1430 * @return @c true if this ASTNode is a MathML logical operator, @c false 1431 * otherwise. 1432 */ public isLogical()1433 bool isLogical() { 1434 bool ret = libsbmlPINVOKE.ASTNode_isLogical(swigCPtr); 1435 return ret; 1436 } 1437 1438 1439 /** 1440 * Returns @c true if this node is a user-defined variable name 1441 * or the symbols for time or Avogadro's constant. 1442 * 1443 * SBML Levels 2 and 3 provides <code><csymbol></code> 1444 * definitions for 'time' and 'avogadro', which can be used to represent 1445 * simulation time and Avogadro's constant in MathML. Note that this 1446 * method does @em not return @c true for the other <code>csymbol</code> 1447 * values defined by SBML, 'delay', because the 'delay' is a function 1448 * and not a constant or variable. Similarly, this function returns 1449 * @c false for the csymbol functions added by the 'Distributions' package. 1450 * 1451 * @return @c true if this ASTNode is a user-defined variable name in SBML 1452 * or the special symbols for time or Avogadro's constant. It returns 1453 * @c false otherwise. 1454 */ public isName()1455 bool isName() { 1456 bool ret = libsbmlPINVOKE.ASTNode_isName(swigCPtr); 1457 return ret; 1458 } 1459 1460 1461 /** 1462 * Returns @c true (nonzero) if this node represents the 1463 * special IEEE 754 value 'not a number' (NaN), @c false (zero) 1464 * otherwise. 1465 * 1466 * @return @c true if this ASTNode is the special IEEE 754 NaN, @c false 1467 * otherwise. 1468 */ public isNaN()1469 bool isNaN() { 1470 bool ret = libsbmlPINVOKE.ASTNode_isNaN(swigCPtr); 1471 return ret; 1472 } 1473 1474 1475 /** 1476 * Returns @c true (nonzero) if this node represents the 1477 * special IEEE 754 value 'negative infinity', @c false (zero) otherwise. 1478 * 1479 * @return @c true if this ASTNode is the special IEEE 754 value negative 1480 * infinity, @c false otherwise. 1481 */ public isNegInfinity()1482 bool isNegInfinity() { 1483 bool ret = libsbmlPINVOKE.ASTNode_isNegInfinity(swigCPtr); 1484 return ret; 1485 } 1486 1487 1488 /** 1489 * Returns @c true (nonzero) if this node contains a number, 1490 * @c false (zero) otherwise. This is functionally equivalent to the 1491 * following code: 1492 * @verbatim 1493 isInteger() || isReal() 1494 @endverbatim 1495 * 1496 * @return @c true if this ASTNode is a number, @c false otherwise. 1497 */ public isNumber()1498 bool isNumber() { 1499 bool ret = libsbmlPINVOKE.ASTNode_isNumber(swigCPtr); 1500 return ret; 1501 } 1502 1503 1504 /** 1505 * Returns @c true if this node is a mathematical 1506 * operator. 1507 * 1508 * The possible mathematical operators in the MathML syntax supported by 1509 * SBML are <code>+</code>, <code>-</code>, <code>*</code>, <code>/</code> 1510 * and <code>^</code> (power). 1511 * 1512 * @return @c true if this ASTNode is an operator, @c false otherwise. 1513 */ public isOperator()1514 bool isOperator() { 1515 bool ret = libsbmlPINVOKE.ASTNode_isOperator(swigCPtr); 1516 return ret; 1517 } 1518 1519 1520 /** 1521 * Returns @c true (nonzero) if this node is the MathML 1522 * <code><piecewise></code> construct. 1523 * 1524 * @return @c true if this ASTNode is a MathML @c piecewise function, 1525 * @c false (zero) otherwise. 1526 */ public isPiecewise()1527 bool isPiecewise() { 1528 bool ret = libsbmlPINVOKE.ASTNode_isPiecewise(swigCPtr); 1529 return ret; 1530 } 1531 1532 1533 /** 1534 * Returns @c true (nonzero) if this node represents a rational 1535 * number. 1536 * 1537 * @return @c true if this ASTNode is of type 1538 * @link libsbml#AST_RATIONAL AST_RATIONAL@endlink, @c false (zero) otherwise. 1539 */ public isRational()1540 bool isRational() { 1541 bool ret = libsbmlPINVOKE.ASTNode_isRational(swigCPtr); 1542 return ret; 1543 } 1544 1545 1546 /** 1547 * Returns @c true (nonzero) if this node can represent a 1548 * real number, @c false (zero) otherwise. 1549 * 1550 * More precisely, this node must be of one of the following types: @link libsbml#AST_REAL AST_REAL@endlink, @link libsbml#AST_REAL_E AST_REAL_E@endlink or @link libsbml#AST_RATIONAL AST_RATIONAL@endlink. 1551 * 1552 * @return @c true if the value of this ASTNode can represented as a real 1553 * number, @c false otherwise. 1554 */ public isReal()1555 bool isReal() { 1556 bool ret = libsbmlPINVOKE.ASTNode_isReal(swigCPtr); 1557 return ret; 1558 } 1559 1560 1561 /** 1562 * Returns @c true if this node is a MathML 1563 * relational operator. 1564 * 1565 * The MathML relational operators are <code>==</code>, <code>>=</code>, 1566 * <code>></code>, <code><</code>, and <code>!=</code>. 1567 * 1568 * @return @c true if this ASTNode is a MathML relational operator, @c 1569 * false otherwise 1570 */ public isRelational()1571 bool isRelational() { 1572 bool ret = libsbmlPINVOKE.ASTNode_isRelational(swigCPtr); 1573 return ret; 1574 } 1575 1576 1577 /** 1578 * Returns @c true (nonzero) if this node represents a 1579 * square root function, @c false (zero) otherwise. 1580 * 1581 * More precisely, the node type must be @link libsbml#AST_FUNCTION_ROOT AST_FUNCTION_ROOT@endlink with two 1582 * children, the first of which is an @link libsbml#AST_INTEGER AST_INTEGER@endlink node having value equal to 2. 1583 * 1584 * @return @c true if the given ASTNode represents a sqrt() function, 1585 * @c false otherwise. 1586 */ public isSqrt()1587 bool isSqrt() { 1588 bool ret = libsbmlPINVOKE.ASTNode_isSqrt(swigCPtr); 1589 return ret; 1590 } 1591 1592 1593 /** 1594 * Returns @c true (nonzero) if this node is a unary minus 1595 * operator, @c false (zero) otherwise. 1596 * 1597 * A node is defined as a unary minus node if it is of type @link libsbml#AST_MINUS AST_MINUS@endlink and has exactly one child. 1598 * 1599 * For numbers, unary minus nodes can be 'collapsed' by negating the 1600 * number. In fact, @sbmlfunction{parseFormula, String} 1601 * does this during its parsing process, and @sbmlfunction{parseL3Formula, String} 1602 * has a configuration option that allows this behavior to be turned 1603 * on or off. However, unary minus nodes for symbols 1604 * (@link libsbml#AST_NAME AST_NAME@endlink) cannot 1605 * be 'collapsed', so this predicate function is necessary. 1606 * 1607 * @return @c true if this ASTNode is a unary minus, @c false otherwise. 1608 * 1609 * @see @sbmlfunction{parseL3Formula, String} 1610 */ public isUMinus()1611 bool isUMinus() { 1612 bool ret = libsbmlPINVOKE.ASTNode_isUMinus(swigCPtr); 1613 return ret; 1614 } 1615 1616 1617 /** 1618 * Returns @c true (nonzero) if this node is a unary plus 1619 * operator, @c false (zero) otherwise. A node is defined as a unary 1620 * minus node if it is of type @link libsbml#AST_MINUS AST_MINUS@endlink and has exactly one child. 1621 * 1622 * @return @c true if this ASTNode is a unary plus, @c false otherwise. 1623 */ public isUPlus()1624 bool isUPlus() { 1625 bool ret = libsbmlPINVOKE.ASTNode_isUPlus(swigCPtr); 1626 return ret; 1627 } 1628 1629 1630 /** 1631 * Returns @c true (nonzero) if this node represents a 1632 * MathML user-defined function. 1633 * 1634 * @return @c true if this ASTNode is a user-defined function, @c false otherwise. 1635 */ public isUserFunction()1636 bool isUserFunction() { 1637 bool ret = libsbmlPINVOKE.ASTNode_isUserFunction(swigCPtr); 1638 return ret; 1639 } 1640 1641 1642 /** 1643 * Returns @c true if this node is of type @p type 1644 * and has @p numchildren number of children. Designed 1645 * for use in cases where it is useful to discover if the node is 1646 * a unary not or unary minus, or a times node with no children, etc. 1647 * 1648 * @return @c true if this ASTNode is has the specified type and number 1649 * of children, @c false otherwise. 1650 */ public hasTypeAndNumChildren(int type, long numchildren)1651 int hasTypeAndNumChildren(int type, long numchildren) { 1652 int ret = libsbmlPINVOKE.ASTNode_hasTypeAndNumChildren(swigCPtr, type, numchildren); 1653 return ret; 1654 } 1655 1656 1657 /** 1658 * Returns @c true (nonzero) if this node has an unknown type. 1659 * 1660 * 'Unknown' nodes have the type @link libsbml#AST_UNKNOWN AST_UNKNOWN@endlink. 1661 * Nodes with unknown types will not appear in an 1662 * ASTNode tree returned by libSBML based upon valid SBML input; the only 1663 * situation in which a node with type @link libsbml#AST_UNKNOWN AST_UNKNOWN@endlink 1664 * may appear is immediately after having create a 1665 * new, untyped node using the ASTNode constructor. Callers creating 1666 * nodes should endeavor to set the type to a valid node type as soon as 1667 * possible after creating new nodes. 1668 * 1669 * @return @c true if this ASTNode is of type @link libsbml#AST_UNKNOWN AST_UNKNOWN@endlink, @c false otherwise. 1670 */ public isUnknown()1671 bool isUnknown() { 1672 bool ret = libsbmlPINVOKE.ASTNode_isUnknown(swigCPtr); 1673 return ret; 1674 } 1675 1676 1677 /** 1678 * Returns @c true (nonzero) if this node has a value for the MathML 1679 * attribute 'id'. 1680 * 1681 * @return @c true if this ASTNode has an attribute id, @c false otherwise. 1682 * 1683 * @see isSetClass() 1684 * @see isSetStyle() 1685 * @see setId(string id) 1686 * @see unsetId() 1687 */ public isSetId()1688 bool isSetId() { 1689 bool ret = libsbmlPINVOKE.ASTNode_isSetId(swigCPtr); 1690 return ret; 1691 } 1692 1693 1694 /** 1695 * Returns @c true (nonzero) if this node has a value for the MathML 1696 * attribute 'class'. 1697 * 1698 * @return @c true if this ASTNode has an attribute class, @c false otherwise. 1699 * 1700 * @see isSetId() 1701 * @see isSetStyle() 1702 * @see @if java setClassName(string id)@else setClass()@endif 1703 * @see unsetClass() 1704 */ public isSetClass()1705 bool isSetClass() { 1706 bool ret = libsbmlPINVOKE.ASTNode_isSetClass(swigCPtr); 1707 return ret; 1708 } 1709 1710 1711 /** 1712 * Returns @c true (nonzero) if this node has a value for the MathML 1713 * attribute 'style'. 1714 * 1715 * @return @c true if this ASTNode has an attribute style, @c false otherwise. 1716 * 1717 * @see isSetClass() 1718 * @see isSetId() 1719 * @see setStyle(string id) 1720 * @see unsetStyle() 1721 */ public isSetStyle()1722 bool isSetStyle() { 1723 bool ret = libsbmlPINVOKE.ASTNode_isSetStyle(swigCPtr); 1724 return ret; 1725 } 1726 1727 1728 /** 1729 * Returns @c true (nonzero) if this node has the attribute 1730 * <code>sbml:units</code>. 1731 * 1732 * @htmlinclude about-sbml-units-attrib.html 1733 * 1734 * @return @c true if this ASTNode has units associated with it, @c false otherwise. 1735 * 1736 * @note The <code>sbml:units</code> attribute is only available in SBML 1737 * Level 3. It may not be used in Levels 1–2 of SBML. 1738 * 1739 * @see hasUnits() 1740 * @see setUnits(string units) 1741 */ public isSetUnits()1742 bool isSetUnits() { 1743 bool ret = libsbmlPINVOKE.ASTNode_isSetUnits(swigCPtr); 1744 return ret; 1745 } 1746 1747 1748 /** 1749 * Returns @c true (nonzero) if this node or any of its 1750 * children nodes have the attribute <code>sbml:units</code>. 1751 * 1752 * @htmlinclude about-sbml-units-attrib.html 1753 * 1754 * @return @c true if this ASTNode or its children has units associated 1755 * with it, @c false otherwise. 1756 * 1757 * @note The <code>sbml:units</code> attribute is only available in SBML 1758 * Level 3. It may not be used in Levels 1–2 of SBML. 1759 * 1760 * @see isSetUnits() 1761 * @see setUnits(string units) 1762 */ public hasUnits()1763 bool hasUnits() { 1764 bool ret = libsbmlPINVOKE.ASTNode_hasUnits(swigCPtr); 1765 return ret; 1766 } 1767 1768 1769 /** 1770 * Sets the value of this ASTNode to the given character. If character 1771 * is one of @c +, @c -, <code>*</code>, <code>/</code> or @c ^, the node 1772 * type will be set accordingly. For all other characters, the node type 1773 * will be set to @link libsbml#AST_UNKNOWN AST_UNKNOWN@endlink. 1774 * 1775 * @param value the character value to which the node's value should be 1776 * set. 1777 * 1778 * 1779 * @return integer value indicating success/failure of the 1780 * function. @if clike The value is drawn from the 1781 * enumeration #OperationReturnValues_t. @endif This particular 1782 * function only does one thing irrespective of user input or 1783 * object state, and thus will only return a single value: 1784 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1785 */ public setCharacter(char value)1786 int setCharacter(char value) { 1787 int ret = libsbmlPINVOKE.ASTNode_setCharacter(swigCPtr, value); 1788 return ret; 1789 } 1790 1791 1792 /** 1793 * Sets the MathML attribute @c id of this ASTNode. 1794 * 1795 * @param id @c string representing the identifier. 1796 * 1797 * 1798 * @return integer value indicating success/failure of the 1799 * function. @if clike The value is drawn from the 1800 * enumeration #OperationReturnValues_t. @endif This particular 1801 * function only does one thing irrespective of user input or 1802 * object state, and thus will only return a single value: 1803 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1804 * 1805 * @see isSetId() 1806 * @see getId() 1807 * @see unsetId() 1808 */ public setId(string id)1809 int setId(string id) { 1810 int ret = libsbmlPINVOKE.ASTNode_setId(swigCPtr, id); 1811 return ret; 1812 } 1813 1814 1815 /** 1816 * Sets the MathML attribute @c class of this ASTNode to @p className. 1817 * 1818 * @param className @c string representing the MathML class for this node. 1819 * 1820 * 1821 * @return integer value indicating success/failure of the 1822 * function. @if clike The value is drawn from the 1823 * enumeration #OperationReturnValues_t. @endif This particular 1824 * function only does one thing irrespective of user input or 1825 * object state, and thus will only return a single value: 1826 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1827 * 1828 * @if java 1829 * @note In the API interfaces for languages other than Java, this method 1830 * is named <code>setClass()</code>, but in Java it is renamed 1831 * <code>setClassName()</code> to avoid a name collision with Java's 1832 * standard object method of the same name. 1833 * @endif 1834 * 1835 * @see isSetClass() 1836 * @see getClass() 1837 * @see unsetClass() 1838 */ public setClass(string className)1839 int setClass(string className) { 1840 int ret = libsbmlPINVOKE.ASTNode_setClass(swigCPtr, className); 1841 return ret; 1842 } 1843 1844 1845 /** 1846 * Sets the MathML attribute @c style of this ASTNode to style. 1847 * 1848 * @param style @c string representing the identifier. 1849 * 1850 * 1851 * @return integer value indicating success/failure of the 1852 * function. @if clike The value is drawn from the 1853 * enumeration #OperationReturnValues_t. @endif This particular 1854 * function only does one thing irrespective of user input or 1855 * object state, and thus will only return a single value: 1856 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1857 * 1858 * @see isSetStyle() 1859 * @see getStyle() 1860 * @see unsetStyle() 1861 */ public setStyle(string style)1862 int setStyle(string style) { 1863 int ret = libsbmlPINVOKE.ASTNode_setStyle(swigCPtr, style); 1864 return ret; 1865 } 1866 1867 1868 /** 1869 * Sets the value of this ASTNode to the given name. 1870 * 1871 * As a side effect, this ASTNode object's type will be reset to 1872 * @link libsbml#AST_NAME AST_NAME@endlink if (and <em>only 1873 * if</em>) the ASTNode was previously an operator ( 1874 * @if clike isOperator()@else ASTNode::isOperator()@endif 1875 * <code>== true</code>), number ( 1876 * @if clike isNumber()@else ASTNode::isNumber()@endif 1877 * <code>== true</code>), or unknown. 1878 * This allows names to be set for @link libsbml#AST_FUNCTION AST_FUNCTION@endlink nodes and the like. 1879 * 1880 * @param name the string containing the name to which this node's value 1881 * should be set. 1882 * 1883 * 1884 * @return integer value indicating success/failure of the 1885 * function. @if clike The value is drawn from the 1886 * enumeration #OperationReturnValues_t. @endif This particular 1887 * function only does one thing irrespective of user input or 1888 * object state, and thus will only return a single value: 1889 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1890 */ public setName(string name)1891 int setName(string name) { 1892 int ret = libsbmlPINVOKE.ASTNode_setName(swigCPtr, name); 1893 return ret; 1894 } 1895 1896 1897 /** 1898 * Sets the value of this ASTNode to the given (@c long) integer and sets 1899 * the node type to @link libsbml#AST_INTEGER AST_INTEGER@endlink. 1900 * 1901 * @param value the integer to which this node's value should be set. 1902 * 1903 * 1904 * @return integer value indicating success/failure of the 1905 * function. @if clike The value is drawn from the 1906 * enumeration #OperationReturnValues_t. @endif This particular 1907 * function only does one thing irrespective of user input or 1908 * object state, and thus will only return a single value: 1909 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1910 */ public setValue(int value)1911 int setValue(int value) { 1912 int ret = libsbmlPINVOKE.ASTNode_setValue__SWIG_0(swigCPtr, value); 1913 return ret; 1914 } 1915 1916 1917 /** 1918 * Sets the value of this ASTNode to the given rational in two parts: the 1919 * numerator and denominator. The node type is set to @link libsbml#AST_RATIONAL AST_RATIONAL@endlink. 1920 * 1921 * @param numerator the numerator value of the rational. 1922 * @param denominator the denominator value of the rational. 1923 * 1924 * 1925 * @return integer value indicating success/failure of the 1926 * function. @if clike The value is drawn from the 1927 * enumeration #OperationReturnValues_t. @endif This particular 1928 * function only does one thing irrespective of user input or 1929 * object state, and thus will only return a single value: 1930 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1931 */ public setValue(int numerator, int denominator)1932 int setValue(int numerator, int denominator) { 1933 int ret = libsbmlPINVOKE.ASTNode_setValue__SWIG_1(swigCPtr, numerator, denominator); 1934 return ret; 1935 } 1936 1937 1938 /** 1939 * Sets the value of this ASTNode to the given real (@c double) and sets 1940 * the node type to @link libsbml#AST_REAL AST_REAL@endlink. 1941 * 1942 * This is functionally equivalent to: 1943 * @verbatim 1944 setValue(value, 0); 1945 @endverbatim 1946 * 1947 * @param value the @c double format number to which this node's value 1948 * should be set. 1949 * 1950 * 1951 * @return integer value indicating success/failure of the 1952 * function. @if clike The value is drawn from the 1953 * enumeration #OperationReturnValues_t. @endif This particular 1954 * function only does one thing irrespective of user input or 1955 * object state, and thus will only return a single value: 1956 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1957 */ public setValue(double value)1958 int setValue(double value) { 1959 int ret = libsbmlPINVOKE.ASTNode_setValue__SWIG_2(swigCPtr, value); 1960 return ret; 1961 } 1962 1963 1964 /** 1965 * Sets the value of this ASTNode to the given real (@c double) in two 1966 * parts: the mantissa and the exponent. The node type is set to 1967 * @link libsbml#AST_REAL_E AST_REAL_E@endlink. 1968 * 1969 * @param mantissa the mantissa of this node's real-numbered value. 1970 * @param exponent the exponent of this node's real-numbered value. 1971 * 1972 * 1973 * @return integer value indicating success/failure of the 1974 * function. @if clike The value is drawn from the 1975 * enumeration #OperationReturnValues_t. @endif This particular 1976 * function only does one thing irrespective of user input or 1977 * object state, and thus will only return a single value: 1978 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1979 */ public setValue(double mantissa, int exponent)1980 int setValue(double mantissa, int exponent) { 1981 int ret = libsbmlPINVOKE.ASTNode_setValue__SWIG_3(swigCPtr, mantissa, exponent); 1982 return ret; 1983 } 1984 1985 1986 /** 1987 * Sets the type of this ASTNode to the given type code. 1988 * 1989 * @param type the type to which this node should be set. 1990 * 1991 * 1992 * @return integer value indicating success/failure of the 1993 * function. @if clike The value is drawn from the 1994 * enumeration #OperationReturnValues_t. @endif The possible values 1995 * returned by this function are: 1996 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 1997 * @li @link libsbml#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE@endlink 1998 * 1999 * @note A side-effect of doing this is that any numerical values previously 2000 * stored in this node are reset to zero. 2001 */ public setType(int type)2002 int setType(int type) { 2003 int ret = libsbmlPINVOKE.ASTNode_setType(swigCPtr, type); 2004 return ret; 2005 } 2006 2007 2008 /** 2009 * Sets the units of this ASTNode to units. 2010 * 2011 * The units will be set @em only if this ASTNode object represents a 2012 * MathML <code><cn></code> element, i.e., represents a number. 2013 * Callers may use 2014 * @if clike isNumber()@else ASTNode::isNumber()@endif 2015 * to inquire whether the node is of that type. 2016 * 2017 * @htmlinclude about-sbml-units-attrib.html 2018 * 2019 * @param units @c string representing the unit identifier. 2020 * 2021 * 2022 * @return integer value indicating success/failure of the 2023 * function. @if clike The value is drawn from the 2024 * enumeration #OperationReturnValues_t. @endif The possible values 2025 * returned by this function are: 2026 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 2027 * @li @link libsbml#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE@endlink 2028 * @li @link libsbml#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE@endlink 2029 * 2030 * @note The <code>sbml:units</code> attribute is only available in SBML 2031 * Level 3. It may not be used in Levels 1–2 of SBML. 2032 * 2033 * @see isSetUnits() 2034 * @see hasUnits() 2035 */ public setUnits(string units)2036 int setUnits(string units) { 2037 int ret = libsbmlPINVOKE.ASTNode_setUnits(swigCPtr, units); 2038 return ret; 2039 } 2040 2041 2042 /** 2043 * Swaps the children of this ASTNode object with the children of the 2044 * given ASTNode object. 2045 * 2046 * @param that the other node whose children should be used to replace 2047 * <em>this</em> node's children. 2048 * 2049 * 2050 * @return integer value indicating success/failure of the 2051 * function. @if clike The value is drawn from the 2052 * enumeration #OperationReturnValues_t. @endif The possible values 2053 * returned by this function are: 2054 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 2055 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 2056 */ public swapChildren(ASTNode that)2057 int swapChildren(ASTNode that) { 2058 int ret = libsbmlPINVOKE.ASTNode_swapChildren(swigCPtr, ASTNode.getCPtr(that)); 2059 return ret; 2060 } 2061 2062 2063 /** 2064 * Renames all the SIdRef attributes on this node and any child node 2065 */ public new renameSIdRefs(string oldid, string newid)2066 void renameSIdRefs(string oldid, string newid) { 2067 libsbmlPINVOKE.ASTNode_renameSIdRefs(swigCPtr, oldid, newid); 2068 } 2069 2070 2071 /** 2072 * Renames all the UnitSIdRef attributes on this node and any child node. 2073 * 2074 * The only place UnitSIDRefs appear is in MathML <code><cn></code> 2075 * elements, so the effects of this method are limited to that. 2076 * 2077 * @param oldid the old identifier. 2078 * @param newid the new identifier. 2079 */ public new renameUnitSIdRefs(string oldid, string newid)2080 void renameUnitSIdRefs(string oldid, string newid) { 2081 libsbmlPINVOKE.ASTNode_renameUnitSIdRefs(swigCPtr, oldid, newid); 2082 } 2083 2084 2085 /** */ /* libsbml-internal */ public new replaceIDWithFunction(string id, ASTNode function)2086 void replaceIDWithFunction(string id, ASTNode function) { 2087 libsbmlPINVOKE.ASTNode_replaceIDWithFunction(swigCPtr, id, ASTNode.getCPtr(function)); 2088 } 2089 2090 2091 /** */ /* libsbml-internal */ public new multiplyTimeBy(ASTNode function)2092 void multiplyTimeBy(ASTNode function) { 2093 libsbmlPINVOKE.ASTNode_multiplyTimeBy(swigCPtr, ASTNode.getCPtr(function)); 2094 } 2095 2096 2097 /** 2098 * Unsets the units of this ASTNode. 2099 * 2100 * 2101 * @return integer value indicating success/failure of the 2102 * function. @if clike The value is drawn from the 2103 * enumeration #OperationReturnValues_t. @endif The possible values 2104 * returned by this function are: 2105 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 2106 * @li @link libsbml#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE@endlink 2107 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 2108 */ public unsetUnits()2109 int unsetUnits() { 2110 int ret = libsbmlPINVOKE.ASTNode_unsetUnits(swigCPtr); 2111 return ret; 2112 } 2113 2114 2115 /** 2116 * Unsets the MathML @c id attribute of this ASTNode. 2117 * 2118 * 2119 * @return integer value indicating success/failure of the 2120 * function. @if clike The value is drawn from the 2121 * enumeration #OperationReturnValues_t. @endif The possible values 2122 * returned by this function are: 2123 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 2124 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 2125 */ public unsetId()2126 int unsetId() { 2127 int ret = libsbmlPINVOKE.ASTNode_unsetId(swigCPtr); 2128 return ret; 2129 } 2130 2131 2132 /** 2133 * Unsets the MathML @c class attribute of this ASTNode. 2134 * 2135 * 2136 * @return integer value indicating success/failure of the 2137 * function. @if clike The value is drawn from the 2138 * enumeration #OperationReturnValues_t. @endif The possible values 2139 * returned by this function are: 2140 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 2141 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 2142 */ public unsetClass()2143 int unsetClass() { 2144 int ret = libsbmlPINVOKE.ASTNode_unsetClass(swigCPtr); 2145 return ret; 2146 } 2147 2148 2149 /** 2150 * Unsets the MathML @c style attribute of this ASTNode. 2151 * 2152 * 2153 * @return integer value indicating success/failure of the 2154 * function. @if clike The value is drawn from the 2155 * enumeration #OperationReturnValues_t. @endif The possible values 2156 * returned by this function are: 2157 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 2158 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 2159 */ public unsetStyle()2160 int unsetStyle() { 2161 int ret = libsbmlPINVOKE.ASTNode_unsetStyle(swigCPtr); 2162 return ret; 2163 } 2164 2165 2166 /** */ /* libsbml-internal */ public setDefinitionURL(XMLAttributes url)2167 int setDefinitionURL(XMLAttributes url) { 2168 int ret = libsbmlPINVOKE.ASTNode_setDefinitionURL__SWIG_0(swigCPtr, XMLAttributes.getCPtr(url)); 2169 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 2170 return ret; 2171 } 2172 2173 2174 /** */ /* libsbml-internal */ public setDefinitionURL(string url)2175 int setDefinitionURL(string url) { 2176 int ret = libsbmlPINVOKE.ASTNode_setDefinitionURL__SWIG_1(swigCPtr, url); 2177 return ret; 2178 } 2179 2180 2181 /** 2182 * Returns the MathML @c definitionURL attribute value. 2183 * 2184 * @return the value of the @c definitionURL attribute, in the form of 2185 * a libSBML XMLAttributes object. 2186 * 2187 * @see setDefinitionURL(XMLAttributes url) 2188 * @see setDefinitionURL(string url) 2189 * @see getDefinitionURLString() 2190 */ public getDefinitionURL()2191 XMLAttributes getDefinitionURL() { 2192 global::System.IntPtr cPtr = libsbmlPINVOKE.ASTNode_getDefinitionURL(swigCPtr); 2193 XMLAttributes ret = (cPtr == global::System.IntPtr.Zero) ? null : new XMLAttributes(cPtr, false); 2194 return ret; 2195 } 2196 2197 2198 /** 2199 * Replaces occurrences of a given name with a given ASTNode. 2200 * 2201 * For example, if the formula in this ASTNode is <code>x + y</code>, 2202 * and the function is called with @c bvar = @c 'x' and @c arg = an ASTNode 2203 * representing the real value @c 3. This method would substitute @c 3 for 2204 * @c x within this ASTNode object, resulting in the forula <code>3 + y</code>. 2205 * 2206 * @param bvar a string representing the variable name to be substituted. 2207 * @param arg an ASTNode representing the name/value/formula to use as 2208 * a replacement. 2209 */ public replaceArgument(string bvar, ASTNode arg)2210 void replaceArgument(string bvar, ASTNode arg) { 2211 libsbmlPINVOKE.ASTNode_replaceArgument(swigCPtr, bvar, ASTNode.getCPtr(arg)); 2212 } 2213 2214 2215 /** 2216 * Returns the parent SBML object. 2217 * 2218 * @return the parent SBML object of this ASTNode. 2219 * 2220 * @see isSetParentSBMLObject() 2221 * @if clike @see setParentSBMLObject()@endif 2222 * @see unsetParentSBMLObject() 2223 */ public getParentSBMLObject()2224 SBase getParentSBMLObject() { 2225 SBase ret = (SBase) libsbml.DowncastSBase(libsbmlPINVOKE.ASTNode_getParentSBMLObject(swigCPtr), false); 2226 return ret; 2227 } 2228 2229 2230 /** 2231 * Unsets the parent SBML object. 2232 * 2233 * 2234 * @return integer value indicating success/failure of the 2235 * function. @if clike The value is drawn from the 2236 * enumeration #OperationReturnValues_t. @endif The possible values 2237 * returned by this function are: 2238 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 2239 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 2240 * 2241 * @see isSetParentSBMLObject() 2242 * @see getParentSBMLObject() 2243 * @if clike @see setParentSBMLObject()@endif 2244 */ public unsetParentSBMLObject()2245 int unsetParentSBMLObject() { 2246 int ret = libsbmlPINVOKE.ASTNode_unsetParentSBMLObject(swigCPtr); 2247 return ret; 2248 } 2249 2250 2251 /** 2252 * Returns @c true if this node has a value for the parent SBML 2253 * object. 2254 * 2255 * @return @c true if this ASTNode has an parent SBML object set, @c false otherwise. 2256 * 2257 * @see getParentSBMLObject() 2258 * @if clike @see setParentSBMLObject()@endif 2259 * @see unsetParentSBMLObject() 2260 */ public isSetParentSBMLObject()2261 bool isSetParentSBMLObject() { 2262 bool ret = libsbmlPINVOKE.ASTNode_isSetParentSBMLObject(swigCPtr); 2263 return ret; 2264 } 2265 2266 2267 /** 2268 * Reduces this ASTNode to a binary tree. 2269 * 2270 * Example: if this ASTNode is <code>and(x, y, z)</code>, then the 2271 * formula of the reduced node is <code>and(and(x, y), z)</code>. The 2272 * operation replaces the formula stored in the current ASTNode object. 2273 */ public reduceToBinary()2274 void reduceToBinary() { 2275 libsbmlPINVOKE.ASTNode_reduceToBinary(swigCPtr); 2276 } 2277 2278 2279 /** 2280 * Unsets the user data of this node. 2281 * 2282 * The user data can be used by the application developer to attach custom 2283 * information to the node. In case of a deep copy, this attribute will 2284 * passed as it is. The attribute will be never interpreted by this class. 2285 * 2286 * 2287 * @return integer value indicating success/failure of the 2288 * function. @if clike The value is drawn from the 2289 * enumeration #OperationReturnValues_t. @endif The possible values 2290 * returned by this function are: 2291 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 2292 * @li @link libsbml#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED@endlink 2293 * 2294 * @if clike 2295 * @see setUserData() 2296 * @see getUserData() 2297 * @see isSetUserData() 2298 * @endif 2299 */ public unsetUserData()2300 int unsetUserData() { 2301 int ret = libsbmlPINVOKE.ASTNode_unsetUserData(swigCPtr); 2302 return ret; 2303 } 2304 2305 2306 /** 2307 * Returns @c true if this node has a user data object. 2308 * 2309 * @return @c true if this ASTNode has a user data object set, @c false 2310 * otherwise. 2311 * 2312 * @if clike 2313 * @see setUserData() 2314 * @see getUserData() 2315 * @see unsetUserData() 2316 * @endif 2317 */ public isSetUserData()2318 bool isSetUserData() { 2319 bool ret = libsbmlPINVOKE.ASTNode_isSetUserData(swigCPtr); 2320 return ret; 2321 } 2322 2323 2324 /** 2325 * Returns @c true or @c false depending on whether this 2326 * ASTNode is well-formed. 2327 * 2328 * @note An ASTNode may be well-formed, with each node and its children 2329 * having the appropriate number of children for the given type, but may 2330 * still be invalid in the context of its use within an SBML model. 2331 * 2332 * @return @c true if this ASTNode is well-formed, @c false otherwise. 2333 * 2334 * @see hasCorrectNumberArguments() 2335 */ public isWellFormedASTNode()2336 bool isWellFormedASTNode() { 2337 bool ret = libsbmlPINVOKE.ASTNode_isWellFormedASTNode(swigCPtr); 2338 return ret; 2339 } 2340 2341 2342 /** 2343 * Returns @c true if this ASTNode has the correct number of children for 2344 * its type. 2345 * 2346 * For example, an ASTNode with type @link libsbml#AST_MINUS AST_MINUS@endlink 2347 * expects 1 or 2 child nodes. 2348 * 2349 * @return @c true if this ASTNode has the appropriate number of children 2350 * for its type, @c false otherwise. 2351 * 2352 * @note This function performs a check on the top-level node only. Child 2353 * nodes are not checked. 2354 * 2355 * @see isWellFormedASTNode() 2356 */ public hasCorrectNumberArguments()2357 bool hasCorrectNumberArguments() { 2358 bool ret = libsbmlPINVOKE.ASTNode_hasCorrectNumberArguments(swigCPtr); 2359 return ret; 2360 } 2361 2362 2363 /** 2364 * Returns the MathML @c definitionURL attribute value as a string. 2365 * 2366 * @return the value of the @c definitionURL attribute, as a string. 2367 * 2368 * @see getDefinitionURL() 2369 * @see setDefinitionURL(string url) 2370 * @see setDefinitionURL(XMLAttributes url) 2371 */ public getDefinitionURLString()2372 string getDefinitionURLString() { 2373 string ret = libsbmlPINVOKE.ASTNode_getDefinitionURLString(swigCPtr); 2374 return ret; 2375 } 2376 2377 2378 /** */ /* libsbml-internal */ public representsBvar()2379 bool representsBvar() { 2380 bool ret = libsbmlPINVOKE.ASTNode_representsBvar(swigCPtr); 2381 return ret; 2382 } 2383 2384 2385 /** */ /* libsbml-internal */ public isBvar()2386 bool isBvar() { 2387 bool ret = libsbmlPINVOKE.ASTNode_isBvar(swigCPtr); 2388 return ret; 2389 } 2390 2391 2392 /** */ /* libsbml-internal */ public setBvar()2393 void setBvar() { 2394 libsbmlPINVOKE.ASTNode_setBvar(swigCPtr); 2395 } 2396 2397 2398 /** */ /* libsbml-internal */ public usesL3V2MathConstructs()2399 bool usesL3V2MathConstructs() { 2400 bool ret = libsbmlPINVOKE.ASTNode_usesL3V2MathConstructs(swigCPtr); 2401 return ret; 2402 } 2403 2404 2405 /** */ /* libsbml-internal */ public usesRateOf()2406 bool usesRateOf() { 2407 bool ret = libsbmlPINVOKE.ASTNode_usesRateOf(swigCPtr); 2408 return ret; 2409 } 2410 2411 2412 /** */ /* libsbml-internal */ public new isQualifier()2413 bool isQualifier() { 2414 bool ret = libsbmlPINVOKE.ASTNode_isQualifier(swigCPtr); 2415 return ret; 2416 } 2417 2418 2419 /** */ /* libsbml-internal */ public new isSemantics()2420 bool isSemantics() { 2421 bool ret = libsbmlPINVOKE.ASTNode_isSemantics(swigCPtr); 2422 return ret; 2423 } 2424 2425 2426 /** */ /* libsbml-internal */ public getNumBvars()2427 long getNumBvars() { return (long)libsbmlPINVOKE.ASTNode_getNumBvars(swigCPtr); } 2428 2429 2430 /** */ /* libsbml-internal */ public addPlugin(ASTBasePlugin plugin)2431 void addPlugin(ASTBasePlugin plugin) { 2432 libsbmlPINVOKE.ASTNode_addPlugin(swigCPtr, ASTBasePlugin.getCPtr(plugin)); 2433 } 2434 2435 2436 /** */ /* libsbml-internal */ public loadASTPlugins(SBMLNamespaces sbmlns)2437 void loadASTPlugins(SBMLNamespaces sbmlns) { 2438 libsbmlPINVOKE.ASTNode_loadASTPlugins(swigCPtr, SBMLNamespaces.getCPtr(sbmlns)); 2439 } 2440 2441 2442 /** */ /* libsbml-internal */ public loadASTPlugin(string pkgName)2443 void loadASTPlugin(string pkgName) { 2444 libsbmlPINVOKE.ASTNode_loadASTPlugin(swigCPtr, pkgName); 2445 } 2446 2447 2448 /** 2449 * Returns a plug-in object (extension interface) for an SBML Level 3 2450 * package extension with the given @p sbmlns. 2451 * 2452 * @param sbmlns the namespace of the plugin to return. 2453 * 2454 * @return the plug-in object (the libSBML extension interface) of 2455 * a package extension with the given package name or URI, or @c null 2456 * if none exist. 2457 */ public getASTPlugin(SBMLNamespaces sbmlns)2458 ASTBasePlugin getASTPlugin(SBMLNamespaces sbmlns) { 2459 ASTBasePlugin ret = (ASTBasePlugin) libsbml.DowncastASTBasePlugin(libsbmlPINVOKE.ASTNode_getASTPlugin__SWIG_0(swigCPtr, SBMLNamespaces.getCPtr(sbmlns)), false); 2460 return ret; 2461 } 2462 2463 2464 /** 2465 * Returns a plug-in object (extension interface) for an SBML Level 3 2466 * package extension for the package that defines the given @p type. 2467 * 2468 * @param type the @if clike #ASTNodeType_t@else type@endif that is defined by the given plugin. 2469 * 2470 * @return the plug-in object (the libSBML extension interface) of 2471 * a package extension that defines the given @p type, or @c null 2472 * if none exist. 2473 */ public getASTPlugin(int type)2474 ASTBasePlugin getASTPlugin(int type) { 2475 ASTBasePlugin ret = (ASTBasePlugin) libsbml.DowncastASTBasePlugin(libsbmlPINVOKE.ASTNode_getASTPlugin__SWIG_1(swigCPtr, type), false); 2476 return ret; 2477 } 2478 2479 2480 /** 2481 * Returns a plug-in object (extension interface) for an SBML Level 3 2482 * package extension for the package with the given constraints. 2483 * 2484 * @param name the type or csymbol defined by the returned plugin. 2485 * @param isCsymbol Boolean indicator of whether the @p name is a csymbol 2486 * (if @c true) or type (if @c false). 2487 * @param strCmpIsCaseSensitive whether to search for the matching type 2488 * or csymbol in case-sensitve manner (if @c true) or case-insensitive 2489 * manner (if @c false). 2490 * 2491 * @return the plug-in object (the libSBML extension interface) of 2492 * a package extension that defines the given @p name, or @c null 2493 * if none exist. 2494 */ public getASTPlugin(string name, bool isCsymbol, bool strCmpIsCaseSensitive)2495 ASTBasePlugin getASTPlugin(string name, bool isCsymbol, bool strCmpIsCaseSensitive) { 2496 ASTBasePlugin ret = (ASTBasePlugin) libsbml.DowncastASTBasePlugin(libsbmlPINVOKE.ASTNode_getASTPlugin__SWIG_2(swigCPtr, name, isCsymbol, strCmpIsCaseSensitive), false); 2497 return ret; 2498 } 2499 2500 2501 /** 2502 * Returns a plug-in object (extension interface) for an SBML Level 3 2503 * package extension for the package with the given constraints. 2504 * 2505 * @param name the type or csymbol defined by the returned plugin. 2506 * @param isCsymbol Boolean indicator of whether the @p name is a csymbol 2507 * (if @c true) or type (if @c false). 2508 * @param strCmpIsCaseSensitive whether to search for the matching type 2509 * or csymbol in case-sensitve manner (if @c true) or case-insensitive 2510 * manner (if @c false). 2511 * 2512 * @return the plug-in object (the libSBML extension interface) of 2513 * a package extension that defines the given @p name, or @c null 2514 * if none exist. 2515 */ public getASTPlugin(string name, bool isCsymbol)2516 ASTBasePlugin getASTPlugin(string name, bool isCsymbol) { 2517 ASTBasePlugin ret = (ASTBasePlugin) libsbml.DowncastASTBasePlugin(libsbmlPINVOKE.ASTNode_getASTPlugin__SWIG_3(swigCPtr, name, isCsymbol), false); 2518 return ret; 2519 } 2520 2521 2522 /** 2523 * Returns a plug-in object (extension interface) for an SBML Level 3 2524 * package extension for the package with the given constraints. 2525 * 2526 * @param name the type or csymbol defined by the returned plugin. 2527 * @param isCsymbol Boolean indicator of whether the @p name is a csymbol 2528 * (if @c true) or type (if @c false). 2529 * @param strCmpIsCaseSensitive whether to search for the matching type 2530 * or csymbol in case-sensitve manner (if @c true) or case-insensitive 2531 * manner (if @c false). 2532 * 2533 * @return the plug-in object (the libSBML extension interface) of 2534 * a package extension that defines the given @p name, or @c null 2535 * if none exist. 2536 */ public getASTPlugin(string name)2537 ASTBasePlugin getASTPlugin(string name) { 2538 ASTBasePlugin ret = (ASTBasePlugin) libsbml.DowncastASTBasePlugin(libsbmlPINVOKE.ASTNode_getASTPlugin__SWIG_4(swigCPtr, name), false); 2539 return ret; 2540 } 2541 2542 2543 /** */ /* libsbml-internal */ public getPlugin(string package)2544 ASTBasePlugin getPlugin(string package) { 2545 ASTBasePlugin ret = (ASTBasePlugin) libsbml.DowncastASTBasePlugin(libsbmlPINVOKE.ASTNode_getPlugin__SWIG_0(swigCPtr, package), false); 2546 return ret; 2547 } 2548 2549 2550 /** */ /* libsbml-internal */ public getPlugin(long n)2551 ASTBasePlugin getPlugin(long n) { 2552 ASTBasePlugin ret = (ASTBasePlugin) libsbml.DowncastASTBasePlugin(libsbmlPINVOKE.ASTNode_getPlugin__SWIG_2(swigCPtr, n), false); 2553 return ret; 2554 } 2555 2556 2557 /** */ /* libsbml-internal */ public getNumPlugins()2558 long getNumPlugins() { return (long)libsbmlPINVOKE.ASTNode_getNumPlugins(swigCPtr); } 2559 getListOfNodes()2560 public ASTNodeList getListOfNodes() { 2561 ASTNodeList ret = new ASTNodeList(libsbmlPINVOKE.ASTNode_getListOfNodes(swigCPtr), true); 2562 return ret; 2563 } 2564 2565 } 2566 2567 } 2568