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 * MIRIAM-compliant data about a model's creator. 013 <p> 014 * <p style='color: #777; font-style: italic'> 015This class of objects is defined by libSBML only and has no direct 016equivalent in terms of SBML components. This class is not prescribed by 017the SBML specifications, although it is used to implement features 018defined in SBML. 019</p> 020 021 <p> 022 * The SBML specification beginning with Level 2 Version 2 023 * defines a standard approach to recording model history and model creator 024 * information in a form that complies with MIRIAM ('Minimum Information 025 * Requested in the Annotation of biochemical Models', <i>Nature 026 * Biotechnology</i>, vol. 23, no. 12, Dec. 2005). For the model creator, 027 * this form involves the use of parts of the <a target='_blank' 028 * href='http://en.wikipedia.org/wiki/VCard'>vCard</a> representation. 029 * LibSBML provides the {@link ModelCreator} class as a convenience high-level 030 * interface for working with model creator data. Objects of class 031 * {@link ModelCreator} can be used to store and carry around creator data within a 032 * program, and the various methods in this object class let callers 033 * manipulate the different parts of the model creator representation. 034 <p> 035 * <h2>The different parts of a model creator definition</h2> 036 <p> 037 * The {@link ModelCreator} class mirrors the structure of the MIRIAM model creator 038 * annotations in SBML. The following template illustrates these different 039 * fields when they are written in XML form: 040 <p> 041 <pre class='fragment'> 042 <vCard:N rdf:parseType='Resource'> 043 <vCard:Family><span style='background-color: #bbb'>family name</span></vCard:Family> 044 <vCard:Given><span style='background-color: #bbb'>given name</span></vCard:Given> 045 </vCard:N> 046 ... 047 <vCard:EMAIL><span style='background-color: #bbb'>email address</span></vCard:EMAIL> 048 ... 049 <vCard:ORG rdf:parseType='Resource'> 050 <vCard:Orgname><span style='background-color: #bbb'>organization</span></vCard:Orgname> 051 </vCard:ORG> 052 </pre> 053 <p> 054 * Each of the separate data values 055 * <span class='code' style='background-color: #bbb'>family name</span>, 056 * <span class='code' style='background-color: #bbb'>given name</span>, 057 * <span class='code' style='background-color: #bbb'>email address</span>, and 058 * <span class='code' style='background-color: #bbb'>organization</span> can 059 * be set and retrieved via corresponding methods in the {@link ModelCreator} 060 * class. These methods are documented in more detail below. 061 */ 062 063public class ModelCreator { 064 private long swigCPtr; 065 protected boolean swigCMemOwn; 066 067 protected ModelCreator(long cPtr, boolean cMemoryOwn) 068 { 069 swigCMemOwn = cMemoryOwn; 070 swigCPtr = cPtr; 071 } 072 073 protected static long getCPtr(ModelCreator obj) 074 { 075 return (obj == null) ? 0 : obj.swigCPtr; 076 } 077 078 protected static long getCPtrAndDisown (ModelCreator obj) 079 { 080 long ptr = 0; 081 082 if (obj != null) 083 { 084 ptr = obj.swigCPtr; 085 obj.swigCMemOwn = false; 086 } 087 088 return ptr; 089 } 090 091 protected void finalize() { 092 delete(); 093 } 094 095 public synchronized void delete() { 096 if (swigCPtr != 0) { 097 if (swigCMemOwn) { 098 swigCMemOwn = false; 099 libsbmlJNI.delete_ModelCreator(swigCPtr); 100 } 101 swigCPtr = 0; 102 } 103 } 104 105 /** 106 * Equality comparison method for ModelCreator. 107 * <p> 108 * Because the Java methods for libSBML are actually wrappers around code 109 * implemented in C++ and C, certain operations will not behave as 110 * expected. Equality comparison is one such case. An instance of a 111 * libSBML object class is actually a <em>proxy object</em> 112 * wrapping the real underlying C/C++ object. The normal <code>==</code> 113 * equality operator in Java will <em>only compare the Java proxy objects</em>, 114 * not the underlying native object. The result is almost never what you 115 * want in practical situations. Unfortunately, Java does not provide a 116 * way to override <code>==</code>. 117 * <p> 118 * The alternative that must be followed is to use the 119 * <code>equals()</code> method. The <code>equals</code> method on this 120 * class overrides the default java.lang.Object one, and performs an 121 * intelligent comparison of instances of objects of this class. The 122 * result is an assessment of whether two libSBML Java objects are truly 123 * the same underlying native-code objects. 124 * <p> 125 * The use of this method in practice is the same as the use of any other 126 * Java <code>equals</code> method. For example, 127 * <em>a</em><code>.equals(</code><em>b</em><code>)</code> returns 128 * <code>true</code> if <em>a</em> and <em>b</em> are references to the 129 * same underlying object. 130 * 131 * @param sb a reference to an object to which the current object 132 * instance will be compared 133 * 134 * @return <code>true</code> if <code>sb</code> refers to the same underlying 135 * native object as this one, <code>false</code> otherwise 136 */ 137 public boolean equals(Object sb) 138 { 139 if ( this == sb ) 140 { 141 return true; 142 } 143 return swigCPtr == getCPtr((ModelCreator)(sb)); 144 } 145 146 /** 147 * Returns a hashcode for this ModelCreator object. 148 * 149 * @return a hash code usable by Java methods that need them. 150 */ 151 public int hashCode() 152 { 153 return (int)(swigCPtr^(swigCPtr>>>32)); 154 } 155 156 157/** 158 * Creates a new {@link ModelCreator} object. 159 */ public 160 ModelCreator() { 161 this(libsbmlJNI.new_ModelCreator__SWIG_0(), true); 162 } 163 164 165/** 166 * Creates a new {@link ModelCreator} from an {@link XMLNode}. 167 <p> 168 * @param creator the {@link XMLNode} from which to create the {@link ModelCreator}. 169 */ public 170 ModelCreator(XMLNode creator) { 171 this(libsbmlJNI.new_ModelCreator__SWIG_1(XMLNode.getCPtr(creator), creator), true); 172 } 173 174 175/** 176 * Copy constructor; creates a copy of the {@link ModelCreator}. 177 <p> 178 * @param orig the object to copy. 179 */ public 180 ModelCreator(ModelCreator orig) { 181 this(libsbmlJNI.new_ModelCreator__SWIG_2(ModelCreator.getCPtr(orig), orig), true); 182 } 183 184 185/** 186 * Creates and returns a deep copy of this {@link ModelCreator} object. 187 <p> 188 * @return the (deep) copy of this {@link ModelCreator} object. 189 */ public 190 ModelCreator cloneObject() { 191 long cPtr = libsbmlJNI.ModelCreator_cloneObject(swigCPtr, this); 192 return (cPtr == 0) ? null : new ModelCreator(cPtr, true); 193 } 194 195 196/** 197 * Returns the 'family name' stored in this {@link ModelCreator} object. 198 <p> 199 * @return the 'family name' portion of the {@link ModelCreator} object. 200 */ public 201 String getFamilyName() { 202 return libsbmlJNI.ModelCreator_getFamilyName(swigCPtr, this); 203 } 204 205 206/** 207 * Returns the 'given name' stored in this {@link ModelCreator} object. 208 <p> 209 * @return the 'given name' portion of the {@link ModelCreator} object. 210 */ public 211 String getGivenName() { 212 return libsbmlJNI.ModelCreator_getGivenName(swigCPtr, this); 213 } 214 215 216/** 217 * Returns the 'email' stored in this {@link ModelCreator} object. 218 <p> 219 * @return email from the {@link ModelCreator}. 220 */ public 221 String getEmail() { 222 return libsbmlJNI.ModelCreator_getEmail(swigCPtr, this); 223 } 224 225 226/** 227 * Returns the 'organization' stored in this {@link ModelCreator} object. 228 <p> 229 * @return organization from the {@link ModelCreator}. 230 */ public 231 String getOrganization() { 232 return libsbmlJNI.ModelCreator_getOrganization(swigCPtr, this); 233 } 234 235 236/** 237 * (Alternate spelling) Returns the 'organization' stored in this 238 * {@link ModelCreator} object. 239 <p> 240 * @note This function is an alias of getOrganization(). 241 <p> 242 * @return organization from the {@link ModelCreator}. 243 <p> 244 * @see #getOrganization() 245 */ public 246 String getOrganisation() { 247 return libsbmlJNI.ModelCreator_getOrganisation(swigCPtr, this); 248 } 249 250 251/** 252 * Returns the 'fn' stored in this {@link ModelCreator} object when using vCard4. 253 <p> 254 * @return the 'fn' portion of the {@link ModelCreator} object. 255 */ public 256 String getName() { 257 return libsbmlJNI.ModelCreator_getName(swigCPtr, this); 258 } 259 260 261/** 262 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 263 * {@link ModelCreator}'s 'family name' part is set. 264 <p> 265 * @return <code>true</code> if the familyName of this {@link ModelCreator} is set, <code>false</code> otherwise. 266 */ public 267 boolean isSetFamilyName() { 268 return libsbmlJNI.ModelCreator_isSetFamilyName(swigCPtr, this); 269 } 270 271 272/** 273 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 274 * {@link ModelCreator}'s 'given name' part is set. 275 <p> 276 * @return <code>true</code> if the givenName of this {@link ModelCreator} is set, <code>false</code> otherwise. 277 */ public 278 boolean isSetGivenName() { 279 return libsbmlJNI.ModelCreator_isSetGivenName(swigCPtr, this); 280 } 281 282 283/** 284 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 285 * {@link ModelCreator}'s 'email' part is set. 286 <p> 287 * @return <code>true</code> if the email of this {@link ModelCreator} is set, <code>false</code> otherwise. 288 */ public 289 boolean isSetEmail() { 290 return libsbmlJNI.ModelCreator_isSetEmail(swigCPtr, this); 291 } 292 293 294/** 295 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 296 * {@link ModelCreator}'s 'organization' part is set. 297 <p> 298 * @return <code>true</code> if the organization of this {@link ModelCreator} is set, <code>false</code> otherwise. 299 */ public 300 boolean isSetOrganization() { 301 return libsbmlJNI.ModelCreator_isSetOrganization(swigCPtr, this); 302 } 303 304 305/** 306 * (Alternate spelling) Predicate returning <code>true</code> or <code>false</code> depending 307 * on whether this {@link ModelCreator}'s 'organization' part is set. 308 <p> 309 * @note This function is an alias of isSetOrganization(). 310 <p> 311 * @return <code>true</code> if the organization of this {@link ModelCreator} is set, <code>false</code> otherwise. 312 <p> 313 * @see #isSetOrganization() 314 */ public 315 boolean isSetOrganisation() { 316 return libsbmlJNI.ModelCreator_isSetOrganisation(swigCPtr, this); 317 } 318 319 320/** 321 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 322 * {@link ModelCreator}'s 'fn' part is set (when using vCard4). 323 <p> 324 * @return <code>true</code> if the fn of this {@link ModelCreator} is set, <code>false</code> otherwise. 325 */ public 326 boolean isSetName() { 327 return libsbmlJNI.ModelCreator_isSetName(swigCPtr, this); 328 } 329 330 331/** 332 * Sets the 'family name' portion of this {@link ModelCreator} object. 333 <p> 334 * @param familyName a string representing the familyName of the {@link ModelCreator}. 335 <p> 336 * <p> 337 * @return integer value indicating success/failure of the 338 * function. The possible values 339 * returned by this function are: 340 * <ul> 341 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 342 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 343 * </ul> 344 */ public 345 int setFamilyName(String familyName) { 346 return libsbmlJNI.ModelCreator_setFamilyName(swigCPtr, this, familyName); 347 } 348 349 350/** 351 * Sets the 'given name' portion of this {@link ModelCreator} object. 352 <p> 353 * @param givenName a string representing the givenName of the {@link ModelCreator}. 354 <p> 355 * <p> 356 * @return integer value indicating success/failure of the 357 * function. The possible values 358 * returned by this function are: 359 * <ul> 360 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 361 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 362 * </ul> 363 */ public 364 int setGivenName(String givenName) { 365 return libsbmlJNI.ModelCreator_setGivenName(swigCPtr, this, givenName); 366 } 367 368 369/** 370 * Sets the 'email' portion of this {@link ModelCreator} object. 371 <p> 372 * @param email a string representing the email of the {@link ModelCreator}. 373 <p> 374 * <p> 375 * @return integer value indicating success/failure of the 376 * function. The possible values 377 * returned by this function are: 378 * <ul> 379 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 380 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 381 * </ul> 382 */ public 383 int setEmail(String email) { 384 return libsbmlJNI.ModelCreator_setEmail(swigCPtr, this, email); 385 } 386 387 388/** 389 * Sets the 'organization' portion of this {@link ModelCreator} object. 390 <p> 391 * @param organization a string representing the organization of the 392 * {@link ModelCreator}. 393 <p> 394 * <p> 395 * @return integer value indicating success/failure of the 396 * function. The possible values 397 * returned by this function are: 398 * <ul> 399 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 400 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 401 * </ul> 402 */ public 403 int setOrganization(String organization) { 404 return libsbmlJNI.ModelCreator_setOrganization(swigCPtr, this, organization); 405 } 406 407 408/** 409 * (Alternate spelling) Sets the 'organization' portion of this 410 * {@link ModelCreator} object. 411 <p> 412 * @param organization a string representing the organization of the 413 * {@link ModelCreator}. 414 <p> 415 * @note This function is an alias of setOrganization(String organization). 416 <p> 417 * <p> 418 * @return integer value indicating success/failure of the 419 * function. The possible values 420 * returned by this function are: 421 * <ul> 422 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 423 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 424 * 425 * </ul> <p> 426 * @see #setOrganization(String organization) 427 */ public 428 int setOrganisation(String organization) { 429 return libsbmlJNI.ModelCreator_setOrganisation(swigCPtr, this, organization); 430 } 431 432 433/** 434 * Sets the 'fn' portion of this {@link ModelCreator} object (when using vCard4). 435 <p> 436 * @param name a string representing the fn of the {@link ModelCreator}. 437 <p> 438 * <p> 439 * @return integer value indicating success/failure of the 440 * function. The possible values 441 * returned by this function are: 442 * <ul> 443 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 444 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 445 * </ul> 446 */ public 447 int setName(String name) { 448 return libsbmlJNI.ModelCreator_setName(swigCPtr, this, name); 449 } 450 451 452/** 453 * Unsets the 'family name' portion of this {@link ModelCreator} object. 454 <p> 455 * <p> 456 * @return integer value indicating success/failure of the 457 * function. The possible values 458 * returned by this function are: 459 * <ul> 460 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 461 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 462 * </ul> 463 */ public 464 int unsetFamilyName() { 465 return libsbmlJNI.ModelCreator_unsetFamilyName(swigCPtr, this); 466 } 467 468 469/** 470 * Unsets the 'given name' portion of this {@link ModelCreator} object. 471 <p> 472 * <p> 473 * @return integer value indicating success/failure of the 474 * function. The possible values 475 * returned by this function are: 476 * <ul> 477 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 478 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 479 * </ul> 480 */ public 481 int unsetGivenName() { 482 return libsbmlJNI.ModelCreator_unsetGivenName(swigCPtr, this); 483 } 484 485 486/** 487 * Unsets the 'email' portion of this {@link ModelCreator} object. 488 <p> 489 * <p> 490 * @return integer value indicating success/failure of the 491 * function. The possible values 492 * returned by this function are: 493 * <ul> 494 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 495 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 496 * </ul> 497 */ public 498 int unsetEmail() { 499 return libsbmlJNI.ModelCreator_unsetEmail(swigCPtr, this); 500 } 501 502 503/** 504 * Unsets the 'organization' portion of this {@link ModelCreator} object. 505 <p> 506 * <p> 507 * @return integer value indicating success/failure of the 508 * function. The possible values 509 * returned by this function are: 510 * <ul> 511 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 512 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 513 * </ul> 514 */ public 515 int unsetOrganization() { 516 return libsbmlJNI.ModelCreator_unsetOrganization(swigCPtr, this); 517 } 518 519 520/** 521 * (Alternate spelling) Unsets the 'organization' portion of this {@link ModelCreator} object. 522 <p> 523 * @note This function is an alias of unsetOrganization(). 524 <p> 525 * <p> 526 * @return integer value indicating success/failure of the 527 * function. The possible values 528 * returned by this function are: 529 * <ul> 530 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 531 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 532 * 533 * </ul> <p> 534 * @see #unsetOrganization() 535 */ public 536 int unsetOrganisation() { 537 return libsbmlJNI.ModelCreator_unsetOrganisation(swigCPtr, this); 538 } 539 540 541/** 542 * Unsets the 'fn' portion of this {@link ModelCreator} object (when using vCard4). 543 <p> 544 * <p> 545 * @return integer value indicating success/failure of the 546 * function. The possible values 547 * returned by this function are: 548 * <ul> 549 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 550 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 551 * </ul> 552 */ public 553 int unsetName() { 554 return libsbmlJNI.ModelCreator_unsetName(swigCPtr, this); 555 } 556 557 558/** 559 * Predicate returning <code>true</code> if all the required elements for this 560 * {@link ModelCreator} object have been set. 561 <p> 562 * The only required elements for a {@link ModelCreator} object are the 'family 563 * name' and 'given name'. 564 <p> 565 * @return a boolean value indicating whether all the required 566 * elements for this object have been defined. 567 */ public 568 boolean hasRequiredAttributes() { 569 return libsbmlJNI.ModelCreator_hasRequiredAttributes(swigCPtr, this); 570 } 571 572 573/** * @internal */ public 574 boolean hasBeenModified() { 575 return libsbmlJNI.ModelCreator_hasBeenModified(swigCPtr, this); 576 } 577 578 579/** * @internal */ public 580 void resetModifiedFlags() { 581 libsbmlJNI.ModelCreator_resetModifiedFlags(swigCPtr, this); 582 } 583 584 585/** * @internal */ public 586 boolean usingFNVcard4() { 587 return libsbmlJNI.ModelCreator_usingFNVcard4(swigCPtr, this); 588 } 589 590 591/** * @internal */ public 592 boolean usingSingleName() { 593 return libsbmlJNI.ModelCreator_usingSingleName(swigCPtr, this); 594 } 595 596 597/** * @internal */ public 598 void setUseSingleName(boolean flag) { 599 libsbmlJNI.ModelCreator_setUseSingleName(swigCPtr, this, flag); 600 } 601 602}