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