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