001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 3.0.12 004 * 005 * Do not make changes to this file unless you know what you are doing--modify 006 * the SWIG interface file instead. 007 * ----------------------------------------------------------------------------- */ 008 009package org.sbml.libsbml; 010 011/** 012 * Controls the behavior of the Level 3 formula parser. 013 <p> 014 * <p style='color: #777; font-style: italic'> 015This class of objects is defined by libSBML only and has no direct 016equivalent in terms of SBML components. This class is not prescribed by 017the SBML specifications, although it is used to implement features 018defined in SBML. 019</p> 020 021 <p> 022 * The function 023 * <a href='libsbml.html#parseL3FormulaWithSettings(java.lang.String, org.sbml.libsbml.L3ParserSettings)'><code>libsbml.parseL3FormulaWithSettings(String, L3ParserSettings)</code></a>, 024 * along with its variants <a href='libsbml.html#parseL3Formula(java.lang.String)'><code>libsbml.parseL3Formula(String)</code></a> and 025 * <a href='libsbml.html#parseL3FormulaWithModel(java.lang.String, org.sbml.libsbml.Model)'><code>libsbml.parseL3FormulaWithModel(String, Model)</code></a>, 026 * are the interfaces to a parser for mathematical formulas written as 027 * text strings. The inverse function is <a href='libsbml.html#formulaToL3String(org.sbml.libsbml.ASTNode)'><code>libsbml.formulaToL3String(ASTNode)</code></a> and its variants such as 028 * <a href='libsbml.html#formulaToL3StringWithSettings(org.sbml.libsbml.ASTNode, org.sbml.libsbml.L3ParserSettings)'><code>libsbml.formulaToL3StringWithSettings(ASTNode, L3ParserSettings)</code></a>. 029 * The parsers and the formula writers convert between a text-string 030 * representation of mathematical formulas and Abstract Syntax Trees (ASTs), 031 * represented in libSBML using {@link ASTNode} objects. 032 * Compared to the parser and writer implemented by the functions 033 * <a href='libsbml.html#parseFormula(java.lang.String)'><code>libsbml.parseFormula(String)</code></a> and 034 * <a href='libsbml.html#formulaToString(org.sbml.libsbml.ASTNode)'><code>libsbml.formulaToString(ASTNode)</code></a>, 035 * which were designed primarily for converting the mathematical formula 036 * strings in SBML Level 1, the SBML Level 3 or 'L3' variants of 037 * the parser and writer use an extended formula syntax. They also have a 038 * number of configurable behaviors. This class (L3ParserSettings) is an 039 * object used to communicate the configuration settings with callers. 040 <p> 041 * The following aspects of the parser are configurable using 042 * {@link L3ParserSettings} objects. (For the formula writer, only a subset of these 043 * settings is relevant; please see the documentation for 044 * <a href='libsbml.html#formulaToL3StringWithSettings(org.sbml.libsbml.ASTNode, org.sbml.libsbml.L3ParserSettings)'><code>libsbml.formulaToL3StringWithSettings(ASTNode, L3ParserSettings)</code></a> for more information about which ones). 045 <p> 046 * <p> 047 * <ul> 048 * <li> A {@link Model} object may optionally be provided to use identifiers (values 049 * of type <code>SId</code>) from the model in preference to pre-defined MathML symbols 050 * More precisely, the {@link Model} entities whose identifiers will shadow identical 051 * symbols in the mathematical formula are: {@link Species}, {@link Compartment}, {@link Parameter}, 052 * {@link Reaction}, and {@link SpeciesReference}. For instance, if the parser is given a 053 * {@link Model} containing a {@link Species} with the identifier 054 * "<code>pi</code>", and the formula to be parsed is 055 * "<code>3*pi</code>", the MathML produced by the parser will 056 * contain the construct <code><ci> pi </ci></code> instead of 057 * the construct <code><pi/></code>. Another example, if the passed-in 058 * {@link Model} contains a {@link FunctionDefinition} with the identifier 059 * "<code>sin</code>", that function will be used instead of the 060 * predefined MathML function <code><sin/></code>. 061 * <li> The function <code>log</code> with a single argument 062 * ("<code>log(x)</code>") can be parsed as <code>log10(x)</code>, 063 * <code>ln(x)</code>, or treated as an error, as desired. 064 * <li> Unary minus signs can be either collapsed or preserved; that is, the 065 * parser can either (1) remove sequential pairs of unary minuses (e.g., 066 * "<code>- -3</code>") from the input and incorporate single unary 067 * minuses into the number node, or (2) preserve all minuses in the AST node 068 * structure, turning them into {@link ASTNode} objects of type 069 * {@link libsbmlConstants#AST_MINUS AST_MINUS}. 070 * <li> The character sequence "<code>number id</code>" can be 071 * interpreted as a numerical value <code>number</code> followed by units of measurement 072 * indicated by <code>id</code>, or it can be treated as a syntax error. (In 073 * Level 3, MathML <code><cn></code> elements can have an 074 * attribute named <code>units</code> placed in the SBML namespace, which can be used 075 * to indicate the units to be associated with the number. The text-string 076 * infix formula parser allows units to be placed after raw numbers; they are 077 * interpreted as unit identifiers for units defined by the SBML 078 * specification or in the containing {@link Model} object.) 079 * <li> The symbol <code>avogadro</code> can be parsed either as a MathML <em>csymbol</em> or 080 * as a identifier. More specifically, "<code>avogadro</code>" can 081 * be treated as an {@link ASTNode} of type 082 * {@link libsbmlConstants#AST_NAME_AVOGADRO AST_NAME_AVOGADRO} or of type 083 * {@link libsbmlConstants#AST_NAME AST_NAME}. 084 * <li> Strings that match built-in functions and constants can either be parsed 085 * as a match regardless of capitalization, or may be required to be 086 * all-lower-case to be considered a match. 087 * <li> LibSBML plug-ins implementing support for SBML Level 3 packages 088 * may introduce extensions to the syntax understood by the parser. The 089 * precise nature of the extensions will be documented by the individual 090 * package plug-ins. An example of a possible extension is a notation for 091 * vectors and arrays, introduced by the SBML Level 3 <em>Arrays</em> 092 * package. 093 * 094 * </ul> 095 <p> 096 * To obtain the default configuration values, callers can use the function 097 * <a href='libsbml.html#getDefaultL3ParserSettings()'><code>libsbml.getDefaultL3ParserSettings()</code></a>. To change the configuration, 098 * callers can create an {@link L3ParserSettings} object, set the desired 099 * characteristics using the methods provided, and pass that object to 100 * <a href='libsbml.html#parseL3FormulaWithSettings(java.lang.String, org.sbml.libsbml.L3ParserSettings)'><code>libsbml.parseL3FormulaWithSettings(String formula, L3ParserSettings settings)</code></a>. 101 <p> 102 * @see <a href='libsbml.html#parseL3Formula(java.lang.String)'><code>libsbml.parseL3Formula(String)</code></a> 103 * @see <a href='libsbml.html#parseL3FormulaWithSettings(java.lang.String, org.sbml.libsbml.L3ParserSettings)'><code>libsbml.parseL3FormulaWithSettings(String, L3ParserSettings)</code></a> 104 * @see <a href='libsbml.html#parseL3FormulaWithModel(java.lang.String, org.sbml.libsbml.Model)'><code>libsbml.parseL3FormulaWithModel(String, Model)</code></a> 105 * @see <a href='libsbml.html#parseFormula(java.lang.String)'><code>libsbml.parseFormula(String)</code></a> 106 * @see <a href='libsbml.html#formulaToL3StringWithSettings(org.sbml.libsbml.ASTNode, org.sbml.libsbml.L3ParserSettings)'><code>libsbml.formulaToL3StringWithSettings(ASTNode, L3ParserSettings)</code></a> 107 * @see <a href='libsbml.html#formulaToL3String(org.sbml.libsbml.ASTNode)'><code>libsbml.formulaToL3String(ASTNode)</code></a> 108 * @see <a href='libsbml.html#formulaToString(org.sbml.libsbml.ASTNode)'><code>libsbml.formulaToString(ASTNode)</code></a> 109 * @see <a href='libsbml.html#getDefaultL3ParserSettings()'><code>libsbml.getDefaultL3ParserSettings()</code></a> 110 */ 111 112public class L3ParserSettings { 113 private long swigCPtr; 114 protected boolean swigCMemOwn; 115 116 protected L3ParserSettings(long cPtr, boolean cMemoryOwn) 117 { 118 swigCMemOwn = cMemoryOwn; 119 swigCPtr = cPtr; 120 } 121 122 protected static long getCPtr(L3ParserSettings obj) 123 { 124 return (obj == null) ? 0 : obj.swigCPtr; 125 } 126 127 protected static long getCPtrAndDisown (L3ParserSettings obj) 128 { 129 long ptr = 0; 130 131 if (obj != null) 132 { 133 ptr = obj.swigCPtr; 134 obj.swigCMemOwn = false; 135 } 136 137 return ptr; 138 } 139 140 protected void finalize() { 141 delete(); 142 } 143 144 public synchronized void delete() { 145 if (swigCPtr != 0) { 146 if (swigCMemOwn) { 147 swigCMemOwn = false; 148 libsbmlJNI.delete_L3ParserSettings(swigCPtr); 149 } 150 swigCPtr = 0; 151 } 152 } 153 154 155/** 156 * Creates a new {@link L3ParserSettings} object with default values. 157 <p> 158 * This is the default constructor for the {@link L3ParserSettings} object. It 159 * sets the stored {@link Model} object to <code>null</code> and sets the following 160 * field values in the {@link L3ParserSettings} object: 161 <p> 162 * <ul> 163 * <li> <em>parseunits</em> ('parse units') is set to 164 * {@link libsbmlConstants#L3P_PARSE_UNITS L3P_PARSE_UNITS}. 165 <p> 166 * <li> <em>collapseminus</em> ('collapse minus') is set to 167 * {@link libsbmlConstants#L3P_EXPAND_UNARY_MINUS L3P_EXPAND_UNARY_MINUS}. 168 <p> 169 * <li> <em>parselog</em> ('parse log') is set to 170 * {@link libsbmlConstants#L3P_PARSE_LOG_AS_LOG10 L3P_PARSE_LOG_AS_LOG10}. 171 <p> 172 * <li> <em>avocsymbol</em> ('Avogadro csymbol') is set to 173 * {@link libsbmlConstants#L3P_AVOGADRO_IS_CSYMBOL L3P_AVOGADRO_IS_CSYMBOL}. 174 <p> 175 * <li> <em>caseSensitive</em> ('case sensitive') is set to 176 * {@link libsbmlConstants#L3P_COMPARE_BUILTINS_CASE_INSENSITIVE L3P_COMPARE_BUILTINS_CASE_INSENSITIVE}. 177 <p> 178 * <li> <em>moduloL3v2</em> ('modulo l3v2') is set to 179 * {@link libsbmlConstants#L3P_MODULO_IS_PIECEWISE L3P_MODULO_IS_PIECEWISE}. 180 <p> 181 * <li> <em>sbmlns</em> ('SBML namespaces') is set to <code>null</code> (which 182 * indicates that no syntax extensions due to SBML Level 3 packages 183 * will be assumed—the formula parser will only understand the 184 * core syntax described in the documentation for 185 * <a href='libsbml.html#parseL3Formula(java.lang.String)'><code>libsbml.parseL3Formula(String)</code></a>). 186 * </ul> 187 */ public 188 L3ParserSettings() { 189 this(libsbmlJNI.new_L3ParserSettings__SWIG_0(), true); 190 } 191 192 193/** 194 * Creates a new {@link L3ParserSettings} object with specific values for all 195 * possible settings. 196 <p> 197 * @param model a {@link Model} object to be used for disambiguating identifiers 198 * encountered by <a href='libsbml.html#parseL3FormulaWithSettings(java.lang.String, org.sbml.libsbml.L3ParserSettings)'><code>libsbml.parseL3FormulaWithSettings(String, L3ParserSettings)</code></a> in mathematical formulas. 199 <p> 200 * @param parselog ('parse log') a flag that controls how the parser will 201 * handle the symbol <code>log</code> in mathematical formulas. The function <code>log</code> 202 * with a single argument ("<code>log(x)</code>") can be parsed 203 * as <code>log10(x)</code>, <code>ln(x)</code>, or treated as an error, as 204 * desired, by using the parameter values 205 * {@link libsbmlConstants#L3P_PARSE_LOG_AS_LOG10 L3P_PARSE_LOG_AS_LOG10}, 206 * {@link libsbmlConstants#L3P_PARSE_LOG_AS_LN L3P_PARSE_LOG_AS_LN}, or 207 * {@link libsbmlConstants#L3P_PARSE_LOG_AS_ERROR L3P_PARSE_LOG_AS_ERROR}, respectively. 208 <p> 209 * @param collapseminus ('collapse minus') a flag that controls how the 210 * parser will handle minus signs in formulas. Unary minus signs can be 211 * collapsed or preserved; that is, sequential pairs of unary minuses 212 * (e.g., "<code>- -3</code>") can be removed from the input 213 * entirely and single unary minuses can be incorporated into the number 214 * node, or all minuses can be preserved in the AST node structure. 215 * The possible values of this field are 216 * {@link libsbmlConstants#L3P_COLLAPSE_UNARY_MINUS L3P_COLLAPSE_UNARY_MINUS} (to collapse unary minuses) and 217 * {@link libsbmlConstants#L3P_EXPAND_UNARY_MINUS L3P_EXPAND_UNARY_MINUS} (to expand unary minuses). 218 <p> 219 * @param parseunits ('parse units') a flag that controls how the parser 220 * will handle apparent references to units of measurement associated with 221 * raw numbers in a formula. If set to the value 222 * {@link libsbmlConstants#L3P_PARSE_UNITS L3P_PARSE_UNITS}, units are parsed; if set to the value 223 * {@link libsbmlConstants#L3P_NO_UNITS L3P_NO_UNITS}, units are not parsed. 224 <p> 225 * @param avocsymbol ('Avogadro csymbol') a flag that controls how the 226 * parser will handle the appearance of the symbol <code>avogadro</code> in a 227 * formula. If set to the value {@link libsbmlConstants#L3P_AVOGADRO_IS_CSYMBOL L3P_AVOGADRO_IS_CSYMBOL}, 228 * the symbol is interpreted as the SBML/MathML <em>csymbol</em> <code>avogadro</code>; if 229 * set to the value {@link libsbmlConstants#L3P_AVOGADRO_IS_NAME L3P_AVOGADRO_IS_NAME}, the symbol is 230 * interpreted as a plain symbol name. 231 <p> 232 * @param caseSensitive ('case sensitive') a flag that controls how the 233 * cases of alphabetical characters are treated when symbols are compared. 234 * If the flag is set to the value 235 * {@link libsbmlConstants#L3P_COMPARE_BUILTINS_CASE_INSENSITIVE L3P_COMPARE_BUILTINS_CASE_INSENSITIVE}, symbols are 236 * compared in a case-insensitive manner, which means that mathematical 237 * functions such as <code>'sin'</code> will be matched no matter what their case is: 238 * <code>'Sin'</code>, <code>'SIN'</code>, etc. If the flag is set to the value 239 * {@link libsbmlConstants#L3P_COMPARE_BUILTINS_CASE_SENSITIVE L3P_COMPARE_BUILTINS_CASE_SENSITIVE}, symbols are 240 * interpreted in a case-sensitive manner. 241 <p> 242 * @param moduloL3v2 ('modulo l3v2') a flag that controls how the 243 * parser will handle the '%' ('modulo') symbol in formulas. By default, 244 * the parser will convert 'a % b' to a piecewise function that properly 245 * calculates the remainder of a with respect to be, but the parser can 246 * also be set to produce the MathML <code>rem</code> function, should the target 247 * of the produced {@link ASTNode} be an SBML Level 3 Version 2 248 * document, where the <code>rem</code> function is legal. 249 * The possible values of this field are 250 * {@link libsbmlConstants#L3P_MODULO_IS_PIECEWISE L3P_MODULO_IS_PIECEWISE} (to parse '%' as a piecewise function) and 251 * {@link libsbmlConstants#L3P_MODULO_IS_REM L3P_MODULO_IS_REM} (to parse '%' as <code>rem</code>). 252 <p> 253 * @param sbmlns ('SBML namespaces') an SBML namespaces object. The 254 * namespaces identify the SBML Level 3 packages that can extend the 255 * syntax understood by the formula parser. When non-<code>null</code>, the parser 256 * will interpret additional syntax defined by the packages; for example, 257 * it may understand vector/array extensions introduced by the SBML 258 * Level 3 <em>Arrays</em> package. 259 <p> 260 * @param l3v2functions a Boolean 261 <p> 262 * 263</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 264The native C++ implementation of this method defines a default argument 265value. In the documentation generated for different libSBML language 266bindings, you may or may not see corresponding arguments in the method 267declarations. For example, in Java and C#, a default argument is handled by 268declaring two separate methods, with one of them having the argument and 269the other one lacking the argument. However, the libSBML documentation will 270be <em>identical</em> for both methods. Consequently, if you are reading 271this and do not see an argument even though one is described, please look 272for descriptions of other variants of this method near where this one 273appears in the documentation. 274</dd></dl> 275 276 <p> 277 * @see #getModel() 278 * @see #setModel(Model) 279 * @see #unsetModel() 280 * @see #getParseLog() 281 * @see #setParseLog(int) 282 * @see #getParseUnits() 283 * @see #setParseUnits(boolean) 284 * @see #getParseCollapseMinus() 285 * @see #setParseCollapseMinus(boolean) 286 * @see #getParseAvogadroCsymbol() 287 * @see #setParseAvogadroCsymbol(boolean) 288 * @see #getParseModuloL3v2() 289 * @see #setParseModuloL3v2(boolean) 290 * @see #getParseL3v2Functions() 291 * @see #setParseL3v2Functions(boolean) 292 */ public 293 L3ParserSettings(Model model, int parselog, boolean collapseminus, boolean parseunits, boolean avocsymbol, boolean caseSensitive, SBMLNamespaces sbmlns, boolean moduloL3v2, boolean l3v2functions) { 294 this(libsbmlJNI.new_L3ParserSettings__SWIG_1(Model.getCPtr(model), model, parselog, collapseminus, parseunits, avocsymbol, caseSensitive, SBMLNamespaces.getCPtr(sbmlns), sbmlns, moduloL3v2, l3v2functions), true); 295 } 296 297 298/** 299 * Creates a new {@link L3ParserSettings} object with specific values for all 300 * possible settings. 301 <p> 302 * @param model a {@link Model} object to be used for disambiguating identifiers 303 * encountered by <a href='libsbml.html#parseL3FormulaWithSettings(java.lang.String, org.sbml.libsbml.L3ParserSettings)'><code>libsbml.parseL3FormulaWithSettings(String, L3ParserSettings)</code></a> in mathematical formulas. 304 <p> 305 * @param parselog ('parse log') a flag that controls how the parser will 306 * handle the symbol <code>log</code> in mathematical formulas. The function <code>log</code> 307 * with a single argument ("<code>log(x)</code>") can be parsed 308 * as <code>log10(x)</code>, <code>ln(x)</code>, or treated as an error, as 309 * desired, by using the parameter values 310 * {@link libsbmlConstants#L3P_PARSE_LOG_AS_LOG10 L3P_PARSE_LOG_AS_LOG10}, 311 * {@link libsbmlConstants#L3P_PARSE_LOG_AS_LN L3P_PARSE_LOG_AS_LN}, or 312 * {@link libsbmlConstants#L3P_PARSE_LOG_AS_ERROR L3P_PARSE_LOG_AS_ERROR}, respectively. 313 <p> 314 * @param collapseminus ('collapse minus') a flag that controls how the 315 * parser will handle minus signs in formulas. Unary minus signs can be 316 * collapsed or preserved; that is, sequential pairs of unary minuses 317 * (e.g., "<code>- -3</code>") can be removed from the input 318 * entirely and single unary minuses can be incorporated into the number 319 * node, or all minuses can be preserved in the AST node structure. 320 * The possible values of this field are 321 * {@link libsbmlConstants#L3P_COLLAPSE_UNARY_MINUS L3P_COLLAPSE_UNARY_MINUS} (to collapse unary minuses) and 322 * {@link libsbmlConstants#L3P_EXPAND_UNARY_MINUS L3P_EXPAND_UNARY_MINUS} (to expand unary minuses). 323 <p> 324 * @param parseunits ('parse units') a flag that controls how the parser 325 * will handle apparent references to units of measurement associated with 326 * raw numbers in a formula. If set to the value 327 * {@link libsbmlConstants#L3P_PARSE_UNITS L3P_PARSE_UNITS}, units are parsed; if set to the value 328 * {@link libsbmlConstants#L3P_NO_UNITS L3P_NO_UNITS}, units are not parsed. 329 <p> 330 * @param avocsymbol ('Avogadro csymbol') a flag that controls how the 331 * parser will handle the appearance of the symbol <code>avogadro</code> in a 332 * formula. If set to the value {@link libsbmlConstants#L3P_AVOGADRO_IS_CSYMBOL L3P_AVOGADRO_IS_CSYMBOL}, 333 * the symbol is interpreted as the SBML/MathML <em>csymbol</em> <code>avogadro</code>; if 334 * set to the value {@link libsbmlConstants#L3P_AVOGADRO_IS_NAME L3P_AVOGADRO_IS_NAME}, the symbol is 335 * interpreted as a plain symbol name. 336 <p> 337 * @param caseSensitive ('case sensitive') a flag that controls how the 338 * cases of alphabetical characters are treated when symbols are compared. 339 * If the flag is set to the value 340 * {@link libsbmlConstants#L3P_COMPARE_BUILTINS_CASE_INSENSITIVE L3P_COMPARE_BUILTINS_CASE_INSENSITIVE}, symbols are 341 * compared in a case-insensitive manner, which means that mathematical 342 * functions such as <code>'sin'</code> will be matched no matter what their case is: 343 * <code>'Sin'</code>, <code>'SIN'</code>, etc. If the flag is set to the value 344 * {@link libsbmlConstants#L3P_COMPARE_BUILTINS_CASE_SENSITIVE L3P_COMPARE_BUILTINS_CASE_SENSITIVE}, symbols are 345 * interpreted in a case-sensitive manner. 346 <p> 347 * @param moduloL3v2 ('modulo l3v2') a flag that controls how the 348 * parser will handle the '%' ('modulo') symbol in formulas. By default, 349 * the parser will convert 'a % b' to a piecewise function that properly 350 * calculates the remainder of a with respect to be, but the parser can 351 * also be set to produce the MathML <code>rem</code> function, should the target 352 * of the produced {@link ASTNode} be an SBML Level 3 Version 2 353 * document, where the <code>rem</code> function is legal. 354 * The possible values of this field are 355 * {@link libsbmlConstants#L3P_MODULO_IS_PIECEWISE L3P_MODULO_IS_PIECEWISE} (to parse '%' as a piecewise function) and 356 * {@link libsbmlConstants#L3P_MODULO_IS_REM L3P_MODULO_IS_REM} (to parse '%' as <code>rem</code>). 357 <p> 358 * @param sbmlns ('SBML namespaces') an SBML namespaces object. The 359 * namespaces identify the SBML Level 3 packages that can extend the 360 * syntax understood by the formula parser. When non-<code>null</code>, the parser 361 * will interpret additional syntax defined by the packages; for example, 362 * it may understand vector/array extensions introduced by the SBML 363 * Level 3 <em>Arrays</em> package. 364 <p> 365 * @param l3v2functions a Boolean 366 <p> 367 * 368</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 369The native C++ implementation of this method defines a default argument 370value. In the documentation generated for different libSBML language 371bindings, you may or may not see corresponding arguments in the method 372declarations. For example, in Java and C#, a default argument is handled by 373declaring two separate methods, with one of them having the argument and 374the other one lacking the argument. However, the libSBML documentation will 375be <em>identical</em> for both methods. Consequently, if you are reading 376this and do not see an argument even though one is described, please look 377for descriptions of other variants of this method near where this one 378appears in the documentation. 379</dd></dl> 380 381 <p> 382 * @see #getModel() 383 * @see #setModel(Model) 384 * @see #unsetModel() 385 * @see #getParseLog() 386 * @see #setParseLog(int) 387 * @see #getParseUnits() 388 * @see #setParseUnits(boolean) 389 * @see #getParseCollapseMinus() 390 * @see #setParseCollapseMinus(boolean) 391 * @see #getParseAvogadroCsymbol() 392 * @see #setParseAvogadroCsymbol(boolean) 393 * @see #getParseModuloL3v2() 394 * @see #setParseModuloL3v2(boolean) 395 * @see #getParseL3v2Functions() 396 * @see #setParseL3v2Functions(boolean) 397 */ public 398 L3ParserSettings(Model model, int parselog, boolean collapseminus, boolean parseunits, boolean avocsymbol, boolean caseSensitive, SBMLNamespaces sbmlns, boolean moduloL3v2) { 399 this(libsbmlJNI.new_L3ParserSettings__SWIG_2(Model.getCPtr(model), model, parselog, collapseminus, parseunits, avocsymbol, caseSensitive, SBMLNamespaces.getCPtr(sbmlns), sbmlns, moduloL3v2), true); 400 } 401 402 403/** 404 * Creates a new {@link L3ParserSettings} object with specific values for all 405 * possible settings. 406 <p> 407 * @param model a {@link Model} object to be used for disambiguating identifiers 408 * encountered by <a href='libsbml.html#parseL3FormulaWithSettings(java.lang.String, org.sbml.libsbml.L3ParserSettings)'><code>libsbml.parseL3FormulaWithSettings(String, L3ParserSettings)</code></a> in mathematical formulas. 409 <p> 410 * @param parselog ('parse log') a flag that controls how the parser will 411 * handle the symbol <code>log</code> in mathematical formulas. The function <code>log</code> 412 * with a single argument ("<code>log(x)</code>") can be parsed 413 * as <code>log10(x)</code>, <code>ln(x)</code>, or treated as an error, as 414 * desired, by using the parameter values 415 * {@link libsbmlConstants#L3P_PARSE_LOG_AS_LOG10 L3P_PARSE_LOG_AS_LOG10}, 416 * {@link libsbmlConstants#L3P_PARSE_LOG_AS_LN L3P_PARSE_LOG_AS_LN}, or 417 * {@link libsbmlConstants#L3P_PARSE_LOG_AS_ERROR L3P_PARSE_LOG_AS_ERROR}, respectively. 418 <p> 419 * @param collapseminus ('collapse minus') a flag that controls how the 420 * parser will handle minus signs in formulas. Unary minus signs can be 421 * collapsed or preserved; that is, sequential pairs of unary minuses 422 * (e.g., "<code>- -3</code>") can be removed from the input 423 * entirely and single unary minuses can be incorporated into the number 424 * node, or all minuses can be preserved in the AST node structure. 425 * The possible values of this field are 426 * {@link libsbmlConstants#L3P_COLLAPSE_UNARY_MINUS L3P_COLLAPSE_UNARY_MINUS} (to collapse unary minuses) and 427 * {@link libsbmlConstants#L3P_EXPAND_UNARY_MINUS L3P_EXPAND_UNARY_MINUS} (to expand unary minuses). 428 <p> 429 * @param parseunits ('parse units') a flag that controls how the parser 430 * will handle apparent references to units of measurement associated with 431 * raw numbers in a formula. If set to the value 432 * {@link libsbmlConstants#L3P_PARSE_UNITS L3P_PARSE_UNITS}, units are parsed; if set to the value 433 * {@link libsbmlConstants#L3P_NO_UNITS L3P_NO_UNITS}, units are not parsed. 434 <p> 435 * @param avocsymbol ('Avogadro csymbol') a flag that controls how the 436 * parser will handle the appearance of the symbol <code>avogadro</code> in a 437 * formula. If set to the value {@link libsbmlConstants#L3P_AVOGADRO_IS_CSYMBOL L3P_AVOGADRO_IS_CSYMBOL}, 438 * the symbol is interpreted as the SBML/MathML <em>csymbol</em> <code>avogadro</code>; if 439 * set to the value {@link libsbmlConstants#L3P_AVOGADRO_IS_NAME L3P_AVOGADRO_IS_NAME}, the symbol is 440 * interpreted as a plain symbol name. 441 <p> 442 * @param caseSensitive ('case sensitive') a flag that controls how the 443 * cases of alphabetical characters are treated when symbols are compared. 444 * If the flag is set to the value 445 * {@link libsbmlConstants#L3P_COMPARE_BUILTINS_CASE_INSENSITIVE L3P_COMPARE_BUILTINS_CASE_INSENSITIVE}, symbols are 446 * compared in a case-insensitive manner, which means that mathematical 447 * functions such as <code>'sin'</code> will be matched no matter what their case is: 448 * <code>'Sin'</code>, <code>'SIN'</code>, etc. If the flag is set to the value 449 * {@link libsbmlConstants#L3P_COMPARE_BUILTINS_CASE_SENSITIVE L3P_COMPARE_BUILTINS_CASE_SENSITIVE}, symbols are 450 * interpreted in a case-sensitive manner. 451 <p> 452 * @param moduloL3v2 ('modulo l3v2') a flag that controls how the 453 * parser will handle the '%' ('modulo') symbol in formulas. By default, 454 * the parser will convert 'a % b' to a piecewise function that properly 455 * calculates the remainder of a with respect to be, but the parser can 456 * also be set to produce the MathML <code>rem</code> function, should the target 457 * of the produced {@link ASTNode} be an SBML Level 3 Version 2 458 * document, where the <code>rem</code> function is legal. 459 * The possible values of this field are 460 * {@link libsbmlConstants#L3P_MODULO_IS_PIECEWISE L3P_MODULO_IS_PIECEWISE} (to parse '%' as a piecewise function) and 461 * {@link libsbmlConstants#L3P_MODULO_IS_REM L3P_MODULO_IS_REM} (to parse '%' as <code>rem</code>). 462 <p> 463 * @param sbmlns ('SBML namespaces') an SBML namespaces object. The 464 * namespaces identify the SBML Level 3 packages that can extend the 465 * syntax understood by the formula parser. When non-<code>null</code>, the parser 466 * will interpret additional syntax defined by the packages; for example, 467 * it may understand vector/array extensions introduced by the SBML 468 * Level 3 <em>Arrays</em> package. 469 <p> 470 * @param l3v2functions a Boolean 471 <p> 472 * 473</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 474The native C++ implementation of this method defines a default argument 475value. In the documentation generated for different libSBML language 476bindings, you may or may not see corresponding arguments in the method 477declarations. For example, in Java and C#, a default argument is handled by 478declaring two separate methods, with one of them having the argument and 479the other one lacking the argument. However, the libSBML documentation will 480be <em>identical</em> for both methods. Consequently, if you are reading 481this and do not see an argument even though one is described, please look 482for descriptions of other variants of this method near where this one 483appears in the documentation. 484</dd></dl> 485 486 <p> 487 * @see #getModel() 488 * @see #setModel(Model) 489 * @see #unsetModel() 490 * @see #getParseLog() 491 * @see #setParseLog(int) 492 * @see #getParseUnits() 493 * @see #setParseUnits(boolean) 494 * @see #getParseCollapseMinus() 495 * @see #setParseCollapseMinus(boolean) 496 * @see #getParseAvogadroCsymbol() 497 * @see #setParseAvogadroCsymbol(boolean) 498 * @see #getParseModuloL3v2() 499 * @see #setParseModuloL3v2(boolean) 500 * @see #getParseL3v2Functions() 501 * @see #setParseL3v2Functions(boolean) 502 */ public 503 L3ParserSettings(Model model, int parselog, boolean collapseminus, boolean parseunits, boolean avocsymbol, boolean caseSensitive, SBMLNamespaces sbmlns) { 504 this(libsbmlJNI.new_L3ParserSettings__SWIG_3(Model.getCPtr(model), model, parselog, collapseminus, parseunits, avocsymbol, caseSensitive, SBMLNamespaces.getCPtr(sbmlns), sbmlns), true); 505 } 506 507 508/** 509 * Creates a new {@link L3ParserSettings} object with specific values for all 510 * possible settings. 511 <p> 512 * @param model a {@link Model} object to be used for disambiguating identifiers 513 * encountered by <a href='libsbml.html#parseL3FormulaWithSettings(java.lang.String, org.sbml.libsbml.L3ParserSettings)'><code>libsbml.parseL3FormulaWithSettings(String, L3ParserSettings)</code></a> in mathematical formulas. 514 <p> 515 * @param parselog ('parse log') a flag that controls how the parser will 516 * handle the symbol <code>log</code> in mathematical formulas. The function <code>log</code> 517 * with a single argument ("<code>log(x)</code>") can be parsed 518 * as <code>log10(x)</code>, <code>ln(x)</code>, or treated as an error, as 519 * desired, by using the parameter values 520 * {@link libsbmlConstants#L3P_PARSE_LOG_AS_LOG10 L3P_PARSE_LOG_AS_LOG10}, 521 * {@link libsbmlConstants#L3P_PARSE_LOG_AS_LN L3P_PARSE_LOG_AS_LN}, or 522 * {@link libsbmlConstants#L3P_PARSE_LOG_AS_ERROR L3P_PARSE_LOG_AS_ERROR}, respectively. 523 <p> 524 * @param collapseminus ('collapse minus') a flag that controls how the 525 * parser will handle minus signs in formulas. Unary minus signs can be 526 * collapsed or preserved; that is, sequential pairs of unary minuses 527 * (e.g., "<code>- -3</code>") can be removed from the input 528 * entirely and single unary minuses can be incorporated into the number 529 * node, or all minuses can be preserved in the AST node structure. 530 * The possible values of this field are 531 * {@link libsbmlConstants#L3P_COLLAPSE_UNARY_MINUS L3P_COLLAPSE_UNARY_MINUS} (to collapse unary minuses) and 532 * {@link libsbmlConstants#L3P_EXPAND_UNARY_MINUS L3P_EXPAND_UNARY_MINUS} (to expand unary minuses). 533 <p> 534 * @param parseunits ('parse units') a flag that controls how the parser 535 * will handle apparent references to units of measurement associated with 536 * raw numbers in a formula. If set to the value 537 * {@link libsbmlConstants#L3P_PARSE_UNITS L3P_PARSE_UNITS}, units are parsed; if set to the value 538 * {@link libsbmlConstants#L3P_NO_UNITS L3P_NO_UNITS}, units are not parsed. 539 <p> 540 * @param avocsymbol ('Avogadro csymbol') a flag that controls how the 541 * parser will handle the appearance of the symbol <code>avogadro</code> in a 542 * formula. If set to the value {@link libsbmlConstants#L3P_AVOGADRO_IS_CSYMBOL L3P_AVOGADRO_IS_CSYMBOL}, 543 * the symbol is interpreted as the SBML/MathML <em>csymbol</em> <code>avogadro</code>; if 544 * set to the value {@link libsbmlConstants#L3P_AVOGADRO_IS_NAME L3P_AVOGADRO_IS_NAME}, the symbol is 545 * interpreted as a plain symbol name. 546 <p> 547 * @param caseSensitive ('case sensitive') a flag that controls how the 548 * cases of alphabetical characters are treated when symbols are compared. 549 * If the flag is set to the value 550 * {@link libsbmlConstants#L3P_COMPARE_BUILTINS_CASE_INSENSITIVE L3P_COMPARE_BUILTINS_CASE_INSENSITIVE}, symbols are 551 * compared in a case-insensitive manner, which means that mathematical 552 * functions such as <code>'sin'</code> will be matched no matter what their case is: 553 * <code>'Sin'</code>, <code>'SIN'</code>, etc. If the flag is set to the value 554 * {@link libsbmlConstants#L3P_COMPARE_BUILTINS_CASE_SENSITIVE L3P_COMPARE_BUILTINS_CASE_SENSITIVE}, symbols are 555 * interpreted in a case-sensitive manner. 556 <p> 557 * @param moduloL3v2 ('modulo l3v2') a flag that controls how the 558 * parser will handle the '%' ('modulo') symbol in formulas. By default, 559 * the parser will convert 'a % b' to a piecewise function that properly 560 * calculates the remainder of a with respect to be, but the parser can 561 * also be set to produce the MathML <code>rem</code> function, should the target 562 * of the produced {@link ASTNode} be an SBML Level 3 Version 2 563 * document, where the <code>rem</code> function is legal. 564 * The possible values of this field are 565 * {@link libsbmlConstants#L3P_MODULO_IS_PIECEWISE L3P_MODULO_IS_PIECEWISE} (to parse '%' as a piecewise function) and 566 * {@link libsbmlConstants#L3P_MODULO_IS_REM L3P_MODULO_IS_REM} (to parse '%' as <code>rem</code>). 567 <p> 568 * @param sbmlns ('SBML namespaces') an SBML namespaces object. The 569 * namespaces identify the SBML Level 3 packages that can extend the 570 * syntax understood by the formula parser. When non-<code>null</code>, the parser 571 * will interpret additional syntax defined by the packages; for example, 572 * it may understand vector/array extensions introduced by the SBML 573 * Level 3 <em>Arrays</em> package. 574 <p> 575 * @param l3v2functions a Boolean 576 <p> 577 * 578</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 579The native C++ implementation of this method defines a default argument 580value. In the documentation generated for different libSBML language 581bindings, you may or may not see corresponding arguments in the method 582declarations. For example, in Java and C#, a default argument is handled by 583declaring two separate methods, with one of them having the argument and 584the other one lacking the argument. However, the libSBML documentation will 585be <em>identical</em> for both methods. Consequently, if you are reading 586this and do not see an argument even though one is described, please look 587for descriptions of other variants of this method near where this one 588appears in the documentation. 589</dd></dl> 590 591 <p> 592 * @see #getModel() 593 * @see #setModel(Model) 594 * @see #unsetModel() 595 * @see #getParseLog() 596 * @see #setParseLog(int) 597 * @see #getParseUnits() 598 * @see #setParseUnits(boolean) 599 * @see #getParseCollapseMinus() 600 * @see #setParseCollapseMinus(boolean) 601 * @see #getParseAvogadroCsymbol() 602 * @see #setParseAvogadroCsymbol(boolean) 603 * @see #getParseModuloL3v2() 604 * @see #setParseModuloL3v2(boolean) 605 * @see #getParseL3v2Functions() 606 * @see #setParseL3v2Functions(boolean) 607 */ public 608 L3ParserSettings(Model model, int parselog, boolean collapseminus, boolean parseunits, boolean avocsymbol, boolean caseSensitive) { 609 this(libsbmlJNI.new_L3ParserSettings__SWIG_4(Model.getCPtr(model), model, parselog, collapseminus, parseunits, avocsymbol, caseSensitive), true); 610 } 611 612 613/** 614 * Creates a new {@link L3ParserSettings} object with specific values for all 615 * possible settings. 616 <p> 617 * @param model a {@link Model} object to be used for disambiguating identifiers 618 * encountered by <a href='libsbml.html#parseL3FormulaWithSettings(java.lang.String, org.sbml.libsbml.L3ParserSettings)'><code>libsbml.parseL3FormulaWithSettings(String, L3ParserSettings)</code></a> in mathematical formulas. 619 <p> 620 * @param parselog ('parse log') a flag that controls how the parser will 621 * handle the symbol <code>log</code> in mathematical formulas. The function <code>log</code> 622 * with a single argument ("<code>log(x)</code>") can be parsed 623 * as <code>log10(x)</code>, <code>ln(x)</code>, or treated as an error, as 624 * desired, by using the parameter values 625 * {@link libsbmlConstants#L3P_PARSE_LOG_AS_LOG10 L3P_PARSE_LOG_AS_LOG10}, 626 * {@link libsbmlConstants#L3P_PARSE_LOG_AS_LN L3P_PARSE_LOG_AS_LN}, or 627 * {@link libsbmlConstants#L3P_PARSE_LOG_AS_ERROR L3P_PARSE_LOG_AS_ERROR}, respectively. 628 <p> 629 * @param collapseminus ('collapse minus') a flag that controls how the 630 * parser will handle minus signs in formulas. Unary minus signs can be 631 * collapsed or preserved; that is, sequential pairs of unary minuses 632 * (e.g., "<code>- -3</code>") can be removed from the input 633 * entirely and single unary minuses can be incorporated into the number 634 * node, or all minuses can be preserved in the AST node structure. 635 * The possible values of this field are 636 * {@link libsbmlConstants#L3P_COLLAPSE_UNARY_MINUS L3P_COLLAPSE_UNARY_MINUS} (to collapse unary minuses) and 637 * {@link libsbmlConstants#L3P_EXPAND_UNARY_MINUS L3P_EXPAND_UNARY_MINUS} (to expand unary minuses). 638 <p> 639 * @param parseunits ('parse units') a flag that controls how the parser 640 * will handle apparent references to units of measurement associated with 641 * raw numbers in a formula. If set to the value 642 * {@link libsbmlConstants#L3P_PARSE_UNITS L3P_PARSE_UNITS}, units are parsed; if set to the value 643 * {@link libsbmlConstants#L3P_NO_UNITS L3P_NO_UNITS}, units are not parsed. 644 <p> 645 * @param avocsymbol ('Avogadro csymbol') a flag that controls how the 646 * parser will handle the appearance of the symbol <code>avogadro</code> in a 647 * formula. If set to the value {@link libsbmlConstants#L3P_AVOGADRO_IS_CSYMBOL L3P_AVOGADRO_IS_CSYMBOL}, 648 * the symbol is interpreted as the SBML/MathML <em>csymbol</em> <code>avogadro</code>; if 649 * set to the value {@link libsbmlConstants#L3P_AVOGADRO_IS_NAME L3P_AVOGADRO_IS_NAME}, the symbol is 650 * interpreted as a plain symbol name. 651 <p> 652 * @param caseSensitive ('case sensitive') a flag that controls how the 653 * cases of alphabetical characters are treated when symbols are compared. 654 * If the flag is set to the value 655 * {@link libsbmlConstants#L3P_COMPARE_BUILTINS_CASE_INSENSITIVE L3P_COMPARE_BUILTINS_CASE_INSENSITIVE}, symbols are 656 * compared in a case-insensitive manner, which means that mathematical 657 * functions such as <code>'sin'</code> will be matched no matter what their case is: 658 * <code>'Sin'</code>, <code>'SIN'</code>, etc. If the flag is set to the value 659 * {@link libsbmlConstants#L3P_COMPARE_BUILTINS_CASE_SENSITIVE L3P_COMPARE_BUILTINS_CASE_SENSITIVE}, symbols are 660 * interpreted in a case-sensitive manner. 661 <p> 662 * @param moduloL3v2 ('modulo l3v2') a flag that controls how the 663 * parser will handle the '%' ('modulo') symbol in formulas. By default, 664 * the parser will convert 'a % b' to a piecewise function that properly 665 * calculates the remainder of a with respect to be, but the parser can 666 * also be set to produce the MathML <code>rem</code> function, should the target 667 * of the produced {@link ASTNode} be an SBML Level 3 Version 2 668 * document, where the <code>rem</code> function is legal. 669 * The possible values of this field are 670 * {@link libsbmlConstants#L3P_MODULO_IS_PIECEWISE L3P_MODULO_IS_PIECEWISE} (to parse '%' as a piecewise function) and 671 * {@link libsbmlConstants#L3P_MODULO_IS_REM L3P_MODULO_IS_REM} (to parse '%' as <code>rem</code>). 672 <p> 673 * @param sbmlns ('SBML namespaces') an SBML namespaces object. The 674 * namespaces identify the SBML Level 3 packages that can extend the 675 * syntax understood by the formula parser. When non-<code>null</code>, the parser 676 * will interpret additional syntax defined by the packages; for example, 677 * it may understand vector/array extensions introduced by the SBML 678 * Level 3 <em>Arrays</em> package. 679 <p> 680 * @param l3v2functions a Boolean 681 <p> 682 * 683</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 684The native C++ implementation of this method defines a default argument 685value. In the documentation generated for different libSBML language 686bindings, you may or may not see corresponding arguments in the method 687declarations. For example, in Java and C#, a default argument is handled by 688declaring two separate methods, with one of them having the argument and 689the other one lacking the argument. However, the libSBML documentation will 690be <em>identical</em> for both methods. Consequently, if you are reading 691this and do not see an argument even though one is described, please look 692for descriptions of other variants of this method near where this one 693appears in the documentation. 694</dd></dl> 695 696 <p> 697 * @see #getModel() 698 * @see #setModel(Model) 699 * @see #unsetModel() 700 * @see #getParseLog() 701 * @see #setParseLog(int) 702 * @see #getParseUnits() 703 * @see #setParseUnits(boolean) 704 * @see #getParseCollapseMinus() 705 * @see #setParseCollapseMinus(boolean) 706 * @see #getParseAvogadroCsymbol() 707 * @see #setParseAvogadroCsymbol(boolean) 708 * @see #getParseModuloL3v2() 709 * @see #setParseModuloL3v2(boolean) 710 * @see #getParseL3v2Functions() 711 * @see #setParseL3v2Functions(boolean) 712 */ public 713 L3ParserSettings(Model model, int parselog, boolean collapseminus, boolean parseunits, boolean avocsymbol) { 714 this(libsbmlJNI.new_L3ParserSettings__SWIG_5(Model.getCPtr(model), model, parselog, collapseminus, parseunits, avocsymbol), true); 715 } 716 717 718/** 719 * Copy constructor. 720 <p> 721 * @param source the instance to copy. 722 */ public 723 L3ParserSettings(L3ParserSettings source) { 724 this(libsbmlJNI.new_L3ParserSettings__SWIG_6(L3ParserSettings.getCPtr(source), source), true); 725 } 726 727 728/** 729 * Sets the model reference in this {@link L3ParserSettings} object. 730 <p> 731 * <p> 732 * When a {@link Model} object is provided, identifiers (values of type <code>SId</code>) 733 * from that model are used in preference to pre-defined MathML symbol 734 * definitions. More precisely, the {@link Model} entities whose identifiers will 735 * shadow identical symbols in the mathematical formula are: {@link Species}, 736 * {@link Compartment}, {@link Parameter}, {@link Reaction}, and {@link SpeciesReference}. For instance, if 737 * the parser is given a {@link Model} containing a {@link Species} with the identifier 738 * "<code>pi</code>", and the formula to be parsed is 739 * "<code>3*pi</code>", the MathML produced will contain the 740 * construct <code><ci> pi </ci></code> instead of the construct 741 * <code><pi/></code>. Similarly, when a {@link Model} object is provided, 742 * <code>SId</code> values of user-defined functions present in the {@link Model} will be used 743 * preferentially over pre-defined MathML functions. For example, if the 744 * passed-in {@link Model} contains a {@link FunctionDefinition} with the identifier 745 * "<code>sin</code>", that function will be used instead of the 746 * predefined MathML function <code><sin/></code>. 747 <p> 748 * @param model a {@link Model} object to be used for disambiguating identifiers. 749 <p> 750 * @warning <span class='warning'>This does <em>not</em> copy the {@link Model} object. 751 * This means that modifications made to the {@link Model} after invoking this 752 * method may affect parsing behavior, because the parser will query the 753 * <em>current</em> contents of the model.</span> 754 <p> 755 * @see #getModel() 756 * @see #unsetModel() 757 */ public 758 void setModel(Model model) { 759 libsbmlJNI.L3ParserSettings_setModel(swigCPtr, this, Model.getCPtr(model), model); 760 } 761 762 763/** 764 * Returns the {@link Model} object referenced by this {@link L3ParserSettings} object. 765 <p> 766 * <p> 767 * When a {@link Model} object is provided, identifiers (values of type <code>SId</code>) 768 * from that model are used in preference to pre-defined MathML symbol 769 * definitions. More precisely, the {@link Model} entities whose identifiers will 770 * shadow identical symbols in the mathematical formula are: {@link Species}, 771 * {@link Compartment}, {@link Parameter}, {@link Reaction}, and {@link SpeciesReference}. For instance, if 772 * the parser is given a {@link Model} containing a {@link Species} with the identifier 773 * "<code>pi</code>", and the formula to be parsed is 774 * "<code>3*pi</code>", the MathML produced will contain the 775 * construct <code><ci> pi </ci></code> instead of the construct 776 * <code><pi/></code>. Similarly, when a {@link Model} object is provided, 777 * <code>SId</code> values of user-defined functions present in the {@link Model} will be used 778 * preferentially over pre-defined MathML functions. For example, if the 779 * passed-in {@link Model} contains a {@link FunctionDefinition} with the identifier 780 * "<code>sin</code>", that function will be used instead of the 781 * predefined MathML function <code><sin/></code>. 782 <p> 783 * @see #setModel(Model) 784 * @see #unsetModel() 785 */ public 786 Model getModel() { 787 long cPtr = libsbmlJNI.L3ParserSettings_getModel(swigCPtr, this); 788 return (cPtr == 0) ? null : new Model(cPtr, false); 789 } 790 791 792/** 793 * Unsets the {@link Model} reference in this {@link L3ParserSettings} object. 794 <p> 795 * The effect of calling this method is to set the stored model value 796 * to <code>null.</code> 797 <p> 798 * @see #setModel(Model) 799 * @see #getModel() 800 */ public 801 void unsetModel() { 802 libsbmlJNI.L3ParserSettings_unsetModel(swigCPtr, this); 803 } 804 805 806/** 807 * Sets the behavior for handling <code>log</code> in mathematical formulas. 808 <p> 809 * The function <code>log</code> with a single argument 810 * ("<code>log(x)</code>") can be parsed as 811 * <code>log10(x)</code>, <code>ln(x)</code>, or treated as an error. 812 * These three behaviors are set, respectively, by using the value 813 * {@link libsbmlConstants#L3P_PARSE_LOG_AS_LOG10 L3P_PARSE_LOG_AS_LOG10}, 814 * {@link libsbmlConstants#L3P_PARSE_LOG_AS_LN L3P_PARSE_LOG_AS_LN}, or 815 * {@link libsbmlConstants#L3P_PARSE_LOG_AS_ERROR L3P_PARSE_LOG_AS_ERROR} 816 * for the <code>type</code> parameter. 817 <p> 818 * @param type a constant, one of following three possibilities: 819 * <ul> 820 * <li> {@link libsbmlConstants#L3P_PARSE_LOG_AS_LOG10 L3P_PARSE_LOG_AS_LOG10} 821 * <li> {@link libsbmlConstants#L3P_PARSE_LOG_AS_LN L3P_PARSE_LOG_AS_LN} 822 * <li> {@link libsbmlConstants#L3P_PARSE_LOG_AS_ERROR L3P_PARSE_LOG_AS_ERROR} 823 * 824 * </ul> <p> 825 * @see #getParseLog() 826 */ public 827 void setParseLog(int type) { 828 libsbmlJNI.L3ParserSettings_setParseLog(swigCPtr, this, type); 829 } 830 831 832/** 833 * Indicates the current behavior set for handling the function <code>log</code> with 834 * one argument. 835 <p> 836 * The function <code>log</code> with a single argument 837 * ("<code>log(x)</code>") can be parsed as 838 * <code>log10(x)</code>, <code>ln(x)</code>, or treated as an error, as 839 * desired. These three possible behaviors are indicated, respectively, by 840 * the values 841 * {@link libsbmlConstants#L3P_PARSE_LOG_AS_LOG10 L3P_PARSE_LOG_AS_LOG10}, 842 * {@link libsbmlConstants#L3P_PARSE_LOG_AS_LN L3P_PARSE_LOG_AS_LN}, and 843 * {@link libsbmlConstants#L3P_PARSE_LOG_AS_ERROR L3P_PARSE_LOG_AS_ERROR}. 844 <p> 845 * @return One of following three constants: 846 * <ul> 847 * <li> {@link libsbmlConstants#L3P_PARSE_LOG_AS_LOG10 L3P_PARSE_LOG_AS_LOG10} 848 * <li> {@link libsbmlConstants#L3P_PARSE_LOG_AS_LN L3P_PARSE_LOG_AS_LN} 849 * <li> {@link libsbmlConstants#L3P_PARSE_LOG_AS_ERROR L3P_PARSE_LOG_AS_ERROR} 850 * 851 * </ul> <p> 852 * @see #setParseLog(int) 853 */ public 854 int getParseLog() { 855 return libsbmlJNI.L3ParserSettings_getParseLog(swigCPtr, this); 856 } 857 858 859/** 860 * Sets the behavior for handling unary minuses appearing in mathematical 861 * formulas. 862 <p> 863 * <p> 864 * This setting affects two behaviors. First, pairs of multiple unary 865 * minuses in a row (e.g., "<code>- -3</code>") can be collapsed 866 * and ignored in the input, or the multiple minuses can be preserved in the 867 * AST node tree that is generated by the parser. Second, minus signs in 868 * front of numbers can be collapsed into the number node itself; for 869 * example, a "<code>- 4.1</code>" can be turned into a single 870 * {@link ASTNode} of type {@link libsbmlConstants#AST_REAL AST_REAL} with a value of 871 * <code>-4.1</code>, or it can be turned into a node of type 872 * {@link libsbmlConstants#AST_MINUS AST_MINUS} having a child node of type 873 * {@link libsbmlConstants#AST_REAL AST_REAL}. 874 <p> 875 * This method lets you tell the parser which behavior to use—either 876 * collapse minuses or always preserve them. The two possibilities are 877 * represented using the following constants: 878 <p> 879 * <p> 880 * <ul> 881 * <li> {@link libsbmlConstants#L3P_COLLAPSE_UNARY_MINUS L3P_COLLAPSE_UNARY_MINUS} (value = <code>true</code>): collapse 882 * unary minuses where possible. 883 * <li> {@link libsbmlConstants#L3P_EXPAND_UNARY_MINUS L3P_EXPAND_UNARY_MINUS} (value = <code>false</code>): do not 884 * collapse unary minuses, and instead translate each one into an AST node of 885 * type {@link libsbmlConstants#AST_MINUS AST_MINUS}. 886 * </ul> 887 <p> 888 * @param collapseminus a boolean value (one of the constants 889 * {@link libsbmlConstants#L3P_COLLAPSE_UNARY_MINUS L3P_COLLAPSE_UNARY_MINUS} or 890 * {@link libsbmlConstants#L3P_EXPAND_UNARY_MINUS L3P_EXPAND_UNARY_MINUS}) 891 * indicating how unary minus signs in the input should be handled. 892 <p> 893 * @see #getParseCollapseMinus() 894 */ public 895 void setParseCollapseMinus(boolean collapseminus) { 896 libsbmlJNI.L3ParserSettings_setParseCollapseMinus(swigCPtr, this, collapseminus); 897 } 898 899 900/** 901 * Indicates the current behavior set for handling multiple unary minuses 902 * in formulas. 903 <p> 904 * <p> 905 * This setting affects two behaviors. First, pairs of multiple unary 906 * minuses in a row (e.g., "<code>- -3</code>") can be collapsed 907 * and ignored in the input, or the multiple minuses can be preserved in the 908 * AST node tree that is generated by the parser. Second, minus signs in 909 * front of numbers can be collapsed into the number node itself; for 910 * example, a "<code>- 4.1</code>" can be turned into a single 911 * {@link ASTNode} of type {@link libsbmlConstants#AST_REAL AST_REAL} with a value of 912 * <code>-4.1</code>, or it can be turned into a node of type 913 * {@link libsbmlConstants#AST_MINUS AST_MINUS} having a child node of type 914 * {@link libsbmlConstants#AST_REAL AST_REAL}. 915 <p> 916 * @return A boolean indicating the behavior currently set. The possible 917 * values are as follows: 918 * <p> 919 * <ul> 920 * <li> {@link libsbmlConstants#L3P_COLLAPSE_UNARY_MINUS L3P_COLLAPSE_UNARY_MINUS} (value = <code>true</code>): collapse 921 * unary minuses where possible. 922 * <li> {@link libsbmlConstants#L3P_EXPAND_UNARY_MINUS L3P_EXPAND_UNARY_MINUS} (value = <code>false</code>): do not 923 * collapse unary minuses, and instead translate each one into an AST node of 924 * type {@link libsbmlConstants#AST_MINUS AST_MINUS}. 925 * </ul> 926 <p> 927 * @see #setParseCollapseMinus(boolean) 928 */ public 929 boolean getParseCollapseMinus() { 930 return libsbmlJNI.L3ParserSettings_getParseCollapseMinus(swigCPtr, this); 931 } 932 933 934/** 935 * Sets the parser's behavior in handling units associated with numbers 936 * in a mathematical formula. 937 <p> 938 * <p> 939 * In SBML Level 2, there is no means of associating a unit of 940 * measurement with a pure number in a formula, while SBML Level 3 does 941 * define a syntax for this. In Level 3, MathML <code><cn></code> 942 * elements can have an attribute named <code>units</code> placed in the SBML 943 * namespace, which can be used to indicate the units to be associated with 944 * the number. The text-string infix formula parser allows units to be 945 * placed after raw numbers; they are interpreted as unit identifiers for 946 * units defined by the SBML specification or in the containing {@link Model} object. 947 * Some examples include: "<code>4 mL</code>", "<code>2.01 948 * Hz</code>", "<code>3.1e-6 M</code>", and "<code>(5/8) 949 * inches</code>". To produce a valid SBML model, there must either 950 * exist a {@link UnitDefinition} corresponding to the identifier of the unit, or the 951 * unit must be defined in Table 2 of the SBML Level 3 specification. 952 <p> 953 * This method sets the formula parser's behavior with respect to units. 954 <p> 955 * @param units a boolean indicating whether to parse units. The 956 * possible values are as follows: 957 * <p> 958 * <ul> 959 * <li> {@link libsbmlConstants#L3P_PARSE_UNITS L3P_PARSE_UNITS} (value = <code>true</code>): parse units in the 960 * text-string formula. 961 * <li> {@link libsbmlConstants#L3P_NO_UNITS L3P_NO_UNITS} (value = <code>false</code>): treat units in the 962 * text-string formula as errors. 963 * </ul> 964 <p> 965 * @see #getParseUnits() 966 */ public 967 void setParseUnits(boolean units) { 968 libsbmlJNI.L3ParserSettings_setParseUnits(swigCPtr, this, units); 969 } 970 971 972/** 973 * Indicates the current behavior set for handling units in text-string 974 * mathematical formulas. 975 <p> 976 * <p> 977 * In SBML Level 2, there is no means of associating a unit of 978 * measurement with a pure number in a formula, while SBML Level 3 does 979 * define a syntax for this. In Level 3, MathML <code><cn></code> 980 * elements can have an attribute named <code>units</code> placed in the SBML 981 * namespace, which can be used to indicate the units to be associated with 982 * the number. The text-string infix formula parser allows units to be 983 * placed after raw numbers; they are interpreted as unit identifiers for 984 * units defined by the SBML specification or in the containing {@link Model} object. 985 * Some examples include: "<code>4 mL</code>", "<code>2.01 986 * Hz</code>", "<code>3.1e-6 M</code>", and "<code>(5/8) 987 * inches</code>". To produce a valid SBML model, there must either 988 * exist a {@link UnitDefinition} corresponding to the identifier of the unit, or the 989 * unit must be defined in Table 2 of the SBML Level 3 specification. 990 <p> 991 * Since SBML Level 2 does not have the ability to associate units 992 * with pure numbers, the value should be expected to be <code>false</code> 993 * ({@link libsbmlConstants#L3P_NO_UNITS L3P_NO_UNITS}) when parsing text-string 994 * formulas intended for use in SBML Level 2 documents. 995 <p> 996 * @return A boolean indicating whether to parse units. The 997 * possible values are as follows: 998 * <p> 999 * <ul> 1000 * <li> {@link libsbmlConstants#L3P_PARSE_UNITS L3P_PARSE_UNITS} (value = <code>true</code>): parse units in the 1001 * text-string formula. 1002 * <li> {@link libsbmlConstants#L3P_NO_UNITS L3P_NO_UNITS} (value = <code>false</code>): treat units in the 1003 * text-string formula as errors. 1004 * </ul> 1005 <p> 1006 * @see #setParseUnits(boolean) 1007 */ public 1008 boolean getParseUnits() { 1009 return libsbmlJNI.L3ParserSettings_getParseUnits(swigCPtr, this); 1010 } 1011 1012 1013/** 1014 * Sets the parser's behavior in handling the symbol <code>avogadro</code> in 1015 * mathematical formulas. 1016 <p> 1017 * <p> 1018 * SBML Level 3 defines a symbol for representing the value of 1019 * Avogadro's constant, but it is not defined in SBML Level 2. As a 1020 * result, the text-string formula parser must behave differently 1021 * depending on which SBML Level is being targeted. For Level 3 1022 * documents, it can interpret instances of <code>avogadro</code> in the input 1023 * as a reference to the MathML <em>csymbol</em> for Avogadro's constant 1024 * defined in the SBML Level 3 specification. For Level 2, 1025 * it must treat <code>avogadro</code> as just another plain symbol. 1026 <p> 1027 * This method allows callers to set the <code>avogadro</code>-handling 1028 * behavior in this {@link L3ParserSettings} object. The possible values of 1029 * <code>l2only</code> are as follows: 1030 <p> 1031 * <p> 1032 * <ul> 1033 * <li> {@link libsbmlConstants#L3P_AVOGADRO_IS_CSYMBOL L3P_AVOGADRO_IS_CSYMBOL} (value = <code>true</code>): tells the 1034 * parser to translate the string <code>avogadro</code> (in any capitalization) into an 1035 * AST node of type {@link libsbmlConstants#AST_NAME_AVOGADRO AST_NAME_AVOGADRO}. 1036 * <li> {@link libsbmlConstants#L3P_AVOGADRO_IS_NAME L3P_AVOGADRO_IS_NAME} (value = <code>false</code>): tells the 1037 * parser to translate the string <code>avogadro</code> into an AST of type 1038 * {@link libsbmlConstants#AST_NAME AST_NAME}. 1039 * </ul> 1040 <p> 1041 * Since SBML Level 2 does not define a symbol for Avogadro's 1042 * constant, the value should be set to 1043 * {@link libsbmlConstants#L3P_AVOGADRO_IS_NAME L3P_AVOGADRO_IS_NAME} when parsing text-string formulas 1044 * intended for use in SBML Level 2 documents. 1045 <p> 1046 * @param l2only a boolean value indicating how the string <code>avogadro</code> 1047 * should be treated when encountered in a formula. This will be one of 1048 * the values {@link libsbmlConstants#L3P_AVOGADRO_IS_CSYMBOL L3P_AVOGADRO_IS_CSYMBOL} or 1049 * {@link libsbmlConstants#L3P_AVOGADRO_IS_NAME L3P_AVOGADRO_IS_NAME}. 1050 <p> 1051 * @see #getParseAvogadroCsymbol() 1052 */ public 1053 void setParseAvogadroCsymbol(boolean l2only) { 1054 libsbmlJNI.L3ParserSettings_setParseAvogadroCsymbol(swigCPtr, this, l2only); 1055 } 1056 1057 1058/** 1059 * Indicates the current behavior set for handling <code>avogadro</code> for SBML 1060 * Level 3. 1061 <p> 1062 * <p> 1063 * SBML Level 3 defines a symbol for representing the value of 1064 * Avogadro's constant, but it is not defined in SBML Level 2. As a 1065 * result, the text-string formula parser must behave differently 1066 * depending on which SBML Level is being targeted. For Level 3 1067 * documents, it can interpret instances of <code>avogadro</code> in the input 1068 * as a reference to the MathML <em>csymbol</em> for Avogadro's constant 1069 * defined in the SBML Level 3 specification. For Level 2, 1070 * it must treat <code>avogadro</code> as just another plain symbol. 1071 <p> 1072 * This method returns the current setting of the 1073 * <code>avogadro</code>-handling behavior in this {@link L3ParserSettings} object. 1074 * The possible values are as follows: 1075 <p> 1076 * <p> 1077 * <ul> 1078 * <li> {@link libsbmlConstants#L3P_AVOGADRO_IS_CSYMBOL L3P_AVOGADRO_IS_CSYMBOL} (value = <code>true</code>): tells the 1079 * parser to translate the string <code>avogadro</code> (in any capitalization) into an 1080 * AST node of type {@link libsbmlConstants#AST_NAME_AVOGADRO AST_NAME_AVOGADRO}. 1081 * <li> {@link libsbmlConstants#L3P_AVOGADRO_IS_NAME L3P_AVOGADRO_IS_NAME} (value = <code>false</code>): tells the 1082 * parser to translate the string <code>avogadro</code> into an AST of type 1083 * {@link libsbmlConstants#AST_NAME AST_NAME}. 1084 * </ul> 1085 <p> 1086 * @return A boolean indicating which mode is currently set; one of 1087 * {@link libsbmlConstants#L3P_AVOGADRO_IS_CSYMBOL L3P_AVOGADRO_IS_CSYMBOL} 1088 * or 1089 * {@link libsbmlConstants#L3P_AVOGADRO_IS_NAME L3P_AVOGADRO_IS_NAME}. 1090 <p> 1091 * @see #setParseAvogadroCsymbol(boolean) 1092 */ public 1093 boolean getParseAvogadroCsymbol() { 1094 return libsbmlJNI.L3ParserSettings_getParseAvogadroCsymbol(swigCPtr, this); 1095 } 1096 1097 1098/** 1099 * Sets the parser's behavior with respect to case sensitivity for 1100 * recognizing predefined symbols. 1101 <p> 1102 * <p> 1103 * By default (which is the value 1104 * {@link libsbmlConstants#L3P_COMPARE_BUILTINS_CASE_INSENSITIVE L3P_COMPARE_BUILTINS_CASE_INSENSITIVE}), the parser 1105 * compares symbols in a case <em>insensitive</em> manner for built-in functions 1106 * such as <code>'sin'</code> and <code>'piecewise'</code>, and for constants such as <code>'true'</code> 1107 * and <code>'avogadro'.</code> Setting this option to 1108 * {@link libsbmlConstants#L3P_COMPARE_BUILTINS_CASE_SENSITIVE L3P_COMPARE_BUILTINS_CASE_SENSITIVE} causes the parser to 1109 * become case sensitive. In that mode, for example, the symbols <code>'sin'</code> 1110 * and <code>'true'</code> will match the built-in values, but the symbols <code>'SIN'</code>, 1111 * <code>'Sin'</code>, <code>'True'</code>, <code>'TRUE'</code>, and so on, will not. 1112 <p> 1113 * @param strcmp a boolean indicating whether to be case sensitive (if 1114 * <code>true</code>) or be case insensitive (if <code>false</code>). 1115 <p> 1116 * @see #getComparisonCaseSensitivity() 1117 */ public 1118 void setComparisonCaseSensitivity(boolean strcmp) { 1119 libsbmlJNI.L3ParserSettings_setComparisonCaseSensitivity(swigCPtr, this, strcmp); 1120 } 1121 1122 1123/** 1124 * Returns <code>true</code> if the parser is configured to match built-in symbols 1125 * in a case-insensitive way. 1126 <p> 1127 * <p> 1128 * By default (which is the value 1129 * {@link libsbmlConstants#L3P_COMPARE_BUILTINS_CASE_INSENSITIVE L3P_COMPARE_BUILTINS_CASE_INSENSITIVE}), the parser 1130 * compares symbols in a case <em>insensitive</em> manner for built-in functions 1131 * such as <code>'sin'</code> and <code>'piecewise'</code>, and for constants such as <code>'true'</code> 1132 * and <code>'avogadro'.</code> Setting this option to 1133 * {@link libsbmlConstants#L3P_COMPARE_BUILTINS_CASE_SENSITIVE L3P_COMPARE_BUILTINS_CASE_SENSITIVE} causes the parser to 1134 * become case sensitive. In that mode, for example, the symbols <code>'sin'</code> 1135 * and <code>'true'</code> will match the built-in values, but the symbols <code>'SIN'</code>, 1136 * <code>'Sin'</code>, <code>'True'</code>, <code>'TRUE'</code>, and so on, will not. 1137 <p> 1138 * @return <code>true</code> if matches are done in a case-sensitive manner, and 1139 * <code>false</code> if the parser will recognize built-in functions and 1140 * constants regardless of case,. 1141 <p> 1142 * @see #setComparisonCaseSensitivity(boolean) 1143 */ public 1144 boolean getComparisonCaseSensitivity() { 1145 return libsbmlJNI.L3ParserSettings_getComparisonCaseSensitivity(swigCPtr, this); 1146 } 1147 1148 1149/** 1150 * Sets the behavior for handling the '%' sumbol in mathematical 1151 * formulas. 1152 <p> 1153 * <p> 1154 * This setting affects whether the '%' symbol (modulo) is parsed as a 1155 * piecewise equation that returns the modulo value of the entries on 1156 * either side of the symbol, or whether it is parsed as the MathML 1157 * 'rem' function, which was allowed in SBML Level 3 Version 2, 1158 * but not in previous level/versions. The latter is more succinct, but 1159 * might not be legal SBML for the desired target SBML document. 1160 <p> 1161 * This method lets you tell the parser which behavior to use—either 1162 * parse '%' as the 'rem' function or as a piecewise function with the 1163 * same interpretation. The two possibilities are 1164 * represented using the following constants: 1165 <p> 1166 * <p> 1167 * <ul> 1168 * <li> {@link libsbmlConstants#L3P_MODULO_IS_REM L3P_MODULO_IS_REM} (value = <code>true</code>): use the 1169 * 'rem' MathML function ({@link libsbmlConstants#AST_FUNCTION_REM AST_FUNCTION_REM}). 1170 * <li> {@link libsbmlConstants#L3P_MODULO_IS_PIECEWISE L3P_MODULO_IS_PIECEWISE} (value = <code>false</code>): use 1171 * a piecewise function ({@link libsbmlConstants#AST_FUNCTION_PIECEWISE AST_FUNCTION_PIECEWISE}) 1172 * to encode the modulo rule explicitly. 1173 * </ul> 1174 <p> 1175 * @param modulol3v2 a boolean value (one of the constants 1176 * {@link libsbmlConstants#L3P_MODULO_IS_PIECEWISE L3P_MODULO_IS_PIECEWISE} or 1177 * {@link libsbmlConstants#L3P_MODULO_IS_REM L3P_MODULO_IS_REM}) 1178 * indicating how the '%' symbol in the input should be handled. 1179 <p> 1180 * @see #getParseModuloL3v2() 1181 */ public 1182 void setParseModuloL3v2(boolean modulol3v2) { 1183 libsbmlJNI.L3ParserSettings_setParseModuloL3v2(swigCPtr, this, modulol3v2); 1184 } 1185 1186 1187/** 1188 * Indicates the current behavior set for handling the '%' sumbol in 1189 * mathematical formulas. 1190 <p> 1191 * <p> 1192 * This setting affects whether the '%' symbol (modulo) is parsed as a 1193 * piecewise equation that returns the modulo value of the entries on 1194 * either side of the symbol, or whether it is parsed as the MathML 1195 * 'rem' function, which was allowed in SBML Level 3 Version 2, 1196 * but not in previous level/versions. The latter is more succinct, but 1197 * might not be legal SBML for the desired target SBML document. 1198 <p> 1199 * @return A boolean indicating the behavior currently set. The possible 1200 * values are as follows: 1201 * <p> 1202 * <ul> 1203 * <li> {@link libsbmlConstants#L3P_MODULO_IS_REM L3P_MODULO_IS_REM} (value = <code>true</code>): use the 1204 * 'rem' MathML function ({@link libsbmlConstants#AST_FUNCTION_REM AST_FUNCTION_REM}). 1205 * <li> {@link libsbmlConstants#L3P_MODULO_IS_PIECEWISE L3P_MODULO_IS_PIECEWISE} (value = <code>false</code>): use 1206 * a piecewise function ({@link libsbmlConstants#AST_FUNCTION_PIECEWISE AST_FUNCTION_PIECEWISE}) 1207 * to encode the modulo rule explicitly. 1208 * </ul> 1209 <p> 1210 * @see #setParseModuloL3v2(boolean) 1211 */ public 1212 boolean getParseModuloL3v2() { 1213 return libsbmlJNI.L3ParserSettings_getParseModuloL3v2(swigCPtr, this); 1214 } 1215 1216 1217/** 1218 * Sets the behavior for handling functions added in SBML L3v2 1219 <p> 1220 * <p> 1221 * This setting affects whether the names of functions added in SBML 1222 * Level 3 Version 2 are parsed as those added MathML functions, 1223 * or whether they are added as generic functions with those names (to 1224 * be used in SBML as function definitions). 1225 <p> 1226 * This method lets you tell the parser which behavior to use—either 1227 * to parse the functions added in L3v2 as their built-in counterparts, 1228 * or as generic functions with that name (to be defined by SBML as 1229 * function definitions). The two possibilities are 1230 * represented using the following constants: 1231 <p> 1232 * <p> 1233 * <ul> 1234 * <li> {@link libsbmlConstants#L3P_PARSE_L3V2_FUNCTIONS_DIRECTLY L3P_PARSE_L3V2_FUNCTIONS_DIRECTLY} (value = <code>true</code>): parse the 1235 * strings 'rateOf', 'implies', 'max', 'min', 'quotient', and 'rem' as 1236 * {@link libsbmlConstants#AST_FUNCTION_RATE_OF AST_FUNCTION_RATE_OF}, 1237 * {@link libsbmlConstants#AST_LOGICAL_IMPLIES AST_LOGICAL_IMPLIES}, 1238 * {@link libsbmlConstants#AST_FUNCTION_MAX AST_FUNCTION_MAX}, 1239 * {@link libsbmlConstants#AST_FUNCTION_MIN AST_FUNCTION_MIN}, 1240 * {@link libsbmlConstants#AST_FUNCTION_QUOTIENT AST_FUNCTION_QUOTIENT}, and 1241 * {@link libsbmlConstants#AST_FUNCTION_REM AST_FUNCTION_REM}, respectively. 1242 * <li> {@link libsbmlConstants#L3P_PARSE_L3V2_FUNCTIONS_AS_GENERIC L3P_PARSE_L3V2_FUNCTIONS_AS_GENERIC} (value = <code>false</code>): 1243 * parse the strings 'rateOf', 'implies', 'max', 'min', 'quotient', and 1244 * 'rem' all as {@link libsbmlConstants#AST_FUNCTION AST_FUNCTION} with the appropriate 1245 * name set. 1246 * </ul> 1247 <p> 1248 * @param l3v2functions a boolean value (one of the constants 1249 * {@link libsbmlConstants#L3P_PARSE_L3V2_FUNCTIONS_DIRECTLY L3P_PARSE_L3V2_FUNCTIONS_DIRECTLY} or 1250 * {@link libsbmlConstants#L3P_PARSE_L3V2_FUNCTIONS_AS_GENERIC L3P_PARSE_L3V2_FUNCTIONS_AS_GENERIC}) 1251 * indicating how to interpret those function names. 1252 <p> 1253 * @see #getParseL3v2Functions() 1254 */ public 1255 void setParseL3v2Functions(boolean l3v2functions) { 1256 libsbmlJNI.L3ParserSettings_setParseL3v2Functions(swigCPtr, this, l3v2functions); 1257 } 1258 1259 1260/** 1261 * Indicates the current behavior set for handling whether to 1262 * parse the functions added in L3v2 as that MathML or not. 1263 <p> 1264 * <p> 1265 * This setting affects whether the names of functions added in SBML 1266 * Level 3 Version 2 are parsed as those added MathML functions, 1267 * or whether they are added as generic functions with those names (to 1268 * be used in SBML as function definitions). 1269 <p> 1270 * @return A boolean indicating the behavior currently set. The possible 1271 * values are as follows: 1272 * <p> 1273 * <ul> 1274 * <li> {@link libsbmlConstants#L3P_PARSE_L3V2_FUNCTIONS_DIRECTLY L3P_PARSE_L3V2_FUNCTIONS_DIRECTLY} (value = <code>true</code>): parse the 1275 * strings 'rateOf', 'implies', 'max', 'min', 'quotient', and 'rem' as 1276 * {@link libsbmlConstants#AST_FUNCTION_RATE_OF AST_FUNCTION_RATE_OF}, 1277 * {@link libsbmlConstants#AST_LOGICAL_IMPLIES AST_LOGICAL_IMPLIES}, 1278 * {@link libsbmlConstants#AST_FUNCTION_MAX AST_FUNCTION_MAX}, 1279 * {@link libsbmlConstants#AST_FUNCTION_MIN AST_FUNCTION_MIN}, 1280 * {@link libsbmlConstants#AST_FUNCTION_QUOTIENT AST_FUNCTION_QUOTIENT}, and 1281 * {@link libsbmlConstants#AST_FUNCTION_REM AST_FUNCTION_REM}, respectively. 1282 * <li> {@link libsbmlConstants#L3P_PARSE_L3V2_FUNCTIONS_AS_GENERIC L3P_PARSE_L3V2_FUNCTIONS_AS_GENERIC} (value = <code>false</code>): 1283 * parse the strings 'rateOf', 'implies', 'max', 'min', 'quotient', and 1284 * 'rem' all as {@link libsbmlConstants#AST_FUNCTION AST_FUNCTION} with the appropriate 1285 * name set. 1286 * </ul> 1287 <p> 1288 * @see #setParsePackageMath() 1289 */ public 1290 boolean getParseL3v2Functions() { 1291 return libsbmlJNI.L3ParserSettings_getParseL3v2Functions(swigCPtr, this); 1292 } 1293 1294 1295/** 1296 * Sets the behavior for handling functions added in SBML packages 1297 <p> 1298 * <p> 1299 * This setting affects whether the math added in a given SBML 1300 * Level 3 package are parsed as those added MathML elements, 1301 * or whether they are added as generic functions or variables 1302 * with those names. 1303 <p> 1304 * This method lets you tell the parser which behavior to use—either 1305 * to parse the functions added in a given package as their built-in counterparts, 1306 * or as generic functions with that name (to be defined by SBML as 1307 * function definitions). The two possibilities are 1308 * represented using the following constants: 1309 <p> 1310 * <p> 1311 * <ul> 1312 * <li> {@link libsbmlConstants#L3P_PARSE_PACKAGE_MATH_DIRECTLY L3P_PARSE_PACKAGE_MATH_DIRECTLY} (value = <code>true</code>): parse any 1313 * string defined in a given SBML L3 package as its corresponding ASTType_t. 1314 * <li> {@link libsbmlConstants#L3P_PARSE_PACKAGE_MATH_AS_GENERIC L3P_PARSE_PACKAGE_MATH_AS_GENERIC} (value = <code>false</code>): 1315 * parse any string that would have been defined in the given SBML L3 package 1316 * as {@link libsbmlConstants#AST_FUNCTION AST_FUNCTION} or {@link libsbmlConstants#AST_NAME AST_NAME} 1317 * with the appropriate name set. 1318 * </ul> 1319 <p> 1320 * @param package a boolean value (one of the constants 1321 * {@link libsbmlConstants#L3P_PARSE_L3V2_FUNCTIONS_DIRECTLY L3P_PARSE_L3V2_FUNCTIONS_DIRECTLY} or 1322 * {@link libsbmlConstants#L3P_PARSE_L3V2_FUNCTIONS_AS_GENERIC L3P_PARSE_L3V2_FUNCTIONS_AS_GENERIC}) 1323 * indicating how to interpret those function names. 1324 * @param parsepackage a boolean 1325 <p> 1326 * @see #getParsePackageMath() 1327 */ public 1328 void setParsePackageMath(int arg0, boolean parsepackage) { 1329 libsbmlJNI.L3ParserSettings_setParsePackageMath(swigCPtr, this, arg0, parsepackage); 1330 } 1331 1332 1333/** 1334 * Indicates the current behavior set for handling whether to 1335 * parse the functions added in the given package as that MathML or not. 1336 <p> 1337 * <p> 1338 * This setting affects whether the math added in a given SBML 1339 * Level 3 package are parsed as those added MathML elements, 1340 * or whether they are added as generic functions or variables 1341 * with those names. 1342 <p> 1343 * @return A boolean indicating the behavior currently set. The possible 1344 * values are as follows: 1345 * <p> 1346 * <ul> 1347 * <li> {@link libsbmlConstants#L3P_PARSE_PACKAGE_MATH_DIRECTLY L3P_PARSE_PACKAGE_MATH_DIRECTLY} (value = <code>true</code>): parse any 1348 * string defined in a given SBML L3 package as its corresponding ASTType_t. 1349 * <li> {@link libsbmlConstants#L3P_PARSE_PACKAGE_MATH_AS_GENERIC L3P_PARSE_PACKAGE_MATH_AS_GENERIC} (value = <code>false</code>): 1350 * parse any string that would have been defined in the given SBML L3 package 1351 * as {@link libsbmlConstants#AST_FUNCTION AST_FUNCTION} or {@link libsbmlConstants#AST_NAME AST_NAME} 1352 * with the appropriate name set. 1353 * </ul> 1354 <p> 1355 * @see #setParsePackageMath(boolean) 1356 */ public 1357 boolean getParsePackageMath(int arg0) { 1358 return libsbmlJNI.L3ParserSettings_getParsePackageMath(swigCPtr, this, arg0); 1359 } 1360 1361 1362/** * @internal */ public 1363 void visitPackageInfixSyntax(ASTNode parent, ASTNode node, SWIGTYPE_p_StringBuffer_t sb) { 1364 libsbmlJNI.L3ParserSettings_visitPackageInfixSyntax(swigCPtr, this, ASTNode.getCPtr(parent), parent, ASTNode.getCPtr(node), node, SWIGTYPE_p_StringBuffer_t.getCPtr(sb)); 1365 } 1366 1367}