001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 3.0.8 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 Base extension class for the “fbc” package. 014 */ 015 016public class FbcExtension extends SBMLExtension { 017 private long swigCPtr; 018 019 protected FbcExtension(long cPtr, boolean cMemoryOwn) 020 { 021 super(libsbmlJNI.FbcExtension_SWIGUpcast(cPtr), cMemoryOwn); 022 swigCPtr = cPtr; 023 } 024 025 protected static long getCPtr(FbcExtension obj) 026 { 027 return (obj == null) ? 0 : obj.swigCPtr; 028 } 029 030 protected static long getCPtrAndDisown (FbcExtension obj) 031 { 032 long ptr = 0; 033 034 if (obj != null) 035 { 036 ptr = obj.swigCPtr; 037 obj.swigCMemOwn = false; 038 } 039 040 return ptr; 041 } 042 043 protected void finalize() { 044 delete(); 045 } 046 047 public synchronized void delete() { 048 if (swigCPtr != 0) { 049 if (swigCMemOwn) { 050 swigCMemOwn = false; 051 libsbmlJNI.delete_FbcExtension(swigCPtr); 052 } 053 swigCPtr = 0; 054 } 055 super.delete(); 056 } 057 058 /** 059 * @internal 060 */ 061 public SBasePlugin DowncastSBasePlugin(long cPtr, boolean owner) 062 { 063 if (cPtr == 0) return null; 064 065 SBasePlugin sbp = new SBasePlugin(cPtr, false); 066 SBase sb = sbp.getParentSBMLObject(); 067 068 switch( sb.getTypeCode() ) 069 { 070 case (int) libsbml.SBML_SPECIES: 071 return new FbcSpeciesPlugin(cPtr, owner); 072 073 case (int) libsbml.SBML_MODEL: 074 return new FbcModelPlugin(cPtr, owner); 075 076 case (int) libsbml.SBML_REACTION: 077 return new FbcReactionPlugin(cPtr, owner); 078 079 default: 080 return new SBasePlugin(cPtr, owner); 081 } 082 } 083 084 /** 085 * @internal 086 */ 087 public SBase DowncastSBase(long cPtr, boolean owner) 088 { 089 if (cPtr == 0) return null; 090 091 SBase sb = new SBase(cPtr, false); 092 switch( sb.getTypeCode() ) 093 { 094 case (int) libsbml.SBML_LIST_OF: 095 String name = sb.getElementName(); 096 if (name.equals("listOfFbcAssociations")) 097 { 098 return new ListOfFbcAssociations(cPtr, owner); 099 } 100 else if(name.equals("listOfFluxBounds")) 101 { 102 return new ListOfFluxBounds(cPtr, owner); 103 } 104 else if (name.equals("listOfFluxes") || name.equals("listOfFluxObjectives")) 105 { 106 return new ListOfFluxObjectives(cPtr, owner); 107 } 108 else if(name.equals("listOfGeneAssociations")) 109 { 110 return new ListOfGeneAssociations(cPtr, owner); 111 } 112 else if (name.equals("listOfObjectives")) 113 { 114 return new ListOfObjectives(cPtr, owner); 115 } 116 else if (name.equals("listOfGeneProducts")) 117 { 118 return new ListOfGeneProducts(cPtr, owner); 119 } 120 121 return new ListOf(cPtr, owner); 122 123 case (int) libsbml.SBML_FBC_ASSOCIATION: 124 return new FbcAssociation(cPtr, owner); 125 126 case (int) libsbml.SBML_FBC_V1ASSOCIATION: 127 return new Association(cPtr, owner); 128 129 case (int) libsbml.SBML_FBC_FLUXBOUND: 130 return new FluxBound(cPtr, owner); 131 132 case (int) libsbml.SBML_FBC_FLUXOBJECTIVE: 133 return new FluxObjective(cPtr, owner); 134 135 case (int) libsbml.SBML_FBC_GENEPRODUCTASSOCIATION: 136 return new GeneProductAssociation(cPtr, owner); 137 138 case (int) libsbml.SBML_FBC_GENEASSOCIATION: 139 return new GeneAssociation(cPtr, owner); 140 141 case (int) libsbml.SBML_FBC_OBJECTIVE: 142 return new Objective(cPtr, owner); 143 144 case (int) libsbml.SBML_FBC_GENEPRODUCT: 145 return new GeneProduct(cPtr, owner); 146 147 case (int) libsbml.SBML_FBC_GENEPRODUCTREF: 148 return new GeneProductRef(cPtr, owner); 149 150 case (int) libsbml.SBML_FBC_AND: 151 return new FbcAnd(cPtr, owner); 152 153 case (int) libsbml.SBML_FBC_OR: 154 return new FbcOr(cPtr, owner); 155 156 default: 157 return new SBase(cPtr, owner); 158 } 159 } 160 161 162 163/** 164 * Returns the nickname of the SBML Level 3 package implemented by 165 * this libSBML extension. 166 <p> 167 * @return the package nickname, as a string. 168 <p> 169 * 170 */ public 171 static String getPackageName() { 172 return libsbmlJNI.FbcExtension_getPackageName(); 173 } 174 175 176/** 177 * Returns the default SBML Level used by this libSBML package extension. 178 <p> 179 * @return the SBML Level. 180 <p> 181 * 182 */ public 183 static long getDefaultLevel() { 184 return libsbmlJNI.FbcExtension_getDefaultLevel(); 185 } 186 187 188/** 189 * Returns the default SBML Version used by this libSBML package extension. 190 <p> 191 * @return the Version within the default SBML Level. 192 <p> 193 * 194 */ public 195 static long getDefaultVersion() { 196 return libsbmlJNI.FbcExtension_getDefaultVersion(); 197 } 198 199 200/** 201 * Returns the default version of the SBML Level 3 package implemented 202 * by this libSBML extension. 203 <p> 204 * @return the default version number of the SBML Level 3 package 205 * definition. 206 <p> 207 * 208 */ public 209 static long getDefaultPackageVersion() { 210 return libsbmlJNI.FbcExtension_getDefaultPackageVersion(); 211 } 212 213 214/** 215 * Returns the XML namespace URI of the SBML Level 3 package 216 * implemented by this libSBML extension. 217 <p> 218 * @return the XML namespace as a string. 219 <p> 220 * 221 */ public 222 static String getXmlnsL3V1V1() { 223 return libsbmlJNI.FbcExtension_getXmlnsL3V1V1(); 224 } 225 226 227/** 228 * Returns the XML namespace URI of the SBML Level 3 package 229 * implemented by this libSBML extension. 230 <p> 231 * @return the XML namespace as a string. 232 <p> 233 * 234 */ public 235 static String getXmlnsL3V1V2() { 236 return libsbmlJNI.FbcExtension_getXmlnsL3V1V2(); 237 } 238 239 240/** 241 * Creates a new {@link FbcExtension} instance. 242 */ public 243 FbcExtension() { 244 this(libsbmlJNI.new_FbcExtension__SWIG_0(), true); 245 } 246 247 248/** 249 * Copy constructor for {@link FbcExtension}. 250 <p> 251 * @param orig; the {@link FbcExtension} instance to copy. 252 */ public 253 FbcExtension(FbcExtension orig) { 254 this(libsbmlJNI.new_FbcExtension__SWIG_1(FbcExtension.getCPtr(orig), orig), true); 255 } 256 257 258/** 259 * Creates and returns a deep copy of this {@link FbcExtension} object. 260 <p> 261 * @return a (deep) copy of this {@link FbcExtension} object. 262 */ public 263 FbcExtension cloneObject() { 264 long cPtr = libsbmlJNI.FbcExtension_cloneObject(swigCPtr, this); 265 return (cPtr == 0) ? null : new FbcExtension(cPtr, true); 266 } 267 268 269/** 270 * Returns the name of this SBML Level 3 package ('fbc'). 271 <p> 272 * @return a string representing the name of this package ('fbc'). 273 */ public 274 String getName() { 275 return libsbmlJNI.FbcExtension_getName(swigCPtr, this); 276 } 277 278 279/** 280 * Returns a string representing the SBML XML namespace of this 281 * SBML Level 3 package. 282 <p> 283 * The namespace URI constructed by this method corresponds to the 284 * combination of the Level and Version of SBML, and the Version of the 285 * SBML Level 3 package. (At the time of this writing, the only SBML 286 * Level that supports packages is Level 3, so the value of 287 * <code>sbmlLevel</code> is necessarily always <code>3</code>.) 288 <p> 289 * @param sbmlLevel the level of SBML 290 * @param sbmlVersion the version of SBML 291 * @param pkgVersion the version of package 292 <p> 293 * @return a string representing the package URI, or an empty string if no 294 * corresponding URI exists. 295 */ public 296 String getURI(long sbmlLevel, long sbmlVersion, long pkgVersion) { 297 return libsbmlJNI.FbcExtension_getURI(swigCPtr, this, sbmlLevel, sbmlVersion, pkgVersion); 298 } 299 300 301/** 302 * Returns the SBML Level for the given URI of this package. 303 <p> 304 * @param uri a URI that represents a version of this package. 305 <p> 306 * @return the SBML Level for the given URI of this package, or <code>0</code> if the 307 * given URI is invalid. 308 */ public 309 long getLevel(String uri) { 310 return libsbmlJNI.FbcExtension_getLevel(swigCPtr, this, uri); 311 } 312 313 314/** 315 * Returns the Version within the SBML Level for the given URI of this 316 * package. 317 <p> 318 * @param uri a URI that represents a version of this package. 319 <p> 320 * @return the SBML Version within the SBML Level for the given URI of this 321 * package, or <code>0</code> if the given URI is invalid. 322 */ public 323 long getVersion(String uri) { 324 return libsbmlJNI.FbcExtension_getVersion(swigCPtr, this, uri); 325 } 326 327 328/** 329 * Returns the SBML Level 3 package version for the given URI of this 330 * package. 331 <p> 332 * @param uri a URI that represents one of the valid versions of this 333 * package. 334 <p> 335 * @return the version of the SBML Level 3 package with the given URI, 336 * or <code>0</code> if the given URI is invalid. 337 */ public 338 long getPackageVersion(String uri) { 339 return libsbmlJNI.FbcExtension_getPackageVersion(swigCPtr, this, uri); 340 } 341 342 343/** 344 * Returns an {@link FbcPkgNamespaces} object. 345 <p> 346 * @param uri a URI that represents one of the valid versions of the 347 * “fbc” package 348 <p> 349 * @return an FbcPkgNamespace object corresponding to the given <code>uri</code>, or 350 * <code>null</code> if the URI is not defined in the “fbc” package. 351 */ public 352 SBMLNamespaces getSBMLExtensionNamespaces(String uri) { 353 return libsbml.DowncastSBMLNamespaces(libsbmlJNI.FbcExtension_getSBMLExtensionNamespaces(swigCPtr, this, uri), false); 354} 355 356 357/** 358 * Takes a type code of the “fbc” package and returns a string 359 * describing the code. 360 <p> 361 * @param typeCode a libSBML type code defined by the libSBML extension 362 * implementing support for the SBML Level 3 “fbc” package. 363 <p> 364 * @return a text string representing the type code given by <code>typeCode</code>. 365 * If the type code is unrecognized for this implementation of the libSBML 366 * “fbc” package, the string returned will be 367 * <code>'(Unknown SBML Fbc Type)'</code>. 368 */ public 369 String getStringFromTypeCode(int typeCode) { 370 return libsbmlJNI.FbcExtension_getStringFromTypeCode(swigCPtr, this, typeCode); 371 } 372 373 374/** * @internal */ public 375 static void init() { 376 libsbmlJNI.FbcExtension_init(); 377 } 378 379 380/** * @internal */ public 381 SWIGTYPE_p_packageErrorTableEntryV2 getErrorTableV2(long index) { 382 return new SWIGTYPE_p_packageErrorTableEntryV2(libsbmlJNI.FbcExtension_getErrorTableV2(swigCPtr, this, index), true); 383 } 384 385 386/** * @internal */ public 387 long getErrorTableIndex(long errorId) { 388 return libsbmlJNI.FbcExtension_getErrorTableIndex(swigCPtr, this, errorId); 389 } 390 391 392/** * @internal */ public 393 long getErrorIdOffset() { 394 return libsbmlJNI.FbcExtension_getErrorIdOffset(swigCPtr, this); 395 } 396 397 398/** * @internal */ public 399 boolean hasMultipleVersions() { 400 return libsbmlJNI.FbcExtension_hasMultipleVersions(swigCPtr, this); 401 } 402 403}