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 * Implementation of SBML's ModifierSpeciesReference construct.
014 * <p>
015 * Sometimes a species appears in the kinetic rate formula of a reaction
016 * but is itself neither created nor destroyed in that reaction (for
017 * example, because it acts as a catalyst or inhibitor).  In SBML, all such
018 * species are simply called <em>modifiers</em> without regard to the detailed
019 * role of those species in the model.  The {@link Reaction} structure provides a
020 * way to express which species act as modifiers in a given reaction.  This
021 * is the purpose of the list of modifiers available in {@link Reaction}.  The list
022 * contains instances of {@link ModifierSpeciesReference} structures.
023 * <p>
024 * The {@link ModifierSpeciesReference} structure inherits the mandatory attribute
025 * 'species' and optional attributes 'id' and 'name' from the parent class
026 * {@link SimpleSpeciesReference}.  See the description of {@link SimpleSpeciesReference}
027 * for more information about these.
028 * <p>
029 * The value of the 'species' attribute must be the identifier of a species
030 * defined in the enclosing {@link Model}; this species is designated as a modifier
031 * for the current reaction.  A reaction may have any number of modifiers.
032 * It is permissible for a modifier species to appear simultaneously in the
033 * list of reactants and products of the same reaction where it is
034 * designated as a modifier, as well as to appear in the list of reactants,
035 * products and modifiers of other reactions in the model.
036 * <p>
037 * <p>
038 */
039
040public class ModifierSpeciesReference extends SimpleSpeciesReference {
041   private long swigCPtr;
042
043   protected ModifierSpeciesReference(long cPtr, boolean cMemoryOwn)
044   {
045     super(libsbmlJNI.ModifierSpeciesReference_SWIGUpcast(cPtr), cMemoryOwn);
046     swigCPtr = cPtr;
047   }
048
049   protected static long getCPtr(ModifierSpeciesReference obj)
050   {
051     return (obj == null) ? 0 : obj.swigCPtr;
052   }
053
054   protected static long getCPtrAndDisown (ModifierSpeciesReference obj)
055   {
056     long ptr = 0;
057
058     if (obj != null)
059     {
060       ptr             = obj.swigCPtr;
061       obj.swigCMemOwn = false;
062     }
063
064     return ptr;
065   }
066
067  protected void finalize() {
068    delete();
069  }
070
071  public synchronized void delete() {
072    if (swigCPtr != 0) {
073      if (swigCMemOwn) {
074        swigCMemOwn = false;
075        libsbmlJNI.delete_ModifierSpeciesReference(swigCPtr);
076      }
077      swigCPtr = 0;
078    }
079    super.delete();
080  }
081
082  
083/**
084   * Creates a new {@link ModifierSpeciesReference} using the given SBML <code>level</code> and <code>version</code>
085   * values.
086   * <p>
087   * @param level a long integer, the SBML Level to assign to this {@link ModifierSpeciesReference}
088   * <p>
089   * @param version a long integer, the SBML Version to assign to this
090   * {@link ModifierSpeciesReference}
091   * <p>
092   * @note Upon the addition of a {@link ModifierSpeciesReference} object to an
093   * {@link SBMLDocument} (e.g., using {@link Reaction#addModifier(ModifierSpeciesReference msr)}), the
094   * SBML Level, SBML Version and XML namespace of the document 
095   * <em>override</em> the values used when creating the {@link ModifierSpeciesReference}
096   * object via this constructor.  This is necessary to ensure that an SBML
097   * document is a consistent structure.  Nevertheless, the ability to
098   * supply the values at the time of creation of a
099   * {@link ModifierSpeciesReference} is an important aid to producing valid SBML.
100   * Knowledge of the intented SBML Level and Version determine whether it
101   * is valid to assign a particular value to an attribute, or whether it
102   * is valid to add an object to an existing {@link SBMLDocument}.
103   */ public
104 ModifierSpeciesReference(long level, long version) throws org.sbml.libsbml.SBMLConstructorException {
105    this(libsbmlJNI.new_ModifierSpeciesReference__SWIG_0(level, version), true);
106  }
107
108  
109/**
110   * Creates a new {@link ModifierSpeciesReference} using the given {@link SBMLNamespaces} object
111   * <code>sbmlns</code>.
112   * <p>
113   * @param sbmlns an {@link SBMLNamespaces} object.
114   * <p>
115   * @note Upon the addition of a {@link ModifierSpeciesReference} object to an
116   * {@link SBMLDocument} (e.g., using {@link Reaction#addModifier(ModifierSpeciesReference msr)}), the
117   * SBML XML namespace of the document <em>overrides</em> the value used when
118   * creating the {@link ModifierSpeciesReference} object via this constructor.
119   * This is necessary to ensure that an SBML document is a consistent
120   * structure.  Nevertheless, the ability to supply the values at the time
121   * of creation of a {@link ModifierSpeciesReference} is an important aid to
122   * producing valid SBML.  Knowledge of the intented SBML Level and
123   * Version determine whether it is valid to assign a particular value to
124   * an attribute, or whether it is valid to add an object to an existing
125   * {@link SBMLDocument}.
126   */ public
127 ModifierSpeciesReference(SBMLNamespaces sbmlns) throws org.sbml.libsbml.SBMLConstructorException {
128    this(libsbmlJNI.new_ModifierSpeciesReference__SWIG_1(SBMLNamespaces.getCPtr(sbmlns), sbmlns), true);
129  }
130
131  
132/**
133   * Creates and returns a deep copy of this {@link ModifierSpeciesReference}
134   * instance.
135   * <p>
136   * @return a (deep) copy of this {@link ModifierSpeciesReference}.
137   */ public
138 SBase cloneObject() {
139    long cPtr = libsbmlJNI.ModifierSpeciesReference_cloneObject(swigCPtr, this);
140    return (cPtr == 0) ? null : new ModifierSpeciesReference(cPtr, true);
141  }
142
143  
144/**
145   * Returns the libSBML type code for this SBML object.
146   * <p>
147   * LibSBML attaches an identifying code to every
148   * kind of SBML object.  These are known as <em>SBML type codes</em>.  In
149   * other languages, the set of type codes is stored in an enumeration; in
150   * the Java language interface for libSBML, the type codes are defined as
151   * static integer constants in the interface class {@link
152   * libsbmlConstants}.  The names of the type codes all begin with the
153   * characters <code>SBML_.</code> 
154   * <p>
155   * @return the SBML type code for this object, or {@link  libsbmlConstants#SBML_UNKNOWN SBML_UNKNOWN} (default).
156   * <p>
157   * @see #getElementName()
158   */ public
159 int getTypeCode() {
160    return libsbmlJNI.ModifierSpeciesReference_getTypeCode(swigCPtr, this);
161  }
162
163  
164/**
165   * Returns the XML element name of this object, which for {@link Species}, is
166   * always <code>'modifierSpeciesReference'.</code>
167   * <p>
168   * @return the name of this element, i.e., <code>'modifierSpeciesReference'.</code>
169   */ public
170 String getElementName() {
171    return libsbmlJNI.ModifierSpeciesReference_getElementName(swigCPtr, this);
172  }
173
174  
175/**
176   * Predicate returning <code>true</code> if
177   * all the required attributes for this {@link ModifierSpeciesReference} object
178   * have been set.
179   * <p>
180   * @note The required attributes for a {@link ModifierSpeciesReference} object are:
181   * species
182   */ public
183 boolean hasRequiredAttributes() {
184    return libsbmlJNI.ModifierSpeciesReference_hasRequiredAttributes(swigCPtr, this);
185  }
186
187}