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