001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 2.0.11 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 011public class FbcExtension extends SBMLExtension { 012 private long swigCPtr; 013 014 protected FbcExtension(long cPtr, boolean cMemoryOwn) 015 { 016 super(libsbmlJNI.FbcExtension_SWIGUpcast(cPtr), cMemoryOwn); 017 swigCPtr = cPtr; 018 } 019 020 protected static long getCPtr(FbcExtension obj) 021 { 022 return (obj == null) ? 0 : obj.swigCPtr; 023 } 024 025 protected static long getCPtrAndDisown (FbcExtension obj) 026 { 027 long ptr = 0; 028 029 if (obj != null) 030 { 031 ptr = obj.swigCPtr; 032 obj.swigCMemOwn = false; 033 } 034 035 return ptr; 036 } 037 038 protected void finalize() { 039 delete(); 040 } 041 042 public synchronized void delete() { 043 if (swigCPtr != 0) { 044 if (swigCMemOwn) { 045 swigCMemOwn = false; 046 libsbmlJNI.delete_FbcExtension(swigCPtr); 047 } 048 swigCPtr = 0; 049 } 050 super.delete(); 051 } 052 053 public SBasePlugin DowncastSBasePlugin(long cPtr, boolean owner) 054 { 055 if (cPtr == 0) return null; 056 057 SBasePlugin sbp = new SBasePlugin(cPtr, false); 058 SBase sb = sbp.getParentSBMLObject(); 059 060 switch( sb.getTypeCode() ) 061 { 062 case (int) libsbml.SBML_MODEL: 063 return new FbcModelPlugin(cPtr,owner); 064 case (int) libsbml.SBML_SPECIES: 065 return new FbcSpeciesPlugin(cPtr, owner); 066 default: 067 return new SBasePlugin(cPtr,owner); 068 } 069 } 070 071 public SBase DowncastSBase(long cPtr, boolean owner) 072 { 073 if (cPtr == 0) return null; 074 075 SBase sb = new SBase(cPtr, false); 076 switch( sb.getTypeCode() ) 077 { 078 case (int) libsbml.SBML_LIST_OF: 079 String name = sb.getElementName(); 080 if(name =="listOfFluxBounds") 081 { 082 return new ListOfFluxBounds(cPtr, owner); 083 } 084 else if(name =="listOfFluxes") 085 { 086 return new ListOfFluxObjectives(cPtr, owner); 087 } 088 else if(name =="listOfGeneAssociations") 089 { 090 return new ListOfGeneAssociations(cPtr, owner); 091 } 092 else if(name =="listOfObjectives") 093 { 094 return new ListOfObjectives(cPtr, owner); 095 } 096 return new ListOf(cPtr, owner); 097 098 case (int) libsbml.SBML_FBC_ASSOCIATION: 099 return new Association(cPtr, owner); 100 101 case (int) libsbml.SBML_FBC_FLUXBOUND: 102 return new FluxBound(cPtr, owner); 103 104 case (int) libsbml.SBML_FBC_FLUXOBJECTIVE: 105 return new FluxObjective(cPtr, owner); 106 107 case (int) libsbml.SBML_FBC_GENEASSOCIATION: 108 return new GeneAssociation(cPtr, owner); 109 110 case (int) libsbml.SBML_FBC_OBJECTIVE: 111 return new Objective(cPtr, owner); 112 113 default: 114 return new SBase(cPtr, owner); 115 } 116 } 117 118 119 public static String getPackageName() { 120 return libsbmlJNI.FbcExtension_getPackageName(); 121 } 122 123 public static long getDefaultLevel() { 124 return libsbmlJNI.FbcExtension_getDefaultLevel(); 125 } 126 127 public static long getDefaultVersion() { 128 return libsbmlJNI.FbcExtension_getDefaultVersion(); 129 } 130 131 public static long getDefaultPackageVersion() { 132 return libsbmlJNI.FbcExtension_getDefaultPackageVersion(); 133 } 134 135 public static String getXmlnsL3V1V1() { 136 return libsbmlJNI.FbcExtension_getXmlnsL3V1V1(); 137 } 138 139 public FbcExtension() { 140 this(libsbmlJNI.new_FbcExtension__SWIG_0(), true); 141 } 142 143 public FbcExtension(FbcExtension arg0) { 144 this(libsbmlJNI.new_FbcExtension__SWIG_1(FbcExtension.getCPtr(arg0), arg0), true); 145 } 146 147 148/** 149 * (NOTICE) Package developers MUST OVERRIDE this pure virtual function 150 * in their derived class. 151 * <p> 152 * Creates and returns a deep copy of this {@link SBMLExtension} object. 153 * <p> 154 * @return a (deep) copy of this {@link SBase} object 155 * @internal 156 */ public 157 FbcExtension cloneObject() { 158 long cPtr = libsbmlJNI.FbcExtension_cloneObject(swigCPtr, this); 159 return (cPtr == 0) ? null : new FbcExtension(cPtr, true); 160 } 161 162 163/** 164 * (NOTICE) Package developers MUST OVERRIDE this pure virtual function 165 * in their derived class. 166 * <p> 167 * Returns the name of this package (e.g. 'layout', 'multi'). 168 * <p> 169 * @return the name of package extension 170 * @internal 171 */ public 172 String getName() { 173 return libsbmlJNI.FbcExtension_getName(swigCPtr, this); 174 } 175 176 177/** 178 * (NOTICE) Package developers MUST OVERRIDE this pure virtual function 179 * in their derived class. 180 * <p> 181 * Returns the uri corresponding to the given SBML level, SBML version, and package version. 182 * <p> 183 * @param sbmlLevel the level of SBML 184 * @param sbmlVersion the version of SBML 185 * @param pkgVersion the version of package 186 * <p> 187 * @return a string of the package URI 188 * @internal 189 */ public 190 String getURI(long sbmlLevel, long sbmlVersion, long pkgVersion) { 191 return libsbmlJNI.FbcExtension_getURI(swigCPtr, this, sbmlLevel, sbmlVersion, pkgVersion); 192 } 193 194 195/** 196 * (NOTICE) Package developers MUST OVERRIDE this pure virtual function 197 * in their derived class. 198 * <p> 199 * Returns the SBML level associated with the given URI of this package. 200 * <p> 201 * @param uri the string of URI that represents a versions of the package 202 * @return the SBML level associated with the given URI of this package. 203 * @internal 204 */ public 205 long getLevel(String uri) { 206 return libsbmlJNI.FbcExtension_getLevel(swigCPtr, this, uri); 207 } 208 209 210/** 211 * (NOTICE) Package developers MUST OVERRIDE this pure virtual function 212 * in their derived class. 213 * <p> 214 * Returns the SBML version associated with the given URI of this package. 215 * <p> 216 * @param uri the string of URI that represents a versions of the package 217 * @return the SBML version associated with the given URI of this package. 218 * @internal 219 */ public 220 long getVersion(String uri) { 221 return libsbmlJNI.FbcExtension_getVersion(swigCPtr, this, uri); 222 } 223 224 225/** 226 * (NOTICE) Package developers MUST OVERRIDE this pure virtual function 227 * in their derived class. 228 * <p> 229 * Returns the package version associated with the given URI of this package. 230 * <p> 231 * @param uri the string of URI that represents a versions of this package 232 * @return the package version associated with the given URI of this package. 233 * @internal 234 */ public 235 long getPackageVersion(String uri) { 236 return libsbmlJNI.FbcExtension_getPackageVersion(swigCPtr, this, uri); 237 } 238 239 240/** 241 * (NOTICE) Package developers MUST OVERRIDE this pure virtual function in 242 * their derived class. 243 * <p> 244 * Returns an {@link SBMLExtensionNamespaces}<class SBMLExtensionType> object 245 * (e.g. {@link SBMLExtensionNamespaces}<LayoutExtension> whose alias type is 246 * LayoutPkgNamespaces) corresponding to the given uri. 247 * Null will be returned if the given uri is not defined in the corresponding 248 * package. 249 * <p> 250 * @param uri the string of URI that represents one of versions of the package 251 * @return an {@link SBMLExtensionNamespaces}<class SBMLExtensionType> object. null 252 * will be returned if the given uri is not defined in the corresponding 253 * package. 254 * @internal 255 */ public 256 SBMLNamespaces getSBMLExtensionNamespaces(String uri) { 257 return libsbml.DowncastSBMLNamespaces(libsbmlJNI.FbcExtension_getSBMLExtensionNamespaces(swigCPtr, this, uri), false); 258} 259 260 261/** 262 * (NOTICE) Package developers MUST OVERRIDE this pure virtual function 263 * in their derived class. 264 * <p> 265 * This method takes a type code of this package and returns a string 266 * representing the code. 267 * @internal 268 */ public 269 String getStringFromTypeCode(int typeCode) { 270 return libsbmlJNI.FbcExtension_getStringFromTypeCode(swigCPtr, this, typeCode); 271 } 272 273 public static void init() { 274 libsbmlJNI.FbcExtension_init(); 275 } 276 277 278/** 279 * Determines whether this extension is being used by the given {@link SBMLDocument} 280 * <p> 281 * The default implementation returns true. This means that when a document 282 * had this extension enabled, it will not be possible to convert it to L2 283 * as we cannot make sure that the extension can be converted. 284 * <p> 285 * @param doc the sbml document to test. 286 * <p> 287 * @return a boolean indicating whether the extension is actually being used 288 * byy the document. 289 * @internal 290 */ public 291 SWIGTYPE_p_packageErrorTableEntry getErrorTable(long index) { 292 return new SWIGTYPE_p_packageErrorTableEntry(libsbmlJNI.FbcExtension_getErrorTable(swigCPtr, this, index), true); 293 } 294 295 296/** 297 * Determines whether this extension is being used by the given {@link SBMLDocument} 298 * <p> 299 * The default implementation returns true. This means that when a document 300 * had this extension enabled, it will not be possible to convert it to L2 301 * as we cannot make sure that the extension can be converted. 302 * <p> 303 * @param doc the sbml document to test. 304 * <p> 305 * @return a boolean indicating whether the extension is actually being used 306 * byy the document. 307 * @internal 308 */ public 309 long getErrorTableIndex(long errorId) { 310 return libsbmlJNI.FbcExtension_getErrorTableIndex(swigCPtr, this, errorId); 311 } 312 313 314/** 315 * Determines whether this extension is being used by the given {@link SBMLDocument} 316 * <p> 317 * The default implementation returns true. This means that when a document 318 * had this extension enabled, it will not be possible to convert it to L2 319 * as we cannot make sure that the extension can be converted. 320 * <p> 321 * @param doc the sbml document to test. 322 * <p> 323 * @return a boolean indicating whether the extension is actually being used 324 * byy the document. 325 * @internal 326 */ public 327 long getErrorIdOffset() { 328 return libsbmlJNI.FbcExtension_getErrorIdOffset(swigCPtr, this); 329 } 330 331}