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 * <span class="pkg-marker pkg-color-comp"><a href="group__comp.html">comp</a></span> 013 A reference to an externally-defined model. 014 <p> 015 * The {@link ExternalModelDefinition} class was introduced by the SBML Level 3 016 * <a href='../../../extensions-summary.html#comp'>Hierarchical Model Composition</a> (“comp”) package to define references to {@link Model} 017 * objects defined in other files. 018 <p> 019 * {@link ExternalModelDefinition} objects are model definitions—in and of 020 * themselves, they are definitions of models but not uses of those models. 021 * The class provides a way to declare and identify them so that {@link Model} 022 * objects in the present SBML document can use them in {@link Submodel} objects. 023 <p> 024 * {@link ExternalModelDefinition} contains two required attributes 025 * ('source' and 'id') and three optional attributes 026 * ('modelRef', 'md5' and 'name'). 027 <p> 028 * The 'id' attribute serves to provide a handle for the external 029 * model reference so that {@link Submodel} objects can refer to it. Crucially, 030 * it is not the identifier of the model being referenced; rather, 031 * it is an identifier for this {@link ExternalModelDefinition} object within the 032 * current SBML document. The 'id' attribute takes a required value 033 * of type SId, and must be unique across all {@link Model} and {@link ExternalModelDefinition} 034 * objects present in the document. 035 <p> 036 * {@link ExternalModelDefinition} also has an optional 'name' attribute, of 037 * type 'string'. The 'name' attribute may be used to provide 038 * a human-readable description of the ExternalModelDefintion object. 039 <p> 040 * The required attribute 'source' is used to locate the SBML document 041 * containing an external model definition. The value of this attribute must 042 * be of type anyURI. Since URIs may be either URLs, URNs, or relative or 043 * absolute file locations, this offers flexibility in referencing SBML 044 * documents. In all cases, the 'source' attribute value must refer 045 * specifically to an SBML Level 3 document; prior 046 * Levels/Versions of SBML are not supported by this package. The entire 047 * file at the given location is referenced. The 'source' attribute must 048 * have a value for every {@link ExternalModelDefinition} instance. 049 <p> 050 * It should be noted that even though there is currently only a 051 * Hierarchical Model Composition package for SBML Level 3 052 * Version 1, it may be used in SBML Level 3 Version 2, 053 * as long as nothing new from that package is used. This allows the 054 * {@link ExternalModelDefinition} to reference any SBML Level 3 document, 055 * so long as only constructs from Version 1 are used. 056 <p> 057 * {@link ExternalModelDefinition}'s optional attribute 'modelRef', of type 058 * SIdRef, is used to identify a {@link Model} or 059 * {@link ExternalModelDefinition} object within the SBML document located at 060 * 'source'. The object referenced may be the main model in the 061 * document, or it may be a model definition contained in the SBML 062 * document's {@link ListOfModelDefinitions} or 063 * {@link ListOfExternalModelDefinitions} lists. Loops are not allowed: it 064 * must be possible to follow a chain of {@link ExternalModelDefinition} objects 065 * to its end in a {@link Model} object. 066 <p> 067 * In core SBML, the 'id' on {@link Model} is an optional attribute, and therefore, 068 * it is possible that the {@link Model} object in a given SBML document does not 069 * have an identifier. In that case, there is no value to give to the 070 * 'modelRef' attribute in {@link ExternalModelDefinition}. If 'modelRef' does not 071 * have a value, then the main model (i.e., the <code><model></code> 072 * element within the <code><sbml></code> element) in the referenced 073 * file is interpreted as being the model referenced by this 074 * {@link ExternalModelDefinition} instance. 075 <p> 076 * Finally, the optional 'md5' attribute takes a string value. If 077 * set, it must be an MD5 checksum value computed over the document 078 * referenced by 'source'. This checksum can serve as a data 079 * integrity check over the contents of the 'source'. Applications 080 * may use this to verify that the contents have not changed since the time 081 * that the {@link ExternalModelDefinition} reference was constructed. 082 */ 083 084public class ExternalModelDefinition extends CompBase { 085 private long swigCPtr; 086 087 protected ExternalModelDefinition(long cPtr, boolean cMemoryOwn) 088 { 089 super(libsbmlJNI.ExternalModelDefinition_SWIGUpcast(cPtr), cMemoryOwn); 090 swigCPtr = cPtr; 091 } 092 093 protected static long getCPtr(ExternalModelDefinition obj) 094 { 095 return (obj == null) ? 0 : obj.swigCPtr; 096 } 097 098 protected static long getCPtrAndDisown (ExternalModelDefinition obj) 099 { 100 long ptr = 0; 101 102 if (obj != null) 103 { 104 ptr = obj.swigCPtr; 105 obj.swigCMemOwn = false; 106 } 107 108 return ptr; 109 } 110 111 protected void finalize() { 112 delete(); 113 } 114 115 public synchronized void delete() { 116 if (swigCPtr != 0) { 117 if (swigCMemOwn) { 118 swigCMemOwn = false; 119 libsbmlJNI.delete_ExternalModelDefinition(swigCPtr); 120 } 121 swigCPtr = 0; 122 } 123 super.delete(); 124 } 125 126 127/** 128 * Creates a new {@link ExternalModelDefinition} with the given level, version, and 129 * package version. 130 <p> 131 * @param level the SBML Level. 132 * @param version the Version within the SBML Level. 133 * @param pkgVersion the version of the package. 134 <p> 135 * <p> 136 * @note Attempting to add an object to an {@link SBMLDocument} having a different 137 * combination of SBML Level, Version and XML namespaces than the object 138 * itself will result in an error at the time a caller attempts to make the 139 * addition. A parent object must have compatible Level, Version and XML 140 * namespaces. (Strictly speaking, a parent may also have more XML 141 * namespaces than a child, but the reverse is not permitted.) The 142 * restriction is necessary to ensure that an SBML model has a consistent 143 * overall structure. This requires callers to manage their objects 144 * carefully, but the benefit is increased flexibility in how models can be 145 * created by permitting callers to create objects bottom-up if desired. In 146 * situations where objects are not yet attached to parents (e.g., 147 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 148 * libSBML determine such things as whether it is valid to assign a 149 * particular value to an attribute. For packages, this means that the 150 * parent object to which this package element is being added must have 151 * been created with the package namespace, or that the package namespace 152 * was added to it, even if that parent is not a package object itself. 153 */ public 154 ExternalModelDefinition(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 155 this(libsbmlJNI.new_ExternalModelDefinition__SWIG_0(level, version, pkgVersion), true); 156 } 157 158 159/** 160 * Creates a new {@link ExternalModelDefinition} with the given level, version, and 161 * package version. 162 <p> 163 * @param level the SBML Level. 164 * @param version the Version within the SBML Level. 165 * @param pkgVersion the version of the package. 166 <p> 167 * <p> 168 * @note Attempting to add an object to an {@link SBMLDocument} having a different 169 * combination of SBML Level, Version and XML namespaces than the object 170 * itself will result in an error at the time a caller attempts to make the 171 * addition. A parent object must have compatible Level, Version and XML 172 * namespaces. (Strictly speaking, a parent may also have more XML 173 * namespaces than a child, but the reverse is not permitted.) The 174 * restriction is necessary to ensure that an SBML model has a consistent 175 * overall structure. This requires callers to manage their objects 176 * carefully, but the benefit is increased flexibility in how models can be 177 * created by permitting callers to create objects bottom-up if desired. In 178 * situations where objects are not yet attached to parents (e.g., 179 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 180 * libSBML determine such things as whether it is valid to assign a 181 * particular value to an attribute. For packages, this means that the 182 * parent object to which this package element is being added must have 183 * been created with the package namespace, or that the package namespace 184 * was added to it, even if that parent is not a package object itself. 185 */ public 186 ExternalModelDefinition(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 187 this(libsbmlJNI.new_ExternalModelDefinition__SWIG_1(level, version), true); 188 } 189 190 191/** 192 * Creates a new {@link ExternalModelDefinition} with the given level, version, and 193 * package version. 194 <p> 195 * @param level the SBML Level. 196 * @param version the Version within the SBML Level. 197 * @param pkgVersion the version of the package. 198 <p> 199 * <p> 200 * @note Attempting to add an object to an {@link SBMLDocument} having a different 201 * combination of SBML Level, Version and XML namespaces than the object 202 * itself will result in an error at the time a caller attempts to make the 203 * addition. A parent object must have compatible Level, Version and XML 204 * namespaces. (Strictly speaking, a parent may also have more XML 205 * namespaces than a child, but the reverse is not permitted.) The 206 * restriction is necessary to ensure that an SBML model has a consistent 207 * overall structure. This requires callers to manage their objects 208 * carefully, but the benefit is increased flexibility in how models can be 209 * created by permitting callers to create objects bottom-up if desired. In 210 * situations where objects are not yet attached to parents (e.g., 211 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 212 * libSBML determine such things as whether it is valid to assign a 213 * particular value to an attribute. For packages, this means that the 214 * parent object to which this package element is being added must have 215 * been created with the package namespace, or that the package namespace 216 * was added to it, even if that parent is not a package object itself. 217 */ public 218 ExternalModelDefinition(long level) throws org.sbml.libsbml.SBMLConstructorException { 219 this(libsbmlJNI.new_ExternalModelDefinition__SWIG_2(level), true); 220 } 221 222 223/** 224 * Creates a new {@link ExternalModelDefinition} with the given level, version, and 225 * package version. 226 <p> 227 * @param level the SBML Level. 228 * @param version the Version within the SBML Level. 229 * @param pkgVersion the version of the package. 230 <p> 231 * <p> 232 * @note Attempting to add an object to an {@link SBMLDocument} having a different 233 * combination of SBML Level, Version and XML namespaces than the object 234 * itself will result in an error at the time a caller attempts to make the 235 * addition. A parent object must have compatible Level, Version and XML 236 * namespaces. (Strictly speaking, a parent may also have more XML 237 * namespaces than a child, but the reverse is not permitted.) The 238 * restriction is necessary to ensure that an SBML model has a consistent 239 * overall structure. This requires callers to manage their objects 240 * carefully, but the benefit is increased flexibility in how models can be 241 * created by permitting callers to create objects bottom-up if desired. In 242 * situations where objects are not yet attached to parents (e.g., 243 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 244 * libSBML determine such things as whether it is valid to assign a 245 * particular value to an attribute. For packages, this means that the 246 * parent object to which this package element is being added must have 247 * been created with the package namespace, or that the package namespace 248 * was added to it, even if that parent is not a package object itself. 249 */ public 250 ExternalModelDefinition() throws org.sbml.libsbml.SBMLConstructorException { 251 this(libsbmlJNI.new_ExternalModelDefinition__SWIG_3(), true); 252 } 253 254 255/** 256 * Creates a new {@link ExternalModelDefinition} with the given {@link CompPkgNamespaces} 257 * object. 258 <p> 259 * <p> 260 * The package namespaces object used in this constructor is derived from a 261 * {@link SBMLNamespaces} object, which encapsulates SBML Level/Version/namespaces 262 * information. It is used to communicate the SBML Level, Version, and 263 * package version and name information used in addition to SBML Level 3 Core. A 264 * common approach to using libSBML's {@link SBMLNamespaces} facilities is to create an 265 * package namespace object somewhere in a program once, then hand that object 266 * as needed to object constructors of that package that accept it as and 267 * argument, such as this one. 268 <p> 269 * @param compns the {@link CompPkgNamespaces} object. 270 <p> 271 * <p> 272 * @note Attempting to add an object to an {@link SBMLDocument} having a different 273 * combination of SBML Level, Version and XML namespaces than the object 274 * itself will result in an error at the time a caller attempts to make the 275 * addition. A parent object must have compatible Level, Version and XML 276 * namespaces. (Strictly speaking, a parent may also have more XML 277 * namespaces than a child, but the reverse is not permitted.) The 278 * restriction is necessary to ensure that an SBML model has a consistent 279 * overall structure. This requires callers to manage their objects 280 * carefully, but the benefit is increased flexibility in how models can be 281 * created by permitting callers to create objects bottom-up if desired. In 282 * situations where objects are not yet attached to parents (e.g., 283 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 284 * libSBML determine such things as whether it is valid to assign a 285 * particular value to an attribute. For packages, this means that the 286 * parent object to which this package element is being added must have 287 * been created with the package namespace, or that the package namespace 288 * was added to it, even if that parent is not a package object itself. 289 */ public 290 ExternalModelDefinition(CompPkgNamespaces compns) throws org.sbml.libsbml.SBMLConstructorException { 291 this(libsbmlJNI.new_ExternalModelDefinition__SWIG_4(CompPkgNamespaces.getCPtr(compns), compns), true); 292 } 293 294 295/** 296 * Copy constructor. 297 <p> 298 * @param source the object to copy. 299 */ public 300 ExternalModelDefinition(ExternalModelDefinition source) throws org.sbml.libsbml.SBMLConstructorException { 301 this(libsbmlJNI.new_ExternalModelDefinition__SWIG_5(ExternalModelDefinition.getCPtr(source), source), true); 302 } 303 304 305/** 306 * Creates and returns a deep copy of this {@link ExternalModelDefinition} object. 307 <p> 308 * @return a (deep) copy of this {@link ExternalModelDefinition} object. 309 */ public 310 SBase cloneObject() { 311 long cPtr = libsbmlJNI.ExternalModelDefinition_cloneObject(swigCPtr, this); 312 return (cPtr == 0) ? null : new ExternalModelDefinition(cPtr, true); 313 } 314 315 316/** 317 * Sets the value of the 'id' attribute of this {@link ExternalModelDefinition}. 318 <p> 319 * <p> 320 * The string <code>sid</code> is copied. 321 <p> 322 * <p> 323 * The identifier given by an object's 'id' attribute value 324 * is used to identify the object within the SBML model definition. 325 * Other objects can refer to the component using this identifier. The 326 * data type of 'id' is always <code>SId</code> or a type derived 327 * from that, such as <code>UnitSId</code>, depending on the object in 328 * question. All data types are defined as follows: 329 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'> 330 * letter .= 'a'..'z','A'..'Z' 331 * digit .= '0'..'9' 332 * idChar .= letter | digit | '_' 333 * SId .= ( letter | '_' ) idChar* 334 * </pre> 335 <p> 336 * The characters <code>(</code> and <code>)</code> are used for grouping, the 337 * character <code>*</code> 'zero or more times', and the character 338 * <code>|</code> indicates logical 'or'. The equality of SBML identifiers is 339 * determined by an exact character sequence match; i.e., comparisons must be 340 * performed in a case-sensitive manner. This applies to all uses of <code>SId</code>, 341 * <code>SIdRef</code>, and derived types. 342 <p> 343 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 344 * moved to {@link SBase} directly, instead of being defined individually for many 345 * (but not all) objects. Libsbml has for a long time provided functions 346 * defined on {@link SBase} itself to get, set, check, and unset those attributes, which 347 * would fail or otherwise return empty strings if executed on any object 348 * for which those attributes were not defined. Now that all {@link SBase} objects 349 * define those attributes, those functions now succeed for any object with 350 * the appropriate level and version. 351 <p> 352 * The exception to this rule is that for {@link InitialAssignment}, {@link EventAssignment}, 353 * {@link AssignmentRule}, and {@link RateRule} objects, the getId() function and the isSetId() 354 * functions (though not the setId() or unsetId() functions) would instead 355 * reference the value of the 'variable' attribute (for the rules and event 356 * assignments) or the 'symbol' attribute (for initial assignments). 357 * The {@link AlgebraicRule} fell into this category as well, though because it 358 * contained neither a 'variable' nor a 'symbol' attribute, getId() would 359 * always return an empty string, and isSetId() would always return <code>false.</code> 360 * For this reason, four new functions are now provided 361 * (getIdAttribute(), setIdAttribute(String), 362 * isSetIdAttribute(), and unsetIdAttribute()) that will always 363 * act on the actual 'id' attribute, regardless of the object's type. The 364 * new functions should be used instead of the old ones unless the old behavior 365 * is somehow necessary. 366 <p> 367 * Regardless of the level and version of the SBML, these functions allow 368 * client applications to use more generalized code in some situations 369 * (for instance, when manipulating objects that are all known to have 370 * identifiers). If the object in question does not posess an 'id' attribute 371 * according to the SBML specification for the Level and Version in use, 372 * libSBML will not allow the identifier to be set, nor will it read or 373 * write 'id' attributes for those objects. 374 <p> 375 * @param sid the string to use as the identifier of this object. 376 <p> 377 * <p> 378 * @return integer value indicating success/failure of the 379 * function. The possible values 380 * returned by this function are: 381 * <ul> 382 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 383 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 384 * <li> {@link libsbmlConstants#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE} 385 * 386 * </ul> <p> 387 * @see #getIdAttribute() 388 * @see #setIdAttribute(String sid) 389 * @see #isSetIdAttribute() 390 * @see #unsetIdAttribute() 391 */ public 392 int setId(String sid) { 393 return libsbmlJNI.ExternalModelDefinition_setId(swigCPtr, this, sid); 394 } 395 396 397/** 398 * Returns the value of the 'id' attribute of this {@link ExternalModelDefinition}. 399 <p> 400 * @note Because of the inconsistent behavior of this function with 401 * respect to assignments and rules, it is now recommended to 402 * use the getIdAttribute() function instead. 403 <p> 404 * <p> 405 * The identifier given by an object's 'id' attribute value 406 * is used to identify the object within the SBML model definition. 407 * Other objects can refer to the component using this identifier. The 408 * data type of 'id' is always <code>SId</code> or a type derived 409 * from that, such as <code>UnitSId</code>, depending on the object in 410 * question. All data types are defined as follows: 411 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'> 412 * letter .= 'a'..'z','A'..'Z' 413 * digit .= '0'..'9' 414 * idChar .= letter | digit | '_' 415 * SId .= ( letter | '_' ) idChar* 416 * </pre> 417 <p> 418 * The characters <code>(</code> and <code>)</code> are used for grouping, the 419 * character <code>*</code> 'zero or more times', and the character 420 * <code>|</code> indicates logical 'or'. The equality of SBML identifiers is 421 * determined by an exact character sequence match; i.e., comparisons must be 422 * performed in a case-sensitive manner. This applies to all uses of <code>SId</code>, 423 * <code>SIdRef</code>, and derived types. 424 <p> 425 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 426 * moved to {@link SBase} directly, instead of being defined individually for many 427 * (but not all) objects. Libsbml has for a long time provided functions 428 * defined on {@link SBase} itself to get, set, check, and unset those attributes, which 429 * would fail or otherwise return empty strings if executed on any object 430 * for which those attributes were not defined. Now that all {@link SBase} objects 431 * define those attributes, those functions now succeed for any object with 432 * the appropriate level and version. 433 <p> 434 * The exception to this rule is that for {@link InitialAssignment}, {@link EventAssignment}, 435 * {@link AssignmentRule}, and {@link RateRule} objects, the getId() function and the isSetId() 436 * functions (though not the setId() or unsetId() functions) would instead 437 * reference the value of the 'variable' attribute (for the rules and event 438 * assignments) or the 'symbol' attribute (for initial assignments). 439 * The {@link AlgebraicRule} fell into this category as well, though because it 440 * contained neither a 'variable' nor a 'symbol' attribute, getId() would 441 * always return an empty string, and isSetId() would always return <code>false.</code> 442 * For this reason, four new functions are now provided 443 * (getIdAttribute(), setIdAttribute(String), 444 * isSetIdAttribute(), and unsetIdAttribute()) that will always 445 * act on the actual 'id' attribute, regardless of the object's type. The 446 * new functions should be used instead of the old ones unless the old behavior 447 * is somehow necessary. 448 <p> 449 * Regardless of the level and version of the SBML, these functions allow 450 * client applications to use more generalized code in some situations 451 * (for instance, when manipulating objects that are all known to have 452 * identifiers). If the object in question does not posess an 'id' attribute 453 * according to the SBML specification for the Level and Version in use, 454 * libSBML will not allow the identifier to be set, nor will it read or 455 * write 'id' attributes for those objects. 456 <p> 457 * @return the id of this {@link ExternalModelDefinition}. 458 <p> 459 * @see #getIdAttribute() 460 * @see #setIdAttribute(String sid) 461 * @see #isSetIdAttribute() 462 * @see #unsetIdAttribute() 463 */ public 464 String getId() { 465 return libsbmlJNI.ExternalModelDefinition_getId(swigCPtr, this); 466 } 467 468 469/** 470 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 471 * object's 'id' attribute has been set. 472 <p> 473 * <p> 474 * @note Because of the inconsistent behavior of this function with 475 * respect to assignments and rules, it is now recommended to 476 * use the isSetIdAttribute() function instead. 477 <p> 478 * <p> 479 * The identifier given by an object's 'id' attribute value 480 * is used to identify the object within the SBML model definition. 481 * Other objects can refer to the component using this identifier. The 482 * data type of 'id' is always <code>SId</code> or a type derived 483 * from that, such as <code>UnitSId</code>, depending on the object in 484 * question. All data types are defined as follows: 485 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'> 486 * letter .= 'a'..'z','A'..'Z' 487 * digit .= '0'..'9' 488 * idChar .= letter | digit | '_' 489 * SId .= ( letter | '_' ) idChar* 490 * </pre> 491 <p> 492 * The characters <code>(</code> and <code>)</code> are used for grouping, the 493 * character <code>*</code> 'zero or more times', and the character 494 * <code>|</code> indicates logical 'or'. The equality of SBML identifiers is 495 * determined by an exact character sequence match; i.e., comparisons must be 496 * performed in a case-sensitive manner. This applies to all uses of <code>SId</code>, 497 * <code>SIdRef</code>, and derived types. 498 <p> 499 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 500 * moved to {@link SBase} directly, instead of being defined individually for many 501 * (but not all) objects. Libsbml has for a long time provided functions 502 * defined on {@link SBase} itself to get, set, check, and unset those attributes, which 503 * would fail or otherwise return empty strings if executed on any object 504 * for which those attributes were not defined. Now that all {@link SBase} objects 505 * define those attributes, those functions now succeed for any object with 506 * the appropriate level and version. 507 <p> 508 * The exception to this rule is that for {@link InitialAssignment}, {@link EventAssignment}, 509 * {@link AssignmentRule}, and {@link RateRule} objects, the getId() function and the isSetId() 510 * functions (though not the setId() or unsetId() functions) would instead 511 * reference the value of the 'variable' attribute (for the rules and event 512 * assignments) or the 'symbol' attribute (for initial assignments). 513 * The {@link AlgebraicRule} fell into this category as well, though because it 514 * contained neither a 'variable' nor a 'symbol' attribute, getId() would 515 * always return an empty string, and isSetId() would always return <code>false.</code> 516 * For this reason, four new functions are now provided 517 * (getIdAttribute(), setIdAttribute(String), 518 * isSetIdAttribute(), and unsetIdAttribute()) that will always 519 * act on the actual 'id' attribute, regardless of the object's type. The 520 * new functions should be used instead of the old ones unless the old behavior 521 * is somehow necessary. 522 <p> 523 * Regardless of the level and version of the SBML, these functions allow 524 * client applications to use more generalized code in some situations 525 * (for instance, when manipulating objects that are all known to have 526 * identifiers). If the object in question does not posess an 'id' attribute 527 * according to the SBML specification for the Level and Version in use, 528 * libSBML will not allow the identifier to be set, nor will it read or 529 * write 'id' attributes for those objects. 530 <p> 531 * @return <code>true</code> if the 'id' attribute of this SBML object is 532 * set, <code>false</code> otherwise. 533 <p> 534 * @see #getIdAttribute() 535 * @see #setIdAttribute(String sid) 536 * @see #unsetIdAttribute() 537 * @see #isSetIdAttribute() 538 */ public 539 boolean isSetId() { 540 return libsbmlJNI.ExternalModelDefinition_isSetId(swigCPtr, this); 541 } 542 543 544/** 545 * Unsets the value of the 'id' attribute of this {@link ExternalModelDefinition}. 546 <p> 547 * <p> 548 * <p> 549 * The identifier given by an object's 'id' attribute value 550 * is used to identify the object within the SBML model definition. 551 * Other objects can refer to the component using this identifier. The 552 * data type of 'id' is always <code>SId</code> or a type derived 553 * from that, such as <code>UnitSId</code>, depending on the object in 554 * question. All data types are defined as follows: 555 * <pre style='margin-left: 2em; border: none; font-weight: bold; color: black'> 556 * letter .= 'a'..'z','A'..'Z' 557 * digit .= '0'..'9' 558 * idChar .= letter | digit | '_' 559 * SId .= ( letter | '_' ) idChar* 560 * </pre> 561 <p> 562 * The characters <code>(</code> and <code>)</code> are used for grouping, the 563 * character <code>*</code> 'zero or more times', and the character 564 * <code>|</code> indicates logical 'or'. The equality of SBML identifiers is 565 * determined by an exact character sequence match; i.e., comparisons must be 566 * performed in a case-sensitive manner. This applies to all uses of <code>SId</code>, 567 * <code>SIdRef</code>, and derived types. 568 <p> 569 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 570 * moved to {@link SBase} directly, instead of being defined individually for many 571 * (but not all) objects. Libsbml has for a long time provided functions 572 * defined on {@link SBase} itself to get, set, check, and unset those attributes, which 573 * would fail or otherwise return empty strings if executed on any object 574 * for which those attributes were not defined. Now that all {@link SBase} objects 575 * define those attributes, those functions now succeed for any object with 576 * the appropriate level and version. 577 <p> 578 * The exception to this rule is that for {@link InitialAssignment}, {@link EventAssignment}, 579 * {@link AssignmentRule}, and {@link RateRule} objects, the getId() function and the isSetId() 580 * functions (though not the setId() or unsetId() functions) would instead 581 * reference the value of the 'variable' attribute (for the rules and event 582 * assignments) or the 'symbol' attribute (for initial assignments). 583 * The {@link AlgebraicRule} fell into this category as well, though because it 584 * contained neither a 'variable' nor a 'symbol' attribute, getId() would 585 * always return an empty string, and isSetId() would always return <code>false.</code> 586 * For this reason, four new functions are now provided 587 * (getIdAttribute(), setIdAttribute(String), 588 * isSetIdAttribute(), and unsetIdAttribute()) that will always 589 * act on the actual 'id' attribute, regardless of the object's type. The 590 * new functions should be used instead of the old ones unless the old behavior 591 * is somehow necessary. 592 <p> 593 * Regardless of the level and version of the SBML, these functions allow 594 * client applications to use more generalized code in some situations 595 * (for instance, when manipulating objects that are all known to have 596 * identifiers). If the object in question does not posess an 'id' attribute 597 * according to the SBML specification for the Level and Version in use, 598 * libSBML will not allow the identifier to be set, nor will it read or 599 * write 'id' attributes for those objects. 600 <p> 601 * <p> 602 * @return integer value indicating success/failure of the 603 * function. The possible values 604 * returned by this function are: 605 * <ul> 606 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 607 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 608 * 609 * </ul> <p> 610 * @see #getIdAttribute() 611 * @see #setIdAttribute(String sid) 612 * @see #isSetIdAttribute() 613 * @see #unsetIdAttribute() 614 */ public 615 int unsetId() { 616 return libsbmlJNI.ExternalModelDefinition_unsetId(swigCPtr, this); 617 } 618 619 620/** 621 * Sets the value of the 'name' attribute of this {@link ExternalModelDefinition}. 622 <p> 623 * <p> 624 * The string in <code>name</code> is copied. 625 <p> 626 * @param name the new name for the SBML object. 627 <p> 628 * <p> 629 * @return integer value indicating success/failure of the 630 * function. The possible values 631 * returned by this function are: 632 * <ul> 633 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 634 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 635 * 636 * </ul> 637 */ public 638 int setName(String name) { 639 return libsbmlJNI.ExternalModelDefinition_setName(swigCPtr, this, name); 640 } 641 642 643/** 644 * Returns the value of the 'name' attribute of this {@link ExternalModelDefinition} object. 645 <p> 646 * <p> 647 * <p> 648 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 649 * moved to {@link SBase} directly, instead of being defined individually for many 650 * (but not all) objects. Libsbml has for a long time provided functions 651 * defined on {@link SBase} itself to get, set, and unset those attributes, which 652 * would fail or otherwise return empty strings if executed on any object 653 * for which those attributes were not defined. Now that all {@link SBase} objects 654 * define those attributes, those functions now succeed for any object with 655 * the appropriate level and version. 656 <p> 657 * The 'name' attribute is 658 * optional and is not intended to be used for cross-referencing purposes 659 * within a model. Its purpose instead is to provide a human-readable 660 * label for the component. The data type of 'name' is the type 661 * <code>string</code> defined in XML Schema. SBML imposes no 662 * restrictions as to the content of 'name' attributes beyond those 663 * restrictions defined by the <code>string</code> type in XML Schema. 664 <p> 665 * The recommended practice for handling 'name' is as follows. If a 666 * software tool has the capability for displaying the content of 'name' 667 * attributes, it should display this content to the user as a 668 * component's label instead of the component's 'id'. If the user 669 * interface does not have this capability (e.g., because it cannot 670 * display or use special characters in symbol names), or if the 'name' 671 * attribute is missing on a given component, then the user interface 672 * should display the value of the 'id' attribute instead. (Script 673 * language interpreters are especially likely to display 'id' instead of 674 * 'name'.) 675 <p> 676 * As a consequence of the above, authors of systems that automatically 677 * generate the values of 'id' attributes should be aware some systems 678 * may display the 'id''s to the user. Authors therefore may wish to 679 * take some care to have their software create 'id' values that are: (a) 680 * reasonably easy for humans to type and read; and (b) likely to be 681 * meaningful, for example by making the 'id' attribute be an abbreviated 682 * form of the name attribute value. 683 <p> 684 * An additional point worth mentioning is although there are 685 * restrictions on the uniqueness of 'id' values, there are no 686 * restrictions on the uniqueness of 'name' values in a model. This 687 * allows software applications leeway in assigning component identifiers. 688 <p> 689 * Regardless of the level and version of the SBML, these functions allow 690 * client applications to use more generalized code in some situations 691 * (for instance, when manipulating objects that are all known to have 692 * names). If the object in question does not posess a 'name' attribute 693 * according to the SBML specification for the Level and Version in use, 694 * libSBML will not allow the name to be set, nor will it read or 695 * write 'name' attributes for those objects. 696 <p> 697 * @return the name of this SBML object, or the empty string if not set or unsettable. 698 <p> 699 * @see #getIdAttribute() 700 * @see #isSetName() 701 * @see #setName(String sid) 702 * @see #unsetName() 703 */ public 704 String getName() { 705 return libsbmlJNI.ExternalModelDefinition_getName(swigCPtr, this); 706 } 707 708 709/** 710 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 711 * object's 'name' attribute has been set. 712 <p> 713 * <p> 714 * <p> 715 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 716 * moved to {@link SBase} directly, instead of being defined individually for many 717 * (but not all) objects. Libsbml has for a long time provided functions 718 * defined on {@link SBase} itself to get, set, and unset those attributes, which 719 * would fail or otherwise return empty strings if executed on any object 720 * for which those attributes were not defined. Now that all {@link SBase} objects 721 * define those attributes, those functions now succeed for any object with 722 * the appropriate level and version. 723 <p> 724 * The 'name' attribute is 725 * optional and is not intended to be used for cross-referencing purposes 726 * within a model. Its purpose instead is to provide a human-readable 727 * label for the component. The data type of 'name' is the type 728 * <code>string</code> defined in XML Schema. SBML imposes no 729 * restrictions as to the content of 'name' attributes beyond those 730 * restrictions defined by the <code>string</code> type in XML Schema. 731 <p> 732 * The recommended practice for handling 'name' is as follows. If a 733 * software tool has the capability for displaying the content of 'name' 734 * attributes, it should display this content to the user as a 735 * component's label instead of the component's 'id'. If the user 736 * interface does not have this capability (e.g., because it cannot 737 * display or use special characters in symbol names), or if the 'name' 738 * attribute is missing on a given component, then the user interface 739 * should display the value of the 'id' attribute instead. (Script 740 * language interpreters are especially likely to display 'id' instead of 741 * 'name'.) 742 <p> 743 * As a consequence of the above, authors of systems that automatically 744 * generate the values of 'id' attributes should be aware some systems 745 * may display the 'id''s to the user. Authors therefore may wish to 746 * take some care to have their software create 'id' values that are: (a) 747 * reasonably easy for humans to type and read; and (b) likely to be 748 * meaningful, for example by making the 'id' attribute be an abbreviated 749 * form of the name attribute value. 750 <p> 751 * An additional point worth mentioning is although there are 752 * restrictions on the uniqueness of 'id' values, there are no 753 * restrictions on the uniqueness of 'name' values in a model. This 754 * allows software applications leeway in assigning component identifiers. 755 <p> 756 * Regardless of the level and version of the SBML, these functions allow 757 * client applications to use more generalized code in some situations 758 * (for instance, when manipulating objects that are all known to have 759 * names). If the object in question does not posess a 'name' attribute 760 * according to the SBML specification for the Level and Version in use, 761 * libSBML will not allow the name to be set, nor will it read or 762 * write 'name' attributes for those objects. 763 <p> 764 * @return <code>true</code> if the 'name' attribute of this SBML object is 765 * set, <code>false</code> otherwise. 766 <p> 767 * @see #getName() 768 * @see #setName(String sid) 769 * @see #unsetName() 770 */ public 771 boolean isSetName() { 772 return libsbmlJNI.ExternalModelDefinition_isSetName(swigCPtr, this); 773 } 774 775 776/** 777 * Unsets the value of the 'name' attribute of this 778 * {@link ExternalModelDefinition}. 779 <p> 780 * <p> 781 * <p> 782 * In SBML Level 3 Version 2, the 'id' and 'name' attributes were 783 * moved to {@link SBase} directly, instead of being defined individually for many 784 * (but not all) objects. Libsbml has for a long time provided functions 785 * defined on {@link SBase} itself to get, set, and unset those attributes, which 786 * would fail or otherwise return empty strings if executed on any object 787 * for which those attributes were not defined. Now that all {@link SBase} objects 788 * define those attributes, those functions now succeed for any object with 789 * the appropriate level and version. 790 <p> 791 * The 'name' attribute is 792 * optional and is not intended to be used for cross-referencing purposes 793 * within a model. Its purpose instead is to provide a human-readable 794 * label for the component. The data type of 'name' is the type 795 * <code>string</code> defined in XML Schema. SBML imposes no 796 * restrictions as to the content of 'name' attributes beyond those 797 * restrictions defined by the <code>string</code> type in XML Schema. 798 <p> 799 * The recommended practice for handling 'name' is as follows. If a 800 * software tool has the capability for displaying the content of 'name' 801 * attributes, it should display this content to the user as a 802 * component's label instead of the component's 'id'. If the user 803 * interface does not have this capability (e.g., because it cannot 804 * display or use special characters in symbol names), or if the 'name' 805 * attribute is missing on a given component, then the user interface 806 * should display the value of the 'id' attribute instead. (Script 807 * language interpreters are especially likely to display 'id' instead of 808 * 'name'.) 809 <p> 810 * As a consequence of the above, authors of systems that automatically 811 * generate the values of 'id' attributes should be aware some systems 812 * may display the 'id''s to the user. Authors therefore may wish to 813 * take some care to have their software create 'id' values that are: (a) 814 * reasonably easy for humans to type and read; and (b) likely to be 815 * meaningful, for example by making the 'id' attribute be an abbreviated 816 * form of the name attribute value. 817 <p> 818 * An additional point worth mentioning is although there are 819 * restrictions on the uniqueness of 'id' values, there are no 820 * restrictions on the uniqueness of 'name' values in a model. This 821 * allows software applications leeway in assigning component identifiers. 822 <p> 823 * Regardless of the level and version of the SBML, these functions allow 824 * client applications to use more generalized code in some situations 825 * (for instance, when manipulating objects that are all known to have 826 * names). If the object in question does not posess a 'name' attribute 827 * according to the SBML specification for the Level and Version in use, 828 * libSBML will not allow the name to be set, nor will it read or 829 * write 'name' attributes for those objects. 830 <p> 831 * <p> 832 * @return integer value indicating success/failure of the 833 * function. The possible values 834 * returned by this function are: 835 * <ul> 836 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 837 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 838 * 839 * </ul> <p> 840 * @see #getName() 841 * @see #setName(String sid) 842 * @see #isSetName() 843 */ public 844 int unsetName() { 845 return libsbmlJNI.ExternalModelDefinition_unsetName(swigCPtr, this); 846 } 847 848 849/** 850 * Returns the value of the 'modelRef' attribute of this 851 * {@link ExternalModelDefinition}. 852 <p> 853 * @return the value of the 'modelRef' attribute of this 854 * {@link ExternalModelDefinition}. 855 */ public 856 String getModelRef() { 857 return libsbmlJNI.ExternalModelDefinition_getModelRef(swigCPtr, this); 858 } 859 860 861/** 862 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 863 * {@link ExternalModelDefinition}'s 'modelRef' attribute has been set. 864 <p> 865 * @return <code>true</code> if this {@link ExternalModelDefinition}'s 'modelRef' attribute 866 * has been set, otherwise <code>false</code> is returned. 867 */ public 868 boolean isSetModelRef() { 869 return libsbmlJNI.ExternalModelDefinition_isSetModelRef(swigCPtr, this); 870 } 871 872 873/** 874 * Sets the value of the 'modelRef' attribute of this 875 * {@link ExternalModelDefinition}. Fails if the <code>id</code> is not a valid syntax for an 876 * SIdRef. 877 <p> 878 * <p> 879 * @return integer value indicating success/failure of the 880 * function. The possible values 881 * returned by this function are: 882 * <ul> 883 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 884 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 885 * </ul> 886 */ public 887 int setModelRef(String id) { 888 return libsbmlJNI.ExternalModelDefinition_setModelRef(swigCPtr, this, id); 889 } 890 891 892/** 893 * Unsets the value of the 'modelRef' attribute of this 894 * {@link ExternalModelDefinition}. 895 <p> 896 * <p> 897 * @return integer value indicating success/failure of the 898 * function. The possible values 899 * returned by this function are: 900 * <ul> 901 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 902 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 903 * </ul> 904 */ public 905 int unsetModelRef() { 906 return libsbmlJNI.ExternalModelDefinition_unsetModelRef(swigCPtr, this); 907 } 908 909 910/** 911 * Returns the value of the 'md5' attribute of this 912 * {@link ExternalModelDefinition}. 913 <p> 914 * @return the value of the 'md5' attribute of this 915 * {@link ExternalModelDefinition}. 916 */ public 917 String getMd5() { 918 return libsbmlJNI.ExternalModelDefinition_getMd5(swigCPtr, this); 919 } 920 921 922/** 923 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 924 * {@link ExternalModelDefinition}'s 'md5' attribute has been set. 925 <p> 926 * @return <code>true</code> if this {@link ExternalModelDefinition}'s 'md5' attribute has 927 * been set, otherwise <code>false</code> is returned. 928 */ public 929 boolean isSetMd5() { 930 return libsbmlJNI.ExternalModelDefinition_isSetMd5(swigCPtr, this); 931 } 932 933 934/** 935 * Sets the value of the 'md5' attribute of this {@link ExternalModelDefinition}. 936 <p> 937 * <p> 938 * @return integer value indicating success/failure of the 939 * function. The possible values 940 * returned by this function are: 941 * <ul> 942 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 943 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 944 * </ul> 945 */ public 946 int setMd5(String md5) { 947 return libsbmlJNI.ExternalModelDefinition_setMd5(swigCPtr, this, md5); 948 } 949 950 951/** 952 * Unsets the value of the 'md5' attribute of this {@link ExternalModelDefinition}. 953 <p> 954 * <p> 955 * @return integer value indicating success/failure of the 956 * function. The possible values 957 * returned by this function are: 958 * <ul> 959 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 960 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 961 * </ul> 962 */ public 963 int unsetMd5() { 964 return libsbmlJNI.ExternalModelDefinition_unsetMd5(swigCPtr, this); 965 } 966 967 968/** 969 * Returns the value of the 'source' attribute of this 970 * {@link ExternalModelDefinition}. 971 <p> 972 * @return the value of the 'source' attribute of this 973 * {@link ExternalModelDefinition}. 974 */ public 975 String getSource() { 976 return libsbmlJNI.ExternalModelDefinition_getSource(swigCPtr, this); 977 } 978 979 980/** 981 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 982 * {@link ExternalModelDefinition}'s 'source' attribute has been set. 983 <p> 984 * @return <code>true</code> if this {@link ExternalModelDefinition}'s 'source' attribute has 985 * been set, otherwise <code>false</code> is returned. 986 */ public 987 boolean isSetSource() { 988 return libsbmlJNI.ExternalModelDefinition_isSetSource(swigCPtr, this); 989 } 990 991 992/** 993 * Sets the value of the 'source' attribute of this 994 * {@link ExternalModelDefinition}. 995 <p> 996 * @param source the value to use for the 'source' attribute. 997 <p> 998 * <p> 999 * @return integer value indicating success/failure of the 1000 * function. The possible values 1001 * returned by this function are: 1002 * <ul> 1003 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1004 * </ul> 1005 */ public 1006 int setSource(String source) { 1007 return libsbmlJNI.ExternalModelDefinition_setSource(swigCPtr, this, source); 1008 } 1009 1010 1011/** 1012 * Unsets the value of the 'source' attribute of this 1013 * {@link ExternalModelDefinition}. 1014 <p> 1015 * <p> 1016 * @return integer value indicating success/failure of the 1017 * function. The possible values 1018 * returned by this function are: 1019 * <ul> 1020 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1021 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 1022 * </ul> 1023 */ public 1024 int unsetSource() { 1025 return libsbmlJNI.ExternalModelDefinition_unsetSource(swigCPtr, this); 1026 } 1027 1028 1029/** 1030 * Returns <code>true</code> if the 'modelRef' and 'id' attributes are set, and <code>false</code> if not. 1031 <p> 1032 * This method does not check to see if the referred-to model actually 1033 * exists. 1034 <p> 1035 * @return boolean: <code>true</code> if the attributes are correctly set; <code>false</code> 1036 * if not. 1037 */ public 1038 boolean hasRequiredAttributes() { 1039 return libsbmlJNI.ExternalModelDefinition_hasRequiredAttributes(swigCPtr, this); 1040 } 1041 1042 1043/** 1044 * Returns the XML element name of this SBML object. 1045 <p> 1046 * @return the name of this element, as a text string. 1047 */ public 1048 String getElementName() { 1049 return libsbmlJNI.ExternalModelDefinition_getElementName(swigCPtr, this); 1050 } 1051 1052 1053/** 1054 * Returns the libSBML type code of this object instance. 1055 <p> 1056 * <p> 1057 * LibSBML attaches an identifying code to every kind of SBML object. These 1058 * are integer constants known as <em>SBML type codes</em>. The names of all 1059 * the codes begin with the characters <code>SBML_</code>. 1060 * In the Java language interface for libSBML, the 1061 * type codes are defined as static integer constants in the interface class 1062 * {@link libsbmlConstants}. Note that different Level 3 1063 * package plug-ins may use overlapping type codes; to identify the package 1064 * to which a given object belongs, call the 1065 * <code>{@link SBase#getPackageName()} 1066 * </code> 1067 * method on the object. 1068 <p> 1069 * @return the SBML type code for this object: 1070 * {@link libsbmlConstants#SBML_COMP_EXTERNALMODELDEFINITION SBML_COMP_EXTERNALMODELDEFINITION}. 1071 <p> 1072 * <p> 1073 * @warning <span class='warning'>The specific integer values of the possible 1074 * type codes may be reused by different libSBML plug-ins for SBML Level 3. 1075 * packages, To fully identify the correct code, <strong>it is necessary to 1076 * invoke both getTypeCode() and getPackageName()</strong>.</span> 1077 <p> 1078 * @see #getElementName() 1079 * @see #getPackageName() 1080 */ public 1081 int getTypeCode() { 1082 return libsbmlJNI.ExternalModelDefinition_getTypeCode(swigCPtr, this); 1083 } 1084 1085 1086/** 1087 * Resolves and returns the referenced {@link Model} object of this {@link ExternalModelDefinition}. 1088 * If none can be found, an error is set and null is returned. The 1089 * returned {@link Model} is a non-owning pointer to the model; the original 1090 * {@link Model} is saved (along with the {@link SBMLDocument} from which it comes) as 1091 * a child of the {@link CompSBMLDocumentPlugin} of the {@link SBMLDocument} to which this 1092 * {@link Model} belongs. If this {@link ExternalModelDefinition} is not part of any 1093 * {@link SBMLDocument}, null will be returned. 1094 */ public 1095 Model getReferencedModel() { 1096 long cPtr = libsbmlJNI.ExternalModelDefinition_getReferencedModel(swigCPtr, this); 1097 return (cPtr == 0) ? null : new Model(cPtr, false); 1098 } 1099 1100}