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&nbsp;2 Version&nbsp;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 &lt;vCard:N rdf:parseType='Resource'&gt;
043   &lt;vCard:Family&gt;<span style='background-color: #bbb'>family name</span>&lt;/vCard:Family&gt;
044   &lt;vCard:Given&gt;<span style='background-color: #bbb'>given name</span>&lt;/vCard:Given&gt;
045 &lt;/vCard:N&gt;
046 ...
047 &lt;vCard:EMAIL&gt;<span style='background-color: #bbb'>email address</span>&lt;/vCard:EMAIL&gt;
048 ...
049 &lt;vCard:ORG rdf:parseType='Resource'&gt;
050   &lt;vCard:Orgname&gt;<span style='background-color: #bbb'>organization</span>&lt;/vCard:Orgname&gt;
051 &lt;/vCard:ORG&gt;
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   * Predicate returning <code>true</code> or <code>false</code> depending on whether this
253   * {@link ModelCreator}'s 'family name' part is set.
254   <p>
255   * @return <code>true</code> if the familyName of this {@link ModelCreator} is set, <code>false</code> otherwise.
256   */ public
257 boolean isSetFamilyName() {
258    return libsbmlJNI.ModelCreator_isSetFamilyName(swigCPtr, this);
259  }
260
261  
262/**
263   * Predicate returning <code>true</code> or <code>false</code> depending on whether this
264   * {@link ModelCreator}'s 'given name' part is set.
265   <p>
266   * @return <code>true</code> if the givenName of this {@link ModelCreator} is set, <code>false</code> otherwise.
267   */ public
268 boolean isSetGivenName() {
269    return libsbmlJNI.ModelCreator_isSetGivenName(swigCPtr, this);
270  }
271
272  
273/**
274   * Predicate returning <code>true</code> or <code>false</code> depending on whether this
275   * {@link ModelCreator}'s 'email' part is set.
276   <p>
277   * @return <code>true</code> if the email of this {@link ModelCreator} is set, <code>false</code> otherwise.
278   */ public
279 boolean isSetEmail() {
280    return libsbmlJNI.ModelCreator_isSetEmail(swigCPtr, this);
281  }
282
283  
284/**
285   * Predicate returning <code>true</code> or <code>false</code> depending on whether this
286   * {@link ModelCreator}'s 'organization' part is set.
287   <p>
288   * @return <code>true</code> if the organization of this {@link ModelCreator} is set, <code>false</code> otherwise.
289   */ public
290 boolean isSetOrganization() {
291    return libsbmlJNI.ModelCreator_isSetOrganization(swigCPtr, this);
292  }
293
294  
295/**
296   * (Alternate spelling) Predicate returning <code>true</code> or <code>false</code> depending
297   * on whether this {@link ModelCreator}'s 'organization' part is set.
298   <p>
299   * @note This function is an alias of isSetOrganization().
300   <p>
301   * @return <code>true</code> if the organization of this {@link ModelCreator} is set, <code>false</code> otherwise.
302   <p>
303   * @see #isSetOrganization()
304   */ public
305 boolean isSetOrganisation() {
306    return libsbmlJNI.ModelCreator_isSetOrganisation(swigCPtr, this);
307  }
308
309  
310/**
311   * Sets the 'family name' portion of this {@link ModelCreator} object.
312   <p>
313   * @param familyName a string representing the familyName of the {@link ModelCreator}. 
314   <p>
315   * <p>
316 * @return integer value indicating success/failure of the
317 * function.   The possible values
318 * returned by this function are:
319   * <ul>
320   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
321   * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
322   * </ul>
323   */ public
324 int setFamilyName(String familyName) {
325    return libsbmlJNI.ModelCreator_setFamilyName(swigCPtr, this, familyName);
326  }
327
328  
329/**
330   * Sets the 'given name' portion of this {@link ModelCreator} object.
331   <p>
332   * @param givenName a string representing the givenName of the {@link ModelCreator}. 
333   <p>
334   * <p>
335 * @return integer value indicating success/failure of the
336 * function.   The possible values
337 * returned by this function are:
338   * <ul>
339   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
340   * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
341   * </ul>
342   */ public
343 int setGivenName(String givenName) {
344    return libsbmlJNI.ModelCreator_setGivenName(swigCPtr, this, givenName);
345  }
346
347  
348/**
349   * Sets the 'email' portion of this {@link ModelCreator} object.
350   <p>
351   * @param email a string representing the email of the {@link ModelCreator}. 
352   <p>
353   * <p>
354 * @return integer value indicating success/failure of the
355 * function.   The possible values
356 * returned by this function are:
357   * <ul>
358   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
359   * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
360   * </ul>
361   */ public
362 int setEmail(String email) {
363    return libsbmlJNI.ModelCreator_setEmail(swigCPtr, this, email);
364  }
365
366  
367/**
368   * Sets the 'organization' portion of this {@link ModelCreator} object.
369   <p>
370   * @param organization a string representing the organization of the 
371   * {@link ModelCreator}. 
372   <p>
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   * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
380   * </ul>
381   */ public
382 int setOrganization(String organization) {
383    return libsbmlJNI.ModelCreator_setOrganization(swigCPtr, this, organization);
384  }
385
386  
387/**
388   * (Alternate spelling) Sets the 'organization' portion of this
389   * {@link ModelCreator} object.
390   <p>
391   * @param organization a string representing the organization of the
392   * {@link ModelCreator}.
393   <p>
394   * @note This function is an alias of setOrganization(String organization).
395   <p>
396   * <p>
397 * @return integer value indicating success/failure of the
398 * function.   The possible values
399 * returned by this function are:
400   * <ul>
401   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
402   * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
403   *
404   * </ul> <p>
405   * @see #setOrganization(String organization)
406   */ public
407 int setOrganisation(String organization) {
408    return libsbmlJNI.ModelCreator_setOrganisation(swigCPtr, this, organization);
409  }
410
411  
412/**
413   * Unsets the 'family name' portion of this {@link ModelCreator} object.
414   <p>
415   * <p>
416 * @return integer value indicating success/failure of the
417 * function.   The possible values
418 * returned by this function are:
419   * <ul>
420   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
421   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
422   * </ul>
423   */ public
424 int unsetFamilyName() {
425    return libsbmlJNI.ModelCreator_unsetFamilyName(swigCPtr, this);
426  }
427
428  
429/**
430   * Unsets the 'given name' portion of this {@link ModelCreator} object.
431   <p>
432   * <p>
433 * @return integer value indicating success/failure of the
434 * function.   The possible values
435 * returned by this function are:
436   * <ul>
437   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
438   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
439   * </ul>
440   */ public
441 int unsetGivenName() {
442    return libsbmlJNI.ModelCreator_unsetGivenName(swigCPtr, this);
443  }
444
445  
446/**
447   * Unsets the 'email' portion of this {@link ModelCreator} object.
448   <p>
449   * <p>
450 * @return integer value indicating success/failure of the
451 * function.   The possible values
452 * returned by this function are:
453   * <ul>
454   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
455   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
456   * </ul>
457   */ public
458 int unsetEmail() {
459    return libsbmlJNI.ModelCreator_unsetEmail(swigCPtr, this);
460  }
461
462  
463/**
464   * Unsets the 'organization' portion of this {@link ModelCreator} object.
465   <p>
466   * <p>
467 * @return integer value indicating success/failure of the
468 * function.   The possible values
469 * returned by this function are:
470   * <ul>
471   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
472   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
473   * </ul>
474   */ public
475 int unsetOrganization() {
476    return libsbmlJNI.ModelCreator_unsetOrganization(swigCPtr, this);
477  }
478
479  
480/**
481   * (Alternate spelling) Unsets the 'organization' portion of this {@link ModelCreator} object.
482   <p>
483   * @note This function is an alias of unsetOrganization().
484   <p>
485   * <p>
486 * @return integer value indicating success/failure of the
487 * function.   The possible values
488 * returned by this function are:
489   * <ul>
490   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
491   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
492   *
493   * </ul> <p>
494   * @see #unsetOrganization()
495   */ public
496 int unsetOrganisation() {
497    return libsbmlJNI.ModelCreator_unsetOrganisation(swigCPtr, this);
498  }
499
500  
501/**
502   * Predicate returning <code>true</code> if all the required elements for this
503   * {@link ModelCreator} object have been set.
504   <p>
505   * The only required elements for a {@link ModelCreator} object are the 'family
506   * name' and 'given name'.
507   <p>
508   * @return a boolean value indicating whether all the required
509   * elements for this object have been defined.
510   */ public
511 boolean hasRequiredAttributes() {
512    return libsbmlJNI.ModelCreator_hasRequiredAttributes(swigCPtr, this);
513  }
514
515  
516/** * @internal */ public
517 boolean hasBeenModified() {
518    return libsbmlJNI.ModelCreator_hasBeenModified(swigCPtr, this);
519  }
520
521  
522/** * @internal */ public
523 void resetModifiedFlags() {
524    libsbmlJNI.ModelCreator_resetModifiedFlags(swigCPtr, this);
525  }
526
527}