001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 3.0.10 004 * 005 * Do not make changes to this file unless you know what you are doing--modify 006 * the SWIG interface file instead. 007 * ----------------------------------------------------------------------------- */ 008 009package org.sbml.libsbml; 010 011/** 012 * <span class="pkg-marker pkg-color-comp"><a href="group__comp.html">comp</a></span> 013 A model instance inside another model. 014 <p> 015 * The {@link Submodel} class was introduced by the SBML Level 3 <a href='../../../extensions-summary.html#comp'>Hierarchical Model Composition</a> 016 * (“comp”) package as the principle way by which models are 017 * structured hierarchically. Submodels are instantiations of models 018 * contained within other models. They reference another {@link Model} that is to be 019 * instantiated within its parent {@link Model}, and additionally define how that 020 * {@link Model} is to be modified before instantiation. 021 <p> 022 * The {@link Submodel} object class has a required attribute 'modelRef', which must 023 * reference another {@link Model} or {@link ExternalModelDefinition} object present in the 024 * SBML Document. This referenced {@link Model} is the model to be instantiated. 025 <p> 026 * It also has a required attribute, 'id', to give the submodel a unique 027 * identifier by which other parts of an SBML model definition can refer to 028 * it, and an optional 'name' attribute of type <code>string.</code> Identifiers and 029 * names must be used according to the guidelines described in the SBML 030 * specification. 031 <p> 032 * The {@link Submodel} class also provides constructs that define how the referenced 033 * {@link Model} object is to be modified before it is instantiated in the enclosing 034 * model. If numerical values in the referenced model must be changed in order 035 * to fit them into their new context as part of the submodel, the changes can 036 * be handled through conversion factors. If one or more structural features 037 * in the referenced model are undesirable and should be removed, the changes 038 * can be handled through deletions. (For example, an initial assignment or 039 * reaction may not be relevant in its new context and should be removed.) 040 <p> 041 * In some cases, the referenced {@link Model} may have been written with different 042 * units than the containing model. For most model elements, this is not a 043 * problem: it is already possible to have {@link Species} and {@link Parameter} objects with 044 * different units in a single model, for example, so in this case the 045 * resulting hierarchical model would be treated in exactly the same way as 046 * any other model with {@link Species} and Parameters with different units. 047 <p> 048 * However, two units in SBML models are fixed and must not vary between SBML 049 * elements: time and extent. The units of time are set once per model, and 050 * affect the core elements of {@link RateRule}, {@link KineticLaw}, {@link Delay}, and the 051 * csymbols 'time' and 'delay'. Even if the model does not explicitly state 052 * what the units of time actually are, they are defined to be consistent 053 * across the model, and therefore might differ from the units of time across 054 * a parent model. To correct this imbalance, the optional attribute 055 * 'timeConversionFactor' may be used, which, if defined, must reference a 056 * constant parameter in the parent model. The value of the time conversion 057 * factor should be defined such that a single unit of time in the {@link Submodel} 058 * multiplied by the time conversion factor should equal a single unit of 059 * time in the parent model. 060 <p> 061 * Extent is the unit in SBML that defines how the {@link KineticLaw} of a {@link Reaction} 062 * affects species quantities: kinetic laws are defined to be in units of 063 * extent/time. No other SBML core construct is defined in terms of extent. 064 * If the effective units of extent in a submodel differ from the effective 065 * units of extent in the parent model (regardless of whether either defined 066 * what those units actually are), the optional attribute 067 * 'extentConversionFactor' may be used, which, if defined, must reference a 068 * constant parameter in the parent model. The value of the extent conversion 069 * factor should be defined such that a single unit of extent in the {@link Submodel} 070 * multiplied by the extent conversion factor should equal a single unit of 071 * extent in the parent model. 072 <p> 073 * If features of the referenced model must be removed, a {@link Deletion} should be added 074 * to the {@link Submodel} object. A {@link Submodel} may contain a child {@link ListOfDeletions}, which 075 * in turn may contain one or more {@link Deletion} items. Each {@link Deletion} references a single 076 * element of the referenced {@link Model} that must be removed before instantiating that 077 * {@link Model} as a submodel of the parent {@link Model}. 078 */ 079 080public class Submodel extends CompBase { 081 private long swigCPtr; 082 083 protected Submodel(long cPtr, boolean cMemoryOwn) 084 { 085 super(libsbmlJNI.Submodel_SWIGUpcast(cPtr), cMemoryOwn); 086 swigCPtr = cPtr; 087 } 088 089 protected static long getCPtr(Submodel obj) 090 { 091 return (obj == null) ? 0 : obj.swigCPtr; 092 } 093 094 protected static long getCPtrAndDisown (Submodel obj) 095 { 096 long ptr = 0; 097 098 if (obj != null) 099 { 100 ptr = obj.swigCPtr; 101 obj.swigCMemOwn = false; 102 } 103 104 return ptr; 105 } 106 107 protected void finalize() { 108 delete(); 109 } 110 111 public synchronized void delete() { 112 if (swigCPtr != 0) { 113 if (swigCMemOwn) { 114 swigCMemOwn = false; 115 libsbmlJNI.delete_Submodel(swigCPtr); 116 } 117 swigCPtr = 0; 118 } 119 super.delete(); 120 } 121 122 123/** 124 * Creates a new {@link Submodel} with the given level, version, and package 125 * version. 126 <p> 127 * @param level the SBML Level. 128 * @param version the Version within the SBML Level. 129 * @param pkgVersion the version of the package. 130 <p> 131 * <p> 132 * @note Attempting to add an object to an {@link SBMLDocument} having a different 133 * combination of SBML Level, Version and XML namespaces than the object 134 * itself will result in an error at the time a caller attempts to make the 135 * addition. A parent object must have compatible Level, Version and XML 136 * namespaces. (Strictly speaking, a parent may also have more XML 137 * namespaces than a child, but the reverse is not permitted.) The 138 * restriction is necessary to ensure that an SBML model has a consistent 139 * overall structure. This requires callers to manage their objects 140 * carefully, but the benefit is increased flexibility in how models can be 141 * created by permitting callers to create objects bottom-up if desired. In 142 * situations where objects are not yet attached to parents (e.g., 143 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 144 * libSBML determine such things as whether it is valid to assign a 145 * particular value to an attribute. For packages, this means that the 146 * parent object to which this package element is being added must have 147 * been created with the package namespace, or that the package namespace 148 * was added to it, even if that parent is not a package object itself. 149 */ public 150 Submodel(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 151 this(libsbmlJNI.new_Submodel__SWIG_0(level, version, pkgVersion), true); 152 } 153 154 155/** 156 * Creates a new {@link Submodel} with the given level, version, and package 157 * version. 158 <p> 159 * @param level the SBML Level. 160 * @param version the Version within the SBML Level. 161 * @param pkgVersion the version of the package. 162 <p> 163 * <p> 164 * @note Attempting to add an object to an {@link SBMLDocument} having a different 165 * combination of SBML Level, Version and XML namespaces than the object 166 * itself will result in an error at the time a caller attempts to make the 167 * addition. A parent object must have compatible Level, Version and XML 168 * namespaces. (Strictly speaking, a parent may also have more XML 169 * namespaces than a child, but the reverse is not permitted.) The 170 * restriction is necessary to ensure that an SBML model has a consistent 171 * overall structure. This requires callers to manage their objects 172 * carefully, but the benefit is increased flexibility in how models can be 173 * created by permitting callers to create objects bottom-up if desired. In 174 * situations where objects are not yet attached to parents (e.g., 175 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 176 * libSBML determine such things as whether it is valid to assign a 177 * particular value to an attribute. For packages, this means that the 178 * parent object to which this package element is being added must have 179 * been created with the package namespace, or that the package namespace 180 * was added to it, even if that parent is not a package object itself. 181 */ public 182 Submodel(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 183 this(libsbmlJNI.new_Submodel__SWIG_1(level, version), true); 184 } 185 186 187/** 188 * Creates a new {@link Submodel} with the given level, version, and package 189 * version. 190 <p> 191 * @param level the SBML Level. 192 * @param version the Version within the SBML Level. 193 * @param pkgVersion the version of the package. 194 <p> 195 * <p> 196 * @note Attempting to add an object to an {@link SBMLDocument} having a different 197 * combination of SBML Level, Version and XML namespaces than the object 198 * itself will result in an error at the time a caller attempts to make the 199 * addition. A parent object must have compatible Level, Version and XML 200 * namespaces. (Strictly speaking, a parent may also have more XML 201 * namespaces than a child, but the reverse is not permitted.) The 202 * restriction is necessary to ensure that an SBML model has a consistent 203 * overall structure. This requires callers to manage their objects 204 * carefully, but the benefit is increased flexibility in how models can be 205 * created by permitting callers to create objects bottom-up if desired. In 206 * situations where objects are not yet attached to parents (e.g., 207 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 208 * libSBML determine such things as whether it is valid to assign a 209 * particular value to an attribute. For packages, this means that the 210 * parent object to which this package element is being added must have 211 * been created with the package namespace, or that the package namespace 212 * was added to it, even if that parent is not a package object itself. 213 */ public 214 Submodel(long level) throws org.sbml.libsbml.SBMLConstructorException { 215 this(libsbmlJNI.new_Submodel__SWIG_2(level), true); 216 } 217 218 219/** 220 * Creates a new {@link Submodel} with the given level, version, and package 221 * version. 222 <p> 223 * @param level the SBML Level. 224 * @param version the Version within the SBML Level. 225 * @param pkgVersion the version of the package. 226 <p> 227 * <p> 228 * @note Attempting to add an object to an {@link SBMLDocument} having a different 229 * combination of SBML Level, Version and XML namespaces than the object 230 * itself will result in an error at the time a caller attempts to make the 231 * addition. A parent object must have compatible Level, Version and XML 232 * namespaces. (Strictly speaking, a parent may also have more XML 233 * namespaces than a child, but the reverse is not permitted.) The 234 * restriction is necessary to ensure that an SBML model has a consistent 235 * overall structure. This requires callers to manage their objects 236 * carefully, but the benefit is increased flexibility in how models can be 237 * created by permitting callers to create objects bottom-up if desired. In 238 * situations where objects are not yet attached to parents (e.g., 239 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 240 * libSBML determine such things as whether it is valid to assign a 241 * particular value to an attribute. For packages, this means that the 242 * parent object to which this package element is being added must have 243 * been created with the package namespace, or that the package namespace 244 * was added to it, even if that parent is not a package object itself. 245 */ public 246 Submodel() throws org.sbml.libsbml.SBMLConstructorException { 247 this(libsbmlJNI.new_Submodel__SWIG_3(), true); 248 } 249 250 251/** 252 * Creates a new {@link Submodel} with the given {@link CompPkgNamespaces} object. 253 <p> 254 * <p> 255 * The package namespaces object used in this constructor is derived from a 256 * {@link SBMLNamespaces} object, which encapsulates SBML Level/Version/namespaces 257 * information. It is used to communicate the SBML Level, Version, and 258 * package version and name information used in addition to SBML Level 3 Core. A 259 * common approach to using libSBML's {@link SBMLNamespaces} facilities is to create an 260 * package namespace object somewhere in a program once, then hand that object 261 * as needed to object constructors of that package that accept it as and 262 * argument, such as this one. 263 <p> 264 * @param compns the {@link CompPkgNamespaces} object. 265 <p> 266 * <p> 267 * @note Attempting to add an object to an {@link SBMLDocument} having a different 268 * combination of SBML Level, Version and XML namespaces than the object 269 * itself will result in an error at the time a caller attempts to make the 270 * addition. A parent object must have compatible Level, Version and XML 271 * namespaces. (Strictly speaking, a parent may also have more XML 272 * namespaces than a child, but the reverse is not permitted.) The 273 * restriction is necessary to ensure that an SBML model has a consistent 274 * overall structure. This requires callers to manage their objects 275 * carefully, but the benefit is increased flexibility in how models can be 276 * created by permitting callers to create objects bottom-up if desired. In 277 * situations where objects are not yet attached to parents (e.g., 278 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 279 * libSBML determine such things as whether it is valid to assign a 280 * particular value to an attribute. For packages, this means that the 281 * parent object to which this package element is being added must have 282 * been created with the package namespace, or that the package namespace 283 * was added to it, even if that parent is not a package object itself. 284 */ public 285 Submodel(CompPkgNamespaces compns) throws org.sbml.libsbml.SBMLConstructorException { 286 this(libsbmlJNI.new_Submodel__SWIG_4(CompPkgNamespaces.getCPtr(compns), compns), true); 287 } 288 289 290/** 291 * Copy constructor. 292 <p> 293 * @param source the instance to copy. 294 */ public 295 Submodel(Submodel source) throws org.sbml.libsbml.SBMLConstructorException { 296 this(libsbmlJNI.new_Submodel__SWIG_5(Submodel.getCPtr(source), source), true); 297 } 298 299 300/** 301 * Creates and returns a deep copy of this {@link Submodel} object. 302 <p> 303 * @return a (deep) copy of this {@link Submodel} object. 304 */ public 305 SBase cloneObject() { 306 long cPtr = libsbmlJNI.Submodel_cloneObject(swigCPtr, this); 307 return (cPtr == 0) ? null : new Submodel(cPtr, true); 308 } 309 310 311/** 312 * Returns the first child element found that has the given <code>id</code> in the 313 * model-wide SId namespace, or <code>null</code> if no such object is found. 314 <p> 315 * @param id string representing the id of the object to find. 316 <p> 317 * @return a pointer to the {@link SBase} element with the given <code>id</code>. 318 */ public 319 SBase getElementBySId(String id) { 320 return libsbml.DowncastSBase(libsbmlJNI.Submodel_getElementBySId(swigCPtr, this, id), false); 321} 322 323 324/** 325 * Returns the first child element it can find with the given <code>metaid</code>, or 326 * itself if it has the given <code>metaid</code>, or <code>null</code> if no such object is found. 327 <p> 328 * @param metaid string representing the metaid of the object to find. 329 <p> 330 * @return a pointer to the {@link SBase} element with the given <code>metaid</code>. 331 */ public 332 SBase getElementByMetaId(String metaid) { 333 return libsbml.DowncastSBase(libsbmlJNI.Submodel_getElementByMetaId(swigCPtr, this, metaid), false); 334} 335 336 337/** 338 * Returns the value of the 'id' attribute of this {@link Submodel}. 339 <p> 340 * @note Because of the inconsistent behavior of this function with 341 * respect to assignments and rules, it is now recommended to 342 * use the getIdAttribute() function instead. 343 <p> 344 * <p> 345 * The identifier given by an object's 'id' attribute value 346 * is used to identify the object within the SBML model definition. 347 * Other objects can refer to the component using this identifier. The 348 * data type of 'id' is always <code>SId</code> or a type derived 349 * from that, such as <code>UnitSId</code>, depending on the object in 350 * question. All data types are defined as follows: 351 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'> 352 * letter .= 'a'..'z','A'..'Z' 353 * digit .= '0'..'9' 354 * idChar .= letter | digit | '_' 355 * SId .= ( letter | '_' ) idChar* 356 * </pre> 357 <p> 358 * The characters <code>(</code> and <code>)</code> are used for grouping, the 359 * character <code>*</code> 'zero or more times', and the character 360 * <code>|</code> indicates logical 'or'. The equality of SBML identifiers is 361 * determined by an exact character sequence match; i.e., comparisons must be 362 * performed in a case-sensitive manner. This applies to all uses of <code>SId</code>, 363 * <code>SIdRef</code>, and derived types. 364 <p> 365 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 366 * moved to {@link SBase} directly, instead of being defined individually for many 367 * (but not all) objects. Libsbml has for a long time provided functions 368 * defined on {@link SBase} itself to get, set, check, and unset those attributes, which 369 * would fail or otherwise return empty strings if executed on any object 370 * for which those attributes were not defined. Now that all {@link SBase} objects 371 * define those attributes, those functions now succeed for any object with 372 * the appropriate level and version. 373 <p> 374 * The exception to this rule is that for {@link InitialAssignment}, {@link EventAssignment}, 375 * {@link AssignmentRule}, and {@link RateRule} objects, the getId() function and the isSetId() 376 * functions (though not the setId() or unsetId() functions) would instead 377 * reference the value of the 'variable' attribute (for the rules and event 378 * assignments) or the 'symbol' attribute (for initial assignments). 379 * The {@link AlgebraicRule} fell into this category as well, though because it 380 * contained neither a 'variable' nor a 'symbol' attribute, getId() would 381 * always return an empty string, and isSetId() would always return <code>false.</code> 382 * For this reason, four new functions are now provided 383 * (getIdAttribute(), setIdAttribute(String), 384 * isSetIdAttribute(), and unsetIdAttribute()) that will always 385 * act on the actual 'id' attribute, regardless of the object's type. The 386 * new functions should be used instead of the old ones unless the old behavior 387 * is somehow necessary. 388 <p> 389 * Regardless of the level and version of the SBML, these functions allow 390 * client applications to use more generalized code in some situations 391 * (for instance, when manipulating objects that are all known to have 392 * identifiers). If the object in question does not posess an 'id' attribute 393 * according to the SBML specification for the Level and Version in use, 394 * libSBML will not allow the identifier to be set, nor will it read or 395 * write 'id' attributes for those objects. 396 <p> 397 * @return the id of this {@link Submodel}. 398 <p> 399 * @see #getIdAttribute() 400 * @see #setIdAttribute(String sid) 401 * @see #isSetIdAttribute() 402 * @see #unsetIdAttribute() 403 */ public 404 String getId() { 405 return libsbmlJNI.Submodel_getId(swigCPtr, this); 406 } 407 408 409/** 410 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 411 * {@link Submodel}'s 'id' attribute has been set. 412 <p> 413 * <p> 414 * @note Because of the inconsistent behavior of this function with 415 * respect to assignments and rules, it is now recommended to 416 * use the isSetIdAttribute() function instead. 417 <p> 418 * <p> 419 * The identifier given by an object's 'id' attribute value 420 * is used to identify the object within the SBML model definition. 421 * Other objects can refer to the component using this identifier. The 422 * data type of 'id' is always <code>SId</code> or a type derived 423 * from that, such as <code>UnitSId</code>, depending on the object in 424 * question. All data types are defined as follows: 425 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'> 426 * letter .= 'a'..'z','A'..'Z' 427 * digit .= '0'..'9' 428 * idChar .= letter | digit | '_' 429 * SId .= ( letter | '_' ) idChar* 430 * </pre> 431 <p> 432 * The characters <code>(</code> and <code>)</code> are used for grouping, the 433 * character <code>*</code> 'zero or more times', and the character 434 * <code>|</code> indicates logical 'or'. The equality of SBML identifiers is 435 * determined by an exact character sequence match; i.e., comparisons must be 436 * performed in a case-sensitive manner. This applies to all uses of <code>SId</code>, 437 * <code>SIdRef</code>, and derived types. 438 <p> 439 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 440 * moved to {@link SBase} directly, instead of being defined individually for many 441 * (but not all) objects. Libsbml has for a long time provided functions 442 * defined on {@link SBase} itself to get, set, check, and unset those attributes, which 443 * would fail or otherwise return empty strings if executed on any object 444 * for which those attributes were not defined. Now that all {@link SBase} objects 445 * define those attributes, those functions now succeed for any object with 446 * the appropriate level and version. 447 <p> 448 * The exception to this rule is that for {@link InitialAssignment}, {@link EventAssignment}, 449 * {@link AssignmentRule}, and {@link RateRule} objects, the getId() function and the isSetId() 450 * functions (though not the setId() or unsetId() functions) would instead 451 * reference the value of the 'variable' attribute (for the rules and event 452 * assignments) or the 'symbol' attribute (for initial assignments). 453 * The {@link AlgebraicRule} fell into this category as well, though because it 454 * contained neither a 'variable' nor a 'symbol' attribute, getId() would 455 * always return an empty string, and isSetId() would always return <code>false.</code> 456 * For this reason, four new functions are now provided 457 * (getIdAttribute(), setIdAttribute(String), 458 * isSetIdAttribute(), and unsetIdAttribute()) that will always 459 * act on the actual 'id' attribute, regardless of the object's type. The 460 * new functions should be used instead of the old ones unless the old behavior 461 * is somehow necessary. 462 <p> 463 * Regardless of the level and version of the SBML, these functions allow 464 * client applications to use more generalized code in some situations 465 * (for instance, when manipulating objects that are all known to have 466 * identifiers). If the object in question does not posess an 'id' attribute 467 * according to the SBML specification for the Level and Version in use, 468 * libSBML will not allow the identifier to be set, nor will it read or 469 * write 'id' attributes for those objects. 470 <p> 471 * @return <code>true</code> if the 'id' attribute of this SBML object is 472 * set, <code>false</code> otherwise. 473 <p> 474 * @see #getIdAttribute() 475 * @see #setIdAttribute(String sid) 476 * @see #unsetIdAttribute() 477 * @see #isSetIdAttribute() 478 */ public 479 boolean isSetId() { 480 return libsbmlJNI.Submodel_isSetId(swigCPtr, this); 481 } 482 483 484/** 485 * Sets the value of the 'id' attribute of this {@link Submodel}. 486 <p> 487 * <p> 488 * The string <code>sid</code> is copied. 489 <p> 490 * <p> 491 * The identifier given by an object's 'id' attribute value 492 * is used to identify the object within the SBML model definition. 493 * Other objects can refer to the component using this identifier. The 494 * data type of 'id' is always <code>SId</code> or a type derived 495 * from that, such as <code>UnitSId</code>, depending on the object in 496 * question. All data types are defined as follows: 497 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'> 498 * letter .= 'a'..'z','A'..'Z' 499 * digit .= '0'..'9' 500 * idChar .= letter | digit | '_' 501 * SId .= ( letter | '_' ) idChar* 502 * </pre> 503 <p> 504 * The characters <code>(</code> and <code>)</code> are used for grouping, the 505 * character <code>*</code> 'zero or more times', and the character 506 * <code>|</code> indicates logical 'or'. The equality of SBML identifiers is 507 * determined by an exact character sequence match; i.e., comparisons must be 508 * performed in a case-sensitive manner. This applies to all uses of <code>SId</code>, 509 * <code>SIdRef</code>, and derived types. 510 <p> 511 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 512 * moved to {@link SBase} directly, instead of being defined individually for many 513 * (but not all) objects. Libsbml has for a long time provided functions 514 * defined on {@link SBase} itself to get, set, check, and unset those attributes, which 515 * would fail or otherwise return empty strings if executed on any object 516 * for which those attributes were not defined. Now that all {@link SBase} objects 517 * define those attributes, those functions now succeed for any object with 518 * the appropriate level and version. 519 <p> 520 * The exception to this rule is that for {@link InitialAssignment}, {@link EventAssignment}, 521 * {@link AssignmentRule}, and {@link RateRule} objects, the getId() function and the isSetId() 522 * functions (though not the setId() or unsetId() functions) would instead 523 * reference the value of the 'variable' attribute (for the rules and event 524 * assignments) or the 'symbol' attribute (for initial assignments). 525 * The {@link AlgebraicRule} fell into this category as well, though because it 526 * contained neither a 'variable' nor a 'symbol' attribute, getId() would 527 * always return an empty string, and isSetId() would always return <code>false.</code> 528 * For this reason, four new functions are now provided 529 * (getIdAttribute(), setIdAttribute(String), 530 * isSetIdAttribute(), and unsetIdAttribute()) that will always 531 * act on the actual 'id' attribute, regardless of the object's type. The 532 * new functions should be used instead of the old ones unless the old behavior 533 * is somehow necessary. 534 <p> 535 * Regardless of the level and version of the SBML, these functions allow 536 * client applications to use more generalized code in some situations 537 * (for instance, when manipulating objects that are all known to have 538 * identifiers). If the object in question does not posess an 'id' attribute 539 * according to the SBML specification for the Level and Version in use, 540 * libSBML will not allow the identifier to be set, nor will it read or 541 * write 'id' attributes for those objects. 542 <p> 543 * @param sid the string to use as the identifier of this object. 544 <p> 545 * <p> 546 * @return integer value indicating success/failure of the 547 * function. The possible values 548 * returned by this function are: 549 * <ul> 550 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 551 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 552 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE} 553 * 554 * </ul> <p> 555 * @see #getIdAttribute() 556 * @see #setIdAttribute(String sid) 557 * @see #isSetIdAttribute() 558 * @see #unsetIdAttribute() 559 */ public 560 int setId(String sid) { 561 return libsbmlJNI.Submodel_setId(swigCPtr, this, sid); 562 } 563 564 565/** 566 * Unsets the value of the 'id' attribute of this {@link Submodel}. 567 <p> 568 * <p> 569 * <p> 570 * The identifier given by an object's 'id' attribute value 571 * is used to identify the object within the SBML model definition. 572 * Other objects can refer to the component using this identifier. The 573 * data type of 'id' is always <code>SId</code> or a type derived 574 * from that, such as <code>UnitSId</code>, depending on the object in 575 * question. All data types are defined as follows: 576 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'> 577 * letter .= 'a'..'z','A'..'Z' 578 * digit .= '0'..'9' 579 * idChar .= letter | digit | '_' 580 * SId .= ( letter | '_' ) idChar* 581 * </pre> 582 <p> 583 * The characters <code>(</code> and <code>)</code> are used for grouping, the 584 * character <code>*</code> 'zero or more times', and the character 585 * <code>|</code> indicates logical 'or'. The equality of SBML identifiers is 586 * determined by an exact character sequence match; i.e., comparisons must be 587 * performed in a case-sensitive manner. This applies to all uses of <code>SId</code>, 588 * <code>SIdRef</code>, and derived types. 589 <p> 590 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 591 * moved to {@link SBase} directly, instead of being defined individually for many 592 * (but not all) objects. Libsbml has for a long time provided functions 593 * defined on {@link SBase} itself to get, set, check, and unset those attributes, which 594 * would fail or otherwise return empty strings if executed on any object 595 * for which those attributes were not defined. Now that all {@link SBase} objects 596 * define those attributes, those functions now succeed for any object with 597 * the appropriate level and version. 598 <p> 599 * The exception to this rule is that for {@link InitialAssignment}, {@link EventAssignment}, 600 * {@link AssignmentRule}, and {@link RateRule} objects, the getId() function and the isSetId() 601 * functions (though not the setId() or unsetId() functions) would instead 602 * reference the value of the 'variable' attribute (for the rules and event 603 * assignments) or the 'symbol' attribute (for initial assignments). 604 * The {@link AlgebraicRule} fell into this category as well, though because it 605 * contained neither a 'variable' nor a 'symbol' attribute, getId() would 606 * always return an empty string, and isSetId() would always return <code>false.</code> 607 * For this reason, four new functions are now provided 608 * (getIdAttribute(), setIdAttribute(String), 609 * isSetIdAttribute(), and unsetIdAttribute()) that will always 610 * act on the actual 'id' attribute, regardless of the object's type. The 611 * new functions should be used instead of the old ones unless the old behavior 612 * is somehow necessary. 613 <p> 614 * Regardless of the level and version of the SBML, these functions allow 615 * client applications to use more generalized code in some situations 616 * (for instance, when manipulating objects that are all known to have 617 * identifiers). If the object in question does not posess an 'id' attribute 618 * according to the SBML specification for the Level and Version in use, 619 * libSBML will not allow the identifier to be set, nor will it read or 620 * write 'id' attributes for those objects. 621 <p> 622 * <p> 623 * @return integer value indicating success/failure of the 624 * function. The possible values 625 * returned by this function are: 626 * <ul> 627 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 628 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 629 * 630 * </ul> <p> 631 * @see #getIdAttribute() 632 * @see #setIdAttribute(String sid) 633 * @see #isSetIdAttribute() 634 * @see #unsetIdAttribute() 635 */ public 636 int unsetId() { 637 return libsbmlJNI.Submodel_unsetId(swigCPtr, this); 638 } 639 640 641/** 642 * Returns the value of the 'name' attribute of this {@link Submodel} object. 643 <p> 644 * <p> 645 * <p> 646 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 647 * moved to {@link SBase} directly, instead of being defined individually for many 648 * (but not all) objects. Libsbml has for a long time provided functions 649 * defined on {@link SBase} itself to get, set, and unset those attributes, which 650 * would fail or otherwise return empty strings if executed on any object 651 * for which those attributes were not defined. Now that all {@link SBase} objects 652 * define those attributes, those functions now succeed for any object with 653 * the appropriate level and version. 654 <p> 655 * The 'name' attribute is 656 * optional and is not intended to be used for cross-referencing purposes 657 * within a model. Its purpose instead is to provide a human-readable 658 * label for the component. The data type of 'name' is the type 659 * <code>string</code> defined in XML Schema. SBML imposes no 660 * restrictions as to the content of 'name' attributes beyond those 661 * restrictions defined by the <code>string</code> type in XML Schema. 662 <p> 663 * The recommended practice for handling 'name' is as follows. If a 664 * software tool has the capability for displaying the content of 'name' 665 * attributes, it should display this content to the user as a 666 * component's label instead of the component's 'id'. If the user 667 * interface does not have this capability (e.g., because it cannot 668 * display or use special characters in symbol names), or if the 'name' 669 * attribute is missing on a given component, then the user interface 670 * should display the value of the 'id' attribute instead. (Script 671 * language interpreters are especially likely to display 'id' instead of 672 * 'name'.) 673 <p> 674 * As a consequence of the above, authors of systems that automatically 675 * generate the values of 'id' attributes should be aware some systems 676 * may display the 'id''s to the user. Authors therefore may wish to 677 * take some care to have their software create 'id' values that are: (a) 678 * reasonably easy for humans to type and read; and (b) likely to be 679 * meaningful, for example by making the 'id' attribute be an abbreviated 680 * form of the name attribute value. 681 <p> 682 * An additional point worth mentioning is although there are 683 * restrictions on the uniqueness of 'id' values, there are no 684 * restrictions on the uniqueness of 'name' values in a model. This 685 * allows software applications leeway in assigning component identifiers. 686 <p> 687 * Regardless of the level and version of the SBML, these functions allow 688 * client applications to use more generalized code in some situations 689 * (for instance, when manipulating objects that are all known to have 690 * names). If the object in question does not posess a 'name' attribute 691 * according to the SBML specification for the Level and Version in use, 692 * libSBML will not allow the name to be set, nor will it read or 693 * write 'name' attributes for those objects. 694 <p> 695 * @return the name of this SBML object, or the empty string if not set or unsettable. 696 <p> 697 * @see #getIdAttribute() 698 * @see #isSetName() 699 * @see #setName(String sid) 700 * @see #unsetName() 701 */ public 702 String getName() { 703 return libsbmlJNI.Submodel_getName(swigCPtr, this); 704 } 705 706 707/** 708 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 709 * {@link Submodel}'s 'name' attribute has been set. 710 <p> 711 * <p> 712 * <p> 713 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 714 * moved to {@link SBase} directly, instead of being defined individually for many 715 * (but not all) objects. Libsbml has for a long time provided functions 716 * defined on {@link SBase} itself to get, set, and unset those attributes, which 717 * would fail or otherwise return empty strings if executed on any object 718 * for which those attributes were not defined. Now that all {@link SBase} objects 719 * define those attributes, those functions now succeed for any object with 720 * the appropriate level and version. 721 <p> 722 * The 'name' attribute is 723 * optional and is not intended to be used for cross-referencing purposes 724 * within a model. Its purpose instead is to provide a human-readable 725 * label for the component. The data type of 'name' is the type 726 * <code>string</code> defined in XML Schema. SBML imposes no 727 * restrictions as to the content of 'name' attributes beyond those 728 * restrictions defined by the <code>string</code> type in XML Schema. 729 <p> 730 * The recommended practice for handling 'name' is as follows. If a 731 * software tool has the capability for displaying the content of 'name' 732 * attributes, it should display this content to the user as a 733 * component's label instead of the component's 'id'. If the user 734 * interface does not have this capability (e.g., because it cannot 735 * display or use special characters in symbol names), or if the 'name' 736 * attribute is missing on a given component, then the user interface 737 * should display the value of the 'id' attribute instead. (Script 738 * language interpreters are especially likely to display 'id' instead of 739 * 'name'.) 740 <p> 741 * As a consequence of the above, authors of systems that automatically 742 * generate the values of 'id' attributes should be aware some systems 743 * may display the 'id''s to the user. Authors therefore may wish to 744 * take some care to have their software create 'id' values that are: (a) 745 * reasonably easy for humans to type and read; and (b) likely to be 746 * meaningful, for example by making the 'id' attribute be an abbreviated 747 * form of the name attribute value. 748 <p> 749 * An additional point worth mentioning is although there are 750 * restrictions on the uniqueness of 'id' values, there are no 751 * restrictions on the uniqueness of 'name' values in a model. This 752 * allows software applications leeway in assigning component identifiers. 753 <p> 754 * Regardless of the level and version of the SBML, these functions allow 755 * client applications to use more generalized code in some situations 756 * (for instance, when manipulating objects that are all known to have 757 * names). If the object in question does not posess a 'name' attribute 758 * according to the SBML specification for the Level and Version in use, 759 * libSBML will not allow the name to be set, nor will it read or 760 * write 'name' attributes for those objects. 761 <p> 762 * @return <code>true</code> if the 'name' attribute of this SBML object is 763 * set, <code>false</code> otherwise. 764 <p> 765 * @see #getName() 766 * @see #setName(String sid) 767 * @see #unsetName() 768 */ public 769 boolean isSetName() { 770 return libsbmlJNI.Submodel_isSetName(swigCPtr, this); 771 } 772 773 774/** 775 * Sets the value of the 'name' attribute of this {@link Submodel}. 776 <p> 777 * <p> 778 * The string in <code>name</code> is copied. 779 <p> 780 * @param name the new name for the SBML object. 781 <p> 782 * <p> 783 * @return integer value indicating success/failure of the 784 * function. The possible values 785 * returned by this function are: 786 * <ul> 787 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 788 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 789 * 790 * </ul> 791 */ public 792 int setName(String name) { 793 return libsbmlJNI.Submodel_setName(swigCPtr, this, name); 794 } 795 796 797/** 798 * Unsets the value of the 'name' attribute of this {@link Submodel}. 799 <p> 800 * <p> 801 * <p> 802 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 803 * moved to {@link SBase} directly, instead of being defined individually for many 804 * (but not all) objects. Libsbml has for a long time provided functions 805 * defined on {@link SBase} itself to get, set, and unset those attributes, which 806 * would fail or otherwise return empty strings if executed on any object 807 * for which those attributes were not defined. Now that all {@link SBase} objects 808 * define those attributes, those functions now succeed for any object with 809 * the appropriate level and version. 810 <p> 811 * The 'name' attribute is 812 * optional and is not intended to be used for cross-referencing purposes 813 * within a model. Its purpose instead is to provide a human-readable 814 * label for the component. The data type of 'name' is the type 815 * <code>string</code> defined in XML Schema. SBML imposes no 816 * restrictions as to the content of 'name' attributes beyond those 817 * restrictions defined by the <code>string</code> type in XML Schema. 818 <p> 819 * The recommended practice for handling 'name' is as follows. If a 820 * software tool has the capability for displaying the content of 'name' 821 * attributes, it should display this content to the user as a 822 * component's label instead of the component's 'id'. If the user 823 * interface does not have this capability (e.g., because it cannot 824 * display or use special characters in symbol names), or if the 'name' 825 * attribute is missing on a given component, then the user interface 826 * should display the value of the 'id' attribute instead. (Script 827 * language interpreters are especially likely to display 'id' instead of 828 * 'name'.) 829 <p> 830 * As a consequence of the above, authors of systems that automatically 831 * generate the values of 'id' attributes should be aware some systems 832 * may display the 'id''s to the user. Authors therefore may wish to 833 * take some care to have their software create 'id' values that are: (a) 834 * reasonably easy for humans to type and read; and (b) likely to be 835 * meaningful, for example by making the 'id' attribute be an abbreviated 836 * form of the name attribute value. 837 <p> 838 * An additional point worth mentioning is although there are 839 * restrictions on the uniqueness of 'id' values, there are no 840 * restrictions on the uniqueness of 'name' values in a model. This 841 * allows software applications leeway in assigning component identifiers. 842 <p> 843 * Regardless of the level and version of the SBML, these functions allow 844 * client applications to use more generalized code in some situations 845 * (for instance, when manipulating objects that are all known to have 846 * names). If the object in question does not posess a 'name' attribute 847 * according to the SBML specification for the Level and Version in use, 848 * libSBML will not allow the name to be set, nor will it read or 849 * write 'name' attributes for those objects. 850 <p> 851 * <p> 852 * @return integer value indicating success/failure of the 853 * function. The possible values 854 * returned by this function are: 855 * <ul> 856 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 857 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 858 * 859 * </ul> <p> 860 * @see #getName() 861 * @see #setName(String sid) 862 * @see #isSetName() 863 */ public 864 int unsetName() { 865 return libsbmlJNI.Submodel_unsetName(swigCPtr, this); 866 } 867 868 869/** 870 * Returns the value of the 'modelRef' attribute of this {@link Submodel}. 871 <p> 872 * @return the value of the 'modelRef' attribute of this {@link Submodel}. 873 */ public 874 String getModelRef() { 875 return libsbmlJNI.Submodel_getModelRef(swigCPtr, this); 876 } 877 878 879/** 880 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 881 * {@link Submodel}'s 'modelRef' attribute has been set. 882 <p> 883 * @return <code>true</code> if this {@link Submodel}'s 'modelRef' attribute has been set, 884 * otherwise <code>false</code> is returned. 885 */ public 886 boolean isSetModelRef() { 887 return libsbmlJNI.Submodel_isSetModelRef(swigCPtr, this); 888 } 889 890 891/** 892 * Sets the value of the 'modelRef' attribute of this {@link Submodel}. Fails if 893 * the modelRef is not a valid syntax for an SIdRef. 894 <p> 895 * <p> 896 * @return integer value indicating success/failure of the 897 * function. The possible values 898 * returned by this function are: 899 * <ul> 900 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 901 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 902 * </ul> 903 */ public 904 int setModelRef(String modelRef) { 905 return libsbmlJNI.Submodel_setModelRef(swigCPtr, this, modelRef); 906 } 907 908 909/** 910 * Unsets the value of the 'modelRef' attribute of this {@link Submodel}. 911 <p> 912 * <p> 913 * @return integer value indicating success/failure of the 914 * function. The possible values 915 * returned by this function are: 916 * <ul> 917 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 918 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 919 * </ul> 920 */ public 921 int unsetModelRef() { 922 return libsbmlJNI.Submodel_unsetModelRef(swigCPtr, this); 923 } 924 925 926/** 927 * Returns an empty string, since 'substanceConversionFactor' is not a part of the comp spec. 928 <p> 929 * @return an empty string. 930 */ public 931 String getSubstanceConversionFactor() { 932 return libsbmlJNI.Submodel_getSubstanceConversionFactor(swigCPtr, this); 933 } 934 935 936/** 937 * Returns <code>false</code>, since 'substanceConversionFactor' is not a part of the comp spec. 938 <p> 939 * @return <code>false.</code> 940 */ public 941 boolean isSetSubstanceConversionFactor() { 942 return libsbmlJNI.Submodel_isSetSubstanceConversionFactor(swigCPtr, this); 943 } 944 945 946/** 947 * Automatically fails, since 'substanceConversionFactor' is not a part of the comp spec. 948 <p> 949 * <p> 950 * @return integer value indicating success/failure of the 951 * function. The possible values 952 * returned by this function are: 953 * <ul> 954 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 955 * </ul> 956 */ public 957 int setSubstanceConversionFactor(String id) { 958 return libsbmlJNI.Submodel_setSubstanceConversionFactor(swigCPtr, this, id); 959 } 960 961 962/** 963 * Automatically fails, since 'substanceConversionFactor' is not a part of the comp spec. 964 <p> 965 * <p> 966 * @return integer value indicating success/failure of the 967 * function. The possible values 968 * returned by this function are: 969 * <ul> 970 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 971 * </ul> 972 */ public 973 int unsetSubstanceConversionFactor() { 974 return libsbmlJNI.Submodel_unsetSubstanceConversionFactor(swigCPtr, this); 975 } 976 977 978/** 979 * Returns the value of the 'timeConversionFactor' attribute of this {@link Submodel}. 980 <p> 981 * @return the value of the 'timeConversionFactor' attribute of this {@link Submodel}. 982 */ public 983 String getTimeConversionFactor() { 984 return libsbmlJNI.Submodel_getTimeConversionFactor(swigCPtr, this); 985 } 986 987 988/** 989 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 990 * {@link Submodel}'s 'timeConversionFactor' attribute has been set. 991 <p> 992 * @return <code>true</code> if this {@link Submodel}'s 'timeConversionFactor' attribute has been set, 993 * otherwise <code>false</code> is returned. 994 */ public 995 boolean isSetTimeConversionFactor() { 996 return libsbmlJNI.Submodel_isSetTimeConversionFactor(swigCPtr, this); 997 } 998 999 1000/** 1001 * Sets the value of the 'timeConversionFactor' attribute of this {@link Submodel}. 1002 * Fails if the id is not a valid syntax for an SIdRef. 1003 <p> 1004 * <p> 1005 * @return integer value indicating success/failure of the 1006 * function. The possible values 1007 * returned by this function are: 1008 * <ul> 1009 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1010 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 1011 * </ul> 1012 */ public 1013 int setTimeConversionFactor(String id) { 1014 return libsbmlJNI.Submodel_setTimeConversionFactor(swigCPtr, this, id); 1015 } 1016 1017 1018/** 1019 * Unsets the value of the 'timeConversionFactor' attribute of this {@link Submodel}. 1020 <p> 1021 * <p> 1022 * @return integer value indicating success/failure of the 1023 * function. The possible values 1024 * returned by this function are: 1025 * <ul> 1026 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1027 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 1028 * </ul> 1029 */ public 1030 int unsetTimeConversionFactor() { 1031 return libsbmlJNI.Submodel_unsetTimeConversionFactor(swigCPtr, this); 1032 } 1033 1034 1035/** 1036 * Returns the value of the 'extentConversionFactor' attribute of this {@link Submodel}. 1037 <p> 1038 * @return the value of the 'extentConversionFactor' attribute of this {@link Submodel}. 1039 */ public 1040 String getExtentConversionFactor() { 1041 return libsbmlJNI.Submodel_getExtentConversionFactor(swigCPtr, this); 1042 } 1043 1044 1045/** 1046 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 1047 * {@link Submodel}'s 'extentConversionFactor' attribute has been set. 1048 <p> 1049 * @return <code>true</code> if this {@link Submodel}'s 'extentConversionFactor' attribute has been set, 1050 * otherwise <code>false</code> is returned. 1051 */ public 1052 boolean isSetExtentConversionFactor() { 1053 return libsbmlJNI.Submodel_isSetExtentConversionFactor(swigCPtr, this); 1054 } 1055 1056 1057/** 1058 * Sets the value of the 'extentConversionFactor' attribute of this 1059 * {@link Submodel}. Fails if the id is not a valid syntax for an SIdRef. 1060 <p> 1061 * <p> 1062 * @return integer value indicating success/failure of the 1063 * function. The possible values 1064 * returned by this function are: 1065 * <ul> 1066 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1067 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 1068 * </ul> 1069 */ public 1070 int setExtentConversionFactor(String id) { 1071 return libsbmlJNI.Submodel_setExtentConversionFactor(swigCPtr, this, id); 1072 } 1073 1074 1075/** 1076 * Unsets the value of the 'extentConversionFactor' attribute of this 1077 * {@link Submodel}. 1078 <p> 1079 * <p> 1080 * @return integer value indicating success/failure of the 1081 * function. The possible values 1082 * returned by this function are: 1083 * <ul> 1084 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1085 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 1086 * </ul> 1087 */ public 1088 int unsetExtentConversionFactor() { 1089 return libsbmlJNI.Submodel_unsetExtentConversionFactor(swigCPtr, this); 1090 } 1091 1092 1093/** 1094 * Returns the {@link ListOf} object that holds all deletions. 1095 <p> 1096 * @return the {@link ListOf} object that holds all deletions. 1097 */ public 1098 ListOfDeletions getListOfDeletions() { 1099 long cPtr = libsbmlJNI.Submodel_getListOfDeletions__SWIG_0(swigCPtr, this); 1100 return (cPtr == 0) ? null : new ListOfDeletions(cPtr, false); 1101 } 1102 1103 1104/** 1105 * Returns the deletion with the given index. 1106 * If the index is invalid, <code>null</code> is returned. 1107 <p> 1108 * @param n the index number of the {@link Deletion} to get. 1109 <p> 1110 * @return the nth {@link Deletion} in the {@link ListOfDeletions}. 1111 */ public 1112 Deletion getDeletion(long n) { 1113 long cPtr = libsbmlJNI.Submodel_getDeletion__SWIG_0(swigCPtr, this, n); 1114 return (cPtr == 0) ? null : new Deletion(cPtr, false); 1115 } 1116 1117 1118/** 1119 * Returns the deletion with the given <code>id</code>. 1120 * If the id is invalid, <code>null</code> is returned. 1121 <p> 1122 * @param id the id of the {@link Deletion} to get. 1123 <p> 1124 * @return the {@link Deletion} in the {@link ListOfDeletions} with the given <code>id</code>. 1125 */ public 1126 Deletion getDeletion(String id) { 1127 long cPtr = libsbmlJNI.Submodel_getDeletion__SWIG_2(swigCPtr, this, id); 1128 return (cPtr == 0) ? null : new Deletion(cPtr, false); 1129 } 1130 1131 1132/** 1133 * Adds a copy of the given {@link Deletion} object to the list of deletions. 1134 <p> 1135 * @param deletion the {@link Deletion} object to be added to the list of 1136 * deletions. Fails if the added deletion is null, does not match the 1137 * level/version/package of the parent object, or cannot be added to the 1138 * list of deletions. 1139 <p> 1140 * <p> 1141 * @return integer value indicating success/failure of the 1142 * function. The possible values 1143 * returned by this function are: 1144 * <ul> 1145 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1146 * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT} 1147 * <li> {@link libsbmlConstants#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH} 1148 * <li> {@link libsbmlConstants#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH} 1149 * <li> {@link libsbmlConstants#LIBSBML_PKG_VERSION_MISMATCH LIBSBML_PKG_VERSION_MISMATCH} 1150 * </ul> 1151 */ public 1152 int addDeletion(Deletion deletion) { 1153 return libsbmlJNI.Submodel_addDeletion(swigCPtr, this, Deletion.getCPtr(deletion), deletion); 1154 } 1155 1156 1157/** 1158 * Returns the number of deletions for this {@link Submodel}. 1159 <p> 1160 * @return the number of deletions for this {@link Submodel}. 1161 */ public 1162 long getNumDeletions() { 1163 return libsbmlJNI.Submodel_getNumDeletions(swigCPtr, this); 1164 } 1165 1166 1167/** 1168 * Creates a {@link Deletion} object, adds it to the end of the 1169 * deletion objects list and returns a pointer to the newly 1170 * created object. 1171 <p> 1172 * @return a newly created {@link Deletion} object. 1173 */ public 1174 Deletion createDeletion() { 1175 long cPtr = libsbmlJNI.Submodel_createDeletion(swigCPtr, this); 1176 return (cPtr == 0) ? null : new Deletion(cPtr, false); 1177 } 1178 1179 1180/** 1181 * Removes the deletion with the given index from the {@link Submodel}. 1182 * A pointer to the deletion that was removed is returned. 1183 * If no deletion has been removed, <code>null</code> is returned. 1184 <p> 1185 * @param index the index of the {@link Deletion} object to remove. 1186 <p> 1187 * @return the {@link Deletion} object removed. As mentioned above, 1188 * the caller owns the returned object. <code>null</code> is returned if 1189 * the given index is out of range. 1190 */ public 1191 Deletion removeDeletion(long index) { 1192 long cPtr = libsbmlJNI.Submodel_removeDeletion__SWIG_0(swigCPtr, this, index); 1193 return (cPtr == 0) ? null : new Deletion(cPtr, false); 1194 } 1195 1196 1197/** 1198 * Removes the deletion with the given identifier from the {@link Submodel}. 1199 * A pointer to the deletion that was removed is returned. 1200 * If no deletion has been removed, <code>null</code> is returned. 1201 <p> 1202 * @param sid string representing the identifier 1203 * of the {@link Deletion} object to remove. 1204 <p> 1205 * @return the {@link Deletion} object removed. As mentioned above, 1206 * the caller owns the returned object. <code>null</code> is returned if 1207 * the given <code>sid</code> is not found. 1208 */ public 1209 Deletion removeDeletion(String sid) { 1210 long cPtr = libsbmlJNI.Submodel_removeDeletion__SWIG_1(swigCPtr, this, sid); 1211 return (cPtr == 0) ? null : new Deletion(cPtr, false); 1212 } 1213 1214 1215/** 1216 * Returns <code>true</code> if the 'submodel' attribute is set, and if getNumReferents() is exactly 1. 1217 <p> 1218 * @return boolean: 'true' if the attributes are correctly set; 'false' if not. 1219 */ public 1220 boolean hasRequiredAttributes() { 1221 return libsbmlJNI.Submodel_hasRequiredAttributes(swigCPtr, this); 1222 } 1223 1224 1225/** 1226 * Returns the XML element name of 1227 * this SBML object. 1228 <p> 1229 * @return the name of this element, as a text string. 1230 */ public 1231 String getElementName() { 1232 return libsbmlJNI.Submodel_getElementName(swigCPtr, this); 1233 } 1234 1235 1236/** 1237 * Renames the conversion factor attributes on this element if <code>oldid</code> matches. 1238 */ public 1239 void renameSIdRefs(String oldid, String newid) { 1240 libsbmlJNI.Submodel_renameSIdRefs(swigCPtr, this, oldid, newid); 1241 } 1242 1243 1244/** 1245 * Returns the libSBML type code of this object instance. 1246 <p> 1247 * <p> 1248 * LibSBML attaches an identifying code to every kind of SBML object. These 1249 * are integer constants known as <em>SBML type codes</em>. The names of all 1250 * the codes begin with the characters <code>SBML_</code>. 1251 * In the Java language interface for libSBML, the 1252 * type codes are defined as static integer constants in the interface class 1253 * {@link libsbmlConstants}. Note that different Level 3 1254 * package plug-ins may use overlapping type codes; to identify the package 1255 * to which a given object belongs, call the <code>getPackageName()</code> 1256 * method on the object. 1257 <p> 1258 * @return the SBML type code for this object: 1259 * {@link libsbmlConstants#SBML_COMP_SUBMODEL SBML_COMP_SUBMODEL}. 1260 <p> 1261 * <p> 1262 * @warning <span class='warning'>The specific integer values of the possible 1263 * type codes may be reused by different libSBML plug-ins for SBML Level 3. 1264 * packages, To fully identify the correct code, <strong>it is necessary to 1265 * invoke both getTypeCode() and getPackageName()</strong>.</span> 1266 <p> 1267 * @see #getElementName() 1268 * @see #getPackageName() 1269 */ public 1270 int getTypeCode() { 1271 return libsbmlJNI.Submodel_getTypeCode(swigCPtr, this); 1272 } 1273 1274 public void connectToChild() { 1275 libsbmlJNI.Submodel_connectToChild(swigCPtr, this); 1276 } 1277 1278 1279/** * @internal */ public 1280 SBase createObject(XMLInputStream stream) { 1281 return libsbml.DowncastSBase(libsbmlJNI.Submodel_createObject(swigCPtr, this, XMLInputStream.getCPtr(stream), stream), false); 1282} 1283 1284 1285/** 1286 * Find and create a local copy of the {@link Model} object referenced by this 1287 * {@link Submodel}. Is recursive, in that if the instantiated {@link Model} contains any 1288 * {@link Submodel} objects, those Submodels will themselves be instantiated. If 1289 * an instantiated model previously existed, it is deleted and a new one is 1290 * created. For this reason, call this function only once, or 1291 * call {@link Submodel#getInstantiation()}. 1292 <p> 1293 * <p> 1294 * @return integer value indicating success/failure of the 1295 * function. The possible values 1296 * returned by this function are: 1297 * <ul> 1298 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1299 * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT} (which 1300 * indicates this {@link Submodel} itself is invalid, and no {@link Model} can be instantiated 1301 * from it) 1302 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 1303 * </ul> 1304 */ public 1305 int instantiate() { 1306 return libsbmlJNI.Submodel_instantiate(swigCPtr, this); 1307 } 1308 1309 1310/** 1311 * Delete elements in the instantiated submodel, based on any Deletions 1312 * from this {@link Submodel}'s listOfDeletions. 1313 <p> 1314 * <p> 1315 * @return integer value indicating success/failure of the 1316 * function. The possible values 1317 * returned by this function are: 1318 * <ul> 1319 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1320 * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT} (which 1321 * indicates this {@link Submodel} itself is invalid, and no {@link Model} can be instantiated 1322 * from it) 1323 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 1324 * </ul> 1325 */ public 1326 int performDeletions() { 1327 return libsbmlJNI.Submodel_performDeletions(swigCPtr, this); 1328 } 1329 1330 1331/** 1332 * Delete the element in question from the stored instantiated {@link Model}, and 1333 * replace all references to it with references to the replacement object. 1334 * {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT} 1335 * means that this {@link Submodel} itself or one of the passed-in objects are invalid. 1336 * {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 1337 * means that the routine failed for some othe reason. 1338 <p> 1339 * <p> 1340 * @return integer value indicating success/failure of the 1341 * function. The possible values 1342 * returned by this function are: 1343 * <ul> 1344 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1345 * <li> {@link libsbmlConstants#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT} 1346 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 1347 * </ul> 1348 */ public 1349 int replaceElement(SBase toReplace, SBase replacement) { 1350 return libsbmlJNI.Submodel_replaceElement(swigCPtr, this, SBase.getCPtr(toReplace), toReplace, SBase.getCPtr(replacement), replacement); 1351 } 1352 1353 1354/** 1355 * Get the instantiated {@link Model} this {@link Submodel} contains rules to create. 1356 * Calls instantiate() automatically if this operation has not yet been 1357 * performed, and/or if the operation failed the last time it was called. 1358 * Any modifictions that have been performed with performDeletions(), 1359 * replaceElement(), or convertTimeAndExtent() function calls will be included. 1360 <p> 1361 * @return the instantiated {@link Model} object: a clone of the original, modified 1362 * according to the performDeletions() and replaceElement() functions that 1363 * have been called. Returns null if any error is encountered. 1364 */ public 1365 Model getInstantiation() { 1366 long cPtr = libsbmlJNI.Submodel_getInstantiation__SWIG_0(swigCPtr, this); 1367 return (cPtr == 0) ? null : new Model(cPtr, false); 1368 } 1369 1370 1371/** 1372 * Delete the instantiated {@link Model}, if it exists. 1373 */ public 1374 void clearInstantiation() { 1375 libsbmlJNI.Submodel_clearInstantiation(swigCPtr, this); 1376 } 1377 1378 1379/** 1380 * Convert all references to time and extent in the instantiated 1381 * {@link Model}, according to the 1382 * timeConversionFactor and extentConversionFactor attributes. 1383 */ public 1384 int convertTimeAndExtent() { 1385 return libsbmlJNI.Submodel_convertTimeAndExtent(swigCPtr, this); 1386 } 1387 1388 1389/** * @internal */ public 1390 static void clearProcessingCallbacks() { 1391 libsbmlJNI.Submodel_clearProcessingCallbacks(); 1392 } 1393 1394 1395/** * @internal */ public 1396 static void addProcessingCallback(SWIGTYPE_p_f_p_Model_p_SBMLErrorLog_p_void__int cb, SWIGTYPE_p_void userdata) { 1397 libsbmlJNI.Submodel_addProcessingCallback__SWIG_0(SWIGTYPE_p_f_p_Model_p_SBMLErrorLog_p_void__int.getCPtr(cb), SWIGTYPE_p_void.getCPtr(userdata)); 1398 } 1399 1400 1401/** * @internal */ public 1402 static void addProcessingCallback(SWIGTYPE_p_f_p_Model_p_SBMLErrorLog_p_void__int cb) { 1403 libsbmlJNI.Submodel_addProcessingCallback__SWIG_1(SWIGTYPE_p_f_p_Model_p_SBMLErrorLog_p_void__int.getCPtr(cb)); 1404 } 1405 1406 1407/** * @internal */ public 1408 static int getNumProcessingCallbacks() { 1409 return libsbmlJNI.Submodel_getNumProcessingCallbacks(); 1410 } 1411 1412 1413/** * @internal */ public 1414 static void removeProcessingCallback(int index) { 1415 libsbmlJNI.Submodel_removeProcessingCallback__SWIG_0(index); 1416 } 1417 1418 1419/** * @internal */ public 1420 static void removeProcessingCallback(SWIGTYPE_p_f_p_Model_p_SBMLErrorLog_p_void__int cb) { 1421 libsbmlJNI.Submodel_removeProcessingCallback__SWIG_1(SWIGTYPE_p_f_p_Model_p_SBMLErrorLog_p_void__int.getCPtr(cb)); 1422 } 1423 1424 public SBaseList getListOfAllInstantiatedElements() { 1425 long cPtr = libsbmlJNI.Submodel_getListOfAllInstantiatedElements(swigCPtr, this); 1426 return (cPtr == 0) ? null : new SBaseList(cPtr, false); 1427 } 1428 1429}