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 * <span class="pkg-marker pkg-color-fbc"><a href="group__fbc.html">fbc</a></span> 013 Extension of {@link Reaction} by the “fbc” package. 014 <p> 015 * The {@link FbcReactionPlugin} class inherits from the {@link SBasePlugin} class, 016 * and codifies the extentions to the {@link Reaction} class defined in the 017 * 'Flux Balance Constraints' 018 * package (“fbc”). This extention allows the modeler to define 019 * (in version 2 of the package) an upper and lower flux bound, as well as a way 020 * to reference any {@link GeneProduct} associated with this {@link Reaction}. 021 <p> 022 * Note that in version 1, the {@link FluxBound} element is used instead. 023 */ 024 025public class FbcReactionPlugin extends SBasePlugin { 026 private long swigCPtr; 027 028 protected FbcReactionPlugin(long cPtr, boolean cMemoryOwn) 029 { 030 super(libsbmlJNI.FbcReactionPlugin_SWIGUpcast(cPtr), cMemoryOwn); 031 swigCPtr = cPtr; 032 } 033 034 protected static long getCPtr(FbcReactionPlugin obj) 035 { 036 return (obj == null) ? 0 : obj.swigCPtr; 037 } 038 039 protected static long getCPtrAndDisown (FbcReactionPlugin obj) 040 { 041 long ptr = 0; 042 043 if (obj != null) 044 { 045 ptr = obj.swigCPtr; 046 obj.swigCMemOwn = false; 047 } 048 049 return ptr; 050 } 051 052 protected void finalize() { 053 delete(); 054 } 055 056 public synchronized void delete() { 057 if (swigCPtr != 0) { 058 if (swigCMemOwn) { 059 swigCMemOwn = false; 060 libsbmlJNI.delete_FbcReactionPlugin(swigCPtr); 061 } 062 swigCPtr = 0; 063 } 064 super.delete(); 065 } 066 067 068/** 069 * Creates a new {@link FbcReactionPlugin} 070 */ public 071 FbcReactionPlugin(String uri, String prefix, FbcPkgNamespaces fbcns) { 072 this(libsbmlJNI.new_FbcReactionPlugin__SWIG_0(uri, prefix, FbcPkgNamespaces.getCPtr(fbcns), fbcns), true); 073 } 074 075 076/** 077 * Copy constructor for {@link FbcReactionPlugin}. 078 <p> 079 * @param orig; the {@link FbcReactionPlugin} instance to copy. 080 */ public 081 FbcReactionPlugin(FbcReactionPlugin orig) { 082 this(libsbmlJNI.new_FbcReactionPlugin__SWIG_1(FbcReactionPlugin.getCPtr(orig), orig), true); 083 } 084 085 086/** 087 * Creates and returns a deep copy of this {@link FbcReactionPlugin} object. 088 <p> 089 * @return a (deep) copy of this {@link FbcReactionPlugin} object. 090 */ public 091 SBasePlugin cloneObject() { 092 long cPtr = libsbmlJNI.FbcReactionPlugin_cloneObject(swigCPtr, this); 093 return (cPtr == 0) ? null : new FbcReactionPlugin(cPtr, true); 094 } 095 096 097/** * @internal */ public 098 SBase createObject(XMLInputStream stream) { 099 return libsbml.DowncastSBase(libsbmlJNI.FbcReactionPlugin_createObject(swigCPtr, this, XMLInputStream.getCPtr(stream), stream), false); 100} 101 102 103/** 104 * Checks if this plugin object has all the required elements. 105 <p> 106 * Subclasses must override this method 107 * if they have their specific elements. 108 <p> 109 * @return true if this plugin object has all the required elements 110 * otherwise false will be returned. 111 */ public 112 boolean hasRequiredElements() { 113 return libsbmlJNI.FbcReactionPlugin_hasRequiredElements(swigCPtr, this); 114 } 115 116 117/** * @internal */ public 118 void addExpectedAttributes(SWIGTYPE_p_ExpectedAttributes attributes) { 119 libsbmlJNI.FbcReactionPlugin_addExpectedAttributes(swigCPtr, this, SWIGTYPE_p_ExpectedAttributes.getCPtr(attributes)); 120 } 121 122 123/** 124 * <p> 125 * Replaces all uses of a given <code>SIdRef</code> type attribute value with another 126 * value. 127 <p> 128 * <p> 129 * In SBML, object identifiers are of a data type called <code>SId</code>. 130 * In SBML Level 3, an explicit data type called <code>SIdRef</code> was 131 * introduced for attribute values that refer to <code>SId</code> values; in 132 * previous Levels of SBML, this data type did not exist and attributes were 133 * simply described to as 'referring to an identifier', but the effective 134 * data type was the same as <code>SIdRef</code>in Level 3. These and 135 * other methods of libSBML refer to the type <code>SIdRef</code> for all 136 * Levels of SBML, even if the corresponding SBML specification did not 137 * explicitly name the data type. 138 <p> 139 * This method works by looking at all attributes and (if appropriate) 140 * mathematical formulas in MathML content, comparing the referenced 141 * identifiers to the value of <code>oldid</code>. If any matches are found, the 142 * matching values are replaced with <code>newid</code>. The method does <em>not</em> 143 * descend into child elements. 144 <p> 145 * @param oldid the old identifier 146 * @param newid the new identifier 147 */ public 148 void renameSIdRefs(String oldid, String newid) { 149 libsbmlJNI.FbcReactionPlugin_renameSIdRefs(swigCPtr, this, oldid, newid); 150 } 151 152 153/** * @internal */ public 154 void readAttributes(XMLAttributes attributes, SWIGTYPE_p_ExpectedAttributes expectedAttributes) { 155 libsbmlJNI.FbcReactionPlugin_readAttributes(swigCPtr, this, XMLAttributes.getCPtr(attributes), attributes, SWIGTYPE_p_ExpectedAttributes.getCPtr(expectedAttributes)); 156 } 157 158 159/** * @internal */ public 160 void writeAttributes(XMLOutputStream stream) { 161 libsbmlJNI.FbcReactionPlugin_writeAttributes(swigCPtr, this, XMLOutputStream.getCPtr(stream), stream); 162 } 163 164 165/** 166 * Returns the {@link GeneProductAssociation} from this {@link FbcReactionPlugin} object. 167 <p> 168 * @return the {@link GeneProductAssociation} from object in this {@link FbcReactionPlugin} object. 169 */ public 170 GeneProductAssociation getGeneProductAssociation() { 171 long cPtr = libsbmlJNI.FbcReactionPlugin_getGeneProductAssociation__SWIG_0(swigCPtr, this); 172 return (cPtr == 0) ? null : new GeneProductAssociation(cPtr, false); 173 } 174 175 176/** 177 * Predicate returning <code>true</code> if this {@link FbcReactionPlugin}'s 178 * 'GeneProductAssociation' element has been set. 179 <p> 180 * @return <code>true</code> if the 'GeneProductAssociation' element has been set, 181 * otherwise <code>false</code> is returned. 182 */ public 183 boolean isSetGeneProductAssociation() { 184 return libsbmlJNI.FbcReactionPlugin_isSetGeneProductAssociation(swigCPtr, this); 185 } 186 187 188/** 189 * Sets the {@link GeneProductAssociation} element in this {@link FbcReactionPlugin} object. 190 <p> 191 * @param geneProductAssociation the geneProductAssociation to be set. 192 <p> 193 * @return integer value indicating success/failure of the 194 * function. The possible values 195 * returned by this function are: 196 * <ul> 197 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 198 * </ul> 199 */ public 200 int setGeneProductAssociation(GeneProductAssociation geneProductAssociation) { 201 return libsbmlJNI.FbcReactionPlugin_setGeneProductAssociation(swigCPtr, this, GeneProductAssociation.getCPtr(geneProductAssociation), geneProductAssociation); 202 } 203 204 205/** 206 * Creates a new {@link GeneProductAssociation} object and adds it to the {@link FbcReactionPlugin} object. 207 <p> 208 * @return the newly created {@link GeneProductAssociation} object. 209 */ public 210 GeneProductAssociation createGeneProductAssociation() { 211 long cPtr = libsbmlJNI.FbcReactionPlugin_createGeneProductAssociation(swigCPtr, this); 212 return (cPtr == 0) ? null : new GeneProductAssociation(cPtr, false); 213 } 214 215 216/** 217 * Returns the value of the 'lowerFluxBound' attribute of this {@link FbcReactionPlugin}. 218 <p> 219 * @return the value of the 'lowerFluxBound' attribute of this {@link FbcReactionPlugin} as a string. 220 */ public 221 String getLowerFluxBound() { 222 return libsbmlJNI.FbcReactionPlugin_getLowerFluxBound(swigCPtr, this); 223 } 224 225 226/** 227 * Returns the value of the 'upperFluxBound' attribute of this {@link FbcReactionPlugin}. 228 <p> 229 * @return the value of the 'upperFluxBound' attribute of this {@link FbcReactionPlugin} as a string. 230 */ public 231 String getUpperFluxBound() { 232 return libsbmlJNI.FbcReactionPlugin_getUpperFluxBound(swigCPtr, this); 233 } 234 235 236/** 237 * Predicate returning <code>true</code> if this {@link FbcReactionPlugin}'s 'lowerFluxBound' 238 * attribute is set. 239 <p> 240 * @return <code>true</code> if this {@link FbcReactionPlugin}'s 'lowerFluxBound' attribute has been set, 241 * otherwise <code>false</code> is returned. 242 */ public 243 boolean isSetLowerFluxBound() { 244 return libsbmlJNI.FbcReactionPlugin_isSetLowerFluxBound(swigCPtr, this); 245 } 246 247 248/** 249 * Predicate returning <code>true</code> if this {@link FbcReactionPlugin}'s 'upperFluxBound' 250 * attribute is set. 251 <p> 252 * @return <code>true</code> if this {@link FbcReactionPlugin}'s 'upperFluxBound' attribute has been set, 253 * otherwise <code>false</code> is returned. 254 */ public 255 boolean isSetUpperFluxBound() { 256 return libsbmlJNI.FbcReactionPlugin_isSetUpperFluxBound(swigCPtr, this); 257 } 258 259 260/** 261 * Sets the value of the 'lowerFluxBound' attribute of this {@link FbcReactionPlugin}. 262 <p> 263 * @param lowerFluxBound; String value of the 'lowerFluxBound' attribute to be set 264 <p> 265 * @return integer value indicating success/failure of the 266 * function. The possible values 267 * returned by this function are: 268 * <ul> 269 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 270 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 271 * </ul> 272 */ public 273 int setLowerFluxBound(String lowerFluxBound) { 274 return libsbmlJNI.FbcReactionPlugin_setLowerFluxBound(swigCPtr, this, lowerFluxBound); 275 } 276 277 278/** 279 * Sets the value of the 'upperFluxBound' attribute of this {@link FbcReactionPlugin}. 280 <p> 281 * @param upperFluxBound; String value of the 'upperFluxBound' attribute to be set 282 <p> 283 * @return integer value indicating success/failure of the 284 * function. The possible values 285 * returned by this function are: 286 * <ul> 287 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 288 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 289 * </ul> 290 */ public 291 int setUpperFluxBound(String upperFluxBound) { 292 return libsbmlJNI.FbcReactionPlugin_setUpperFluxBound(swigCPtr, this, upperFluxBound); 293 } 294 295 296/** 297 * Unsets the value of the 'lowerFluxBound' attribute of this {@link FbcReactionPlugin}. 298 <p> 299 * @return integer value indicating success/failure of the 300 * function. The possible values 301 * returned by this function are: 302 * <ul> 303 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 304 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 305 * </ul> 306 */ public 307 int unsetLowerFluxBound() { 308 return libsbmlJNI.FbcReactionPlugin_unsetLowerFluxBound(swigCPtr, this); 309 } 310 311 312/** 313 * Unsets the value of the 'upperFluxBound' attribute of this {@link FbcReactionPlugin}. 314 <p> 315 * @return integer value indicating success/failure of the 316 * function. The possible values 317 * returned by this function are: 318 * <ul> 319 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 320 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 321 * </ul> 322 */ public 323 int unsetUpperFluxBound() { 324 return libsbmlJNI.FbcReactionPlugin_unsetUpperFluxBound(swigCPtr, this); 325 } 326 327 328/** 329 * Unsets the the 'geneProduct' element of this {@link FbcReactionPlugin}. 330 <p> 331 * @return integer value indicating success/failure of the 332 * function. The possible values 333 * returned by this function are: 334 * <ul> 335 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 336 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 337 * </ul> 338 */ public 339 int unsetGeneProductAssociation() { 340 return libsbmlJNI.FbcReactionPlugin_unsetGeneProductAssociation(swigCPtr, this); 341 } 342 343 344/** * @internal */ public 345 void connectToParent(SBase sbase) { 346 libsbmlJNI.FbcReactionPlugin_connectToParent(swigCPtr, this, SBase.getCPtr(sbase), sbase); 347 } 348 349 350/** * @internal */ public 351 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) { 352 libsbmlJNI.FbcReactionPlugin_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag); 353 } 354 355}