001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 3.0.7 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 * A reference to an SBML <em>modifier species</em>. 013 <p> 014 * Sometimes a species appears in the kinetic rate formula of a reaction 015 * but is itself neither created nor destroyed in that reaction (for 016 * example, because it acts as a catalyst or inhibitor). In SBML, all such 017 * species are simply called <em>modifiers</em> without regard to the detailed 018 * role of those species in the model. The {@link Reaction} structure provides a 019 * way to express which species act as modifiers in a given reaction. This 020 * is the purpose of the list of modifiers available in {@link Reaction}. The list 021 * contains instances of {@link ModifierSpeciesReference} structures. 022 <p> 023 * The {@link ModifierSpeciesReference} structure inherits the mandatory attribute 024 * 'species' and optional attributes 'id' and 'name' from the parent class 025 * {@link SimpleSpeciesReference}. See the description of {@link SimpleSpeciesReference} 026 * for more information about these. 027 <p> 028 * The value of the 'species' attribute must be the identifier of a species 029 * defined in the enclosing {@link Model}; this species is designated as a modifier 030 * for the current reaction. A reaction may have any number of modifiers. 031 * It is permissible for a modifier species to appear simultaneously in the 032 * list of reactants and products of the same reaction where it is 033 * designated as a modifier, as well as to appear in the list of reactants, 034 * products and modifiers of other reactions in the model. 035 */ 036 037public class ModifierSpeciesReference extends SimpleSpeciesReference { 038 private long swigCPtr; 039 040 protected ModifierSpeciesReference(long cPtr, boolean cMemoryOwn) 041 { 042 super(libsbmlJNI.ModifierSpeciesReference_SWIGUpcast(cPtr), cMemoryOwn); 043 swigCPtr = cPtr; 044 } 045 046 protected static long getCPtr(ModifierSpeciesReference obj) 047 { 048 return (obj == null) ? 0 : obj.swigCPtr; 049 } 050 051 protected static long getCPtrAndDisown (ModifierSpeciesReference obj) 052 { 053 long ptr = 0; 054 055 if (obj != null) 056 { 057 ptr = obj.swigCPtr; 058 obj.swigCMemOwn = false; 059 } 060 061 return ptr; 062 } 063 064 protected void finalize() { 065 delete(); 066 } 067 068 public synchronized void delete() { 069 if (swigCPtr != 0) { 070 if (swigCMemOwn) { 071 swigCMemOwn = false; 072 libsbmlJNI.delete_ModifierSpeciesReference(swigCPtr); 073 } 074 swigCPtr = 0; 075 } 076 super.delete(); 077 } 078 079 080/** 081 * Creates a new {@link ModifierSpeciesReference} using the given SBML <code>level</code> and 082 * <code>version</code> values. 083 <p> 084 * @param level a long integer, the SBML Level to assign to this 085 * {@link ModifierSpeciesReference} 086 <p> 087 * @param version a long integer, the SBML Version to assign to this 088 * {@link ModifierSpeciesReference} 089 <p> 090 * <p> 091 * @throws SBMLConstructorException 092 * Thrown if the given <code>level</code> and <code>version</code> combination are invalid 093 * or if this object is incompatible with the given level and version. 094 <p> 095 * <p> 096 * @note Attempting to add an object to an {@link SBMLDocument} having a different 097 * combination of SBML Level, Version and XML namespaces than the object 098 * itself will result in an error at the time a caller attempts to make the 099 * addition. A parent object must have compatible Level, Version and XML 100 * namespaces. (Strictly speaking, a parent may also have more XML 101 * namespaces than a child, but the reverse is not permitted.) The 102 * restriction is necessary to ensure that an SBML model has a consistent 103 * overall structure. This requires callers to manage their objects 104 * carefully, but the benefit is increased flexibility in how models can be 105 * created by permitting callers to create objects bottom-up if desired. In 106 * situations where objects are not yet attached to parents (e.g., 107 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 108 * libSBML determine such things as whether it is valid to assign a 109 * particular value to an attribute. 110 */ public 111 ModifierSpeciesReference(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 112 this(libsbmlJNI.new_ModifierSpeciesReference__SWIG_0(level, version), true); 113 } 114 115 116/** 117 * Creates a new {@link ModifierSpeciesReference} using the given {@link SBMLNamespaces} 118 * object <code>sbmlns</code>. 119 <p> 120 * @param sbmlns an {@link SBMLNamespaces} object. 121 <p> 122 * <p> 123 * @throws SBMLConstructorException 124 * Thrown if the given <code>sbmlns</code> is inconsistent or incompatible 125 * with this object. 126 <p> 127 * <p> 128 * @note Attempting to add an object to an {@link SBMLDocument} having a different 129 * combination of SBML Level, Version and XML namespaces than the object 130 * itself will result in an error at the time a caller attempts to make the 131 * addition. A parent object must have compatible Level, Version and XML 132 * namespaces. (Strictly speaking, a parent may also have more XML 133 * namespaces than a child, but the reverse is not permitted.) The 134 * restriction is necessary to ensure that an SBML model has a consistent 135 * overall structure. This requires callers to manage their objects 136 * carefully, but the benefit is increased flexibility in how models can be 137 * created by permitting callers to create objects bottom-up if desired. In 138 * situations where objects are not yet attached to parents (e.g., 139 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 140 * libSBML determine such things as whether it is valid to assign a 141 * particular value to an attribute. 142 */ public 143 ModifierSpeciesReference(SBMLNamespaces sbmlns) throws org.sbml.libsbml.SBMLConstructorException { 144 this(libsbmlJNI.new_ModifierSpeciesReference__SWIG_1(SBMLNamespaces.getCPtr(sbmlns), sbmlns), true); 145 } 146 147 148/** 149 * Creates and returns a deep copy of this {@link ModifierSpeciesReference} object. 150 <p> 151 * @return the (deep) copy of this {@link ModifierSpeciesReference} object. 152 */ public 153 SBase cloneObject() { 154 long cPtr = libsbmlJNI.ModifierSpeciesReference_cloneObject(swigCPtr, this); 155 return (cPtr == 0) ? null : new ModifierSpeciesReference(cPtr, true); 156 } 157 158 159/** 160 * Returns the libSBML type code for this SBML object. 161 <p> 162 * <p> 163 * LibSBML attaches an identifying code to every kind of SBML object. These 164 * are integer constants known as <em>SBML type codes</em>. The names of all 165 * the codes begin with the characters <code>SBML_</code>. 166 * In the Java language interface for libSBML, the 167 * type codes are defined as static integer constants in the interface class 168 * {@link libsbmlConstants}. Note that different Level 3 169 * package plug-ins may use overlapping type codes; to identify the package 170 * to which a given object belongs, call the <code>getPackageName()</code> 171 * method on the object. 172 <p> 173 * @return the SBML type code for this object: 174 * {@link libsbmlConstants#SBML_MODIFIER_SPECIES_REFERENCE SBML_MODIFIER_SPECIES_REFERENCE} (default). 175 <p> 176 * <p> 177 * @warning <span class='warning'>The specific integer values of the possible 178 * type codes may be reused by different Level 3 package plug-ins. 179 * Thus, to identifiy the correct code, <strong>it is necessary to invoke 180 * both getTypeCode() and getPackageName()</strong>.</span> 181 <p> 182 * @see #getElementName() 183 * @see #getPackageName() 184 */ public 185 int getTypeCode() { 186 return libsbmlJNI.ModifierSpeciesReference_getTypeCode(swigCPtr, this); 187 } 188 189 190/** 191 * Returns the XML element name of this object, which for {@link Species}, is 192 * always <code>'modifierSpeciesReference'.</code> 193 <p> 194 * @return the name of this element, i.e., <code>'modifierSpeciesReference'.</code> 195 */ public 196 String getElementName() { 197 return libsbmlJNI.ModifierSpeciesReference_getElementName(swigCPtr, this); 198 } 199 200 201/** 202 * Predicate returning <code>true</code> if 203 * all the required attributes for this {@link ModifierSpeciesReference} object 204 * have been set. 205 <p> 206 * The required attributes for a {@link ModifierSpeciesReference} object are: 207 * species 208 <p> 209 * @return <code>true</code> if the required attributes have been set, <code>false</code> 210 * otherwise. 211 */ public 212 boolean hasRequiredAttributes() { 213 return libsbmlJNI.ModifierSpeciesReference_hasRequiredAttributes(swigCPtr, this); 214 } 215 216}