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 * Implementation of SBML's ModifierSpeciesReference 013 * 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 */ 037 038public class ModifierSpeciesReference extends SimpleSpeciesReference { 039 private long swigCPtr; 040 041 protected ModifierSpeciesReference(long cPtr, boolean cMemoryOwn) 042 { 043 super(libsbmlJNI.ModifierSpeciesReference_SWIGUpcast(cPtr), cMemoryOwn); 044 swigCPtr = cPtr; 045 } 046 047 protected static long getCPtr(ModifierSpeciesReference obj) 048 { 049 return (obj == null) ? 0 : obj.swigCPtr; 050 } 051 052 protected static long getCPtrAndDisown (ModifierSpeciesReference obj) 053 { 054 long ptr = 0; 055 056 if (obj != null) 057 { 058 ptr = obj.swigCPtr; 059 obj.swigCMemOwn = false; 060 } 061 062 return ptr; 063 } 064 065 protected void finalize() { 066 delete(); 067 } 068 069 public synchronized void delete() { 070 if (swigCPtr != 0) { 071 if (swigCMemOwn) { 072 swigCMemOwn = false; 073 libsbmlJNI.delete_ModifierSpeciesReference(swigCPtr); 074 } 075 swigCPtr = 0; 076 } 077 super.delete(); 078 } 079 080 081/** 082 * Creates a new {@link ModifierSpeciesReference} using the given SBML <code>level</code> and 083 * <code>version</code> values. 084 <p> 085 * @param level a long integer, the SBML Level to assign to this 086 * {@link ModifierSpeciesReference} 087 <p> 088 * @param version a long integer, the SBML Version to assign to this 089 * {@link ModifierSpeciesReference} 090 <p> 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} 111 * object <code>sbmlns</code>. 112 <p> 113 * @param sbmlns an {@link SBMLNamespaces} object. 114 <p> 115 * <p> 116 * @note Upon the addition of a {@link ModifierSpeciesReference} object to an 117 * {@link SBMLDocument} (e.g., using {@link Reaction#addModifier(ModifierSpeciesReference msr)}), the 118 * SBML Level, SBML Version and XML namespace of the document 119 * <em>override</em> the values used when creating the {@link ModifierSpeciesReference} 120 * object via this constructor. This is necessary to ensure that an SBML 121 * document is a consistent structure. Nevertheless, the ability to 122 * supply the values at the time of creation of a 123 * {@link ModifierSpeciesReference} is an important aid to producing valid SBML. 124 * Knowledge of the intented SBML Level and Version determine whether it 125 * is valid to assign a particular value to an attribute, or whether it 126 * is valid to add an object to an existing {@link SBMLDocument}. 127 */ public 128 ModifierSpeciesReference(SBMLNamespaces sbmlns) throws org.sbml.libsbml.SBMLConstructorException { 129 this(libsbmlJNI.new_ModifierSpeciesReference__SWIG_1(SBMLNamespaces.getCPtr(sbmlns), sbmlns), true); 130 } 131 132 133/** 134 * Creates and returns a deep copy of this {@link ModifierSpeciesReference} 135 * instance. 136 <p> 137 * @return a (deep) copy of this {@link ModifierSpeciesReference}. 138 */ public 139 SBase cloneObject() { 140 long cPtr = libsbmlJNI.ModifierSpeciesReference_cloneObject(swigCPtr, this); 141 return (cPtr == 0) ? null : new ModifierSpeciesReference(cPtr, true); 142 } 143 144 145/** 146 * Returns the libSBML type code for this SBML object. 147 <p> 148 * <p> 149 * LibSBML attaches an identifying code to every kind of SBML object. These 150 * are integer constants known as <em>SBML type codes</em>. The names of all 151 * the codes begin with the characters “<code>SBML_</code>”. 152 * In the Java language interface for libSBML, the 153 * type codes are defined as static integer constants in the interface class 154 * {@link libsbmlConstants}. Note that different Level 3 155 * package plug-ins may use overlapping type codes; to identify the package 156 * to which a given object belongs, call the <code>getPackageName()</code> 157 * method on the object. 158 <p> 159 * @return the SBML type code for this object: 160 * {@link libsbmlConstants#SBML_MODIFIER_SPECIES_REFERENCE SBML_MODIFIER_SPECIES_REFERENCE} (default). 161 <p> 162 * <p> 163 * @warning <span class='warning'>The specific integer values of the possible 164 * type codes may be reused by different Level 3 package plug-ins. 165 * Thus, to identifiy the correct code, <strong>it is necessary to invoke 166 * both getTypeCode() and getPackageName()</strong>.</span> 167 <p> 168 * @see #getElementName() 169 * @see #getPackageName() 170 */ public 171 int getTypeCode() { 172 return libsbmlJNI.ModifierSpeciesReference_getTypeCode(swigCPtr, this); 173 } 174 175 176/** 177 * Returns the XML element name of this object, which for {@link Species}, is 178 * always <code>'modifierSpeciesReference'.</code> 179 <p> 180 * @return the name of this element, i.e., <code>'modifierSpeciesReference'.</code> 181 */ public 182 String getElementName() { 183 return libsbmlJNI.ModifierSpeciesReference_getElementName(swigCPtr, this); 184 } 185 186 187/** 188 * Predicate returning <code>true</code> if 189 * all the required attributes for this {@link ModifierSpeciesReference} object 190 * have been set. 191 <p> 192 * @note The required attributes for a {@link ModifierSpeciesReference} object are: 193 * species 194 */ public 195 boolean hasRequiredAttributes() { 196 return libsbmlJNI.ModifierSpeciesReference_hasRequiredAttributes(swigCPtr, this); 197 } 198 199}