001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 3.0.12 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-qual"><a href="group__qual.html">qual</a></span> 013 014 Base extension class for the package. 015 */ 016 017public class QualExtension extends SBMLExtension { 018 private long swigCPtr; 019 020 protected QualExtension(long cPtr, boolean cMemoryOwn) 021 { 022 super(libsbmlJNI.QualExtension_SWIGUpcast(cPtr), cMemoryOwn); 023 swigCPtr = cPtr; 024 } 025 026 protected static long getCPtr(QualExtension obj) 027 { 028 return (obj == null) ? 0 : obj.swigCPtr; 029 } 030 031 protected static long getCPtrAndDisown (QualExtension obj) 032 { 033 long ptr = 0; 034 035 if (obj != null) 036 { 037 ptr = obj.swigCPtr; 038 obj.swigCMemOwn = false; 039 } 040 041 return ptr; 042 } 043 044 protected void finalize() { 045 delete(); 046 } 047 048 public synchronized void delete() { 049 if (swigCPtr != 0) { 050 if (swigCMemOwn) { 051 swigCMemOwn = false; 052 libsbmlJNI.delete_QualExtension(swigCPtr); 053 } 054 swigCPtr = 0; 055 } 056 super.delete(); 057 } 058 059 /** 060 * @internal 061 */ 062 public SBasePlugin DowncastSBasePlugin(long cPtr, boolean owner) 063 { 064 if (cPtr == 0) return null; 065 066 SBasePlugin sbp = new SBasePlugin(cPtr, false); 067 SBase sb = sbp.getParentSBMLObject(); 068 069 if (sb instanceof Model) 070 { 071 return new QualModelPlugin(cPtr, owner); 072 } 073 074 switch( sb.getTypeCode() ) 075 { 076 case (int) libsbml.SBML_MODEL: 077 return new QualModelPlugin(cPtr,owner); 078 default: 079 return new SBasePlugin(cPtr,owner); 080 } 081 } 082 083 /** 084 * @internal 085 */ 086 public SBase DowncastSBase(long cPtr, boolean owner) 087 { 088 if (cPtr == 0) return null; 089 090 SBase sb = new SBase(cPtr, false); 091 switch( sb.getTypeCode() ) 092 { 093 case (int) libsbml.SBML_LIST_OF: 094 String name = sb.getElementName(); 095 if(name =="listOfFunctionTerms") 096 { 097 return new ListOfFunctionTerms(cPtr, owner); 098 } 099 else if(name =="listOfInputs") 100 { 101 return new ListOfInputs(cPtr, owner); 102 } 103 else if(name =="listOfOutputs") 104 { 105 return new ListOfOutputs(cPtr, owner); 106 } 107 else if(name =="listOfQualitativeSpecies") 108 { 109 return new ListOfQualitativeSpecies(cPtr, owner); 110 } 111 else if(name =="listOfTransitions") 112 { 113 return new ListOfTransitions(cPtr, owner); 114 } 115 116 return new ListOf(cPtr, owner); 117 118 case (int) libsbml.SBML_QUAL_QUALITATIVE_SPECIES: 119 return new QualitativeSpecies(cPtr, owner); 120 121 case (int) libsbml.SBML_QUAL_TRANSITION: 122 return new Transition(cPtr, owner); 123 124 case (int) libsbml.SBML_QUAL_INPUT: 125 return new Input(cPtr, owner); 126 127 case (int) libsbml.SBML_QUAL_OUTPUT: 128 return new Output(cPtr, owner); 129 130 case (int) libsbml.SBML_QUAL_FUNCTION_TERM: 131 return new FunctionTerm(cPtr, owner); 132 133 case (int) libsbml.SBML_QUAL_DEFAULT_TERM: 134 return new DefaultTerm(cPtr, owner); 135 136 default: 137 return new SBase(cPtr, owner); 138 } 139 } 140 141 142 143/** 144 * Returns the nickname of the SBML Level 3 package implemented by 145 * this libSBML extension. 146 <p> 147 * @return the package nickname, as a string. 148 <p> 149 * 150 */ public 151 static String getPackageName() { 152 return libsbmlJNI.QualExtension_getPackageName(); 153 } 154 155 156/** 157 * Returns the default SBML Level used by this libSBML package extension. 158 <p> 159 * @return the SBML Level. 160 <p> 161 * 162 */ public 163 static long getDefaultLevel() { 164 return libsbmlJNI.QualExtension_getDefaultLevel(); 165 } 166 167 168/** 169 * Returns the default SBML Version used by this libSBML package extension. 170 <p> 171 * @return the Version within the default SBML Level. 172 <p> 173 * 174 */ public 175 static long getDefaultVersion() { 176 return libsbmlJNI.QualExtension_getDefaultVersion(); 177 } 178 179 180/** 181 * Returns the default version of the SBML Level 3 package implemented 182 * by this libSBML extension. 183 <p> 184 * @return the default version number of the SBML Level 3 package 185 * definition. 186 <p> 187 * 188 */ public 189 static long getDefaultPackageVersion() { 190 return libsbmlJNI.QualExtension_getDefaultPackageVersion(); 191 } 192 193 194/** 195 * Returns the XML namespace URI of the SBML Level 3 package 196 * implemented by this libSBML extension. 197 <p> 198 * @return the XML namespace as a string. 199 <p> 200 * 201 */ public 202 static String getXmlnsL3V1V1() { 203 return libsbmlJNI.QualExtension_getXmlnsL3V1V1(); 204 } 205 206 207/** 208 * Creates a new {@link QualExtension} instance. 209 */ public 210 QualExtension() { 211 this(libsbmlJNI.new_QualExtension__SWIG_0(), true); 212 } 213 214 215/** 216 * Copy constructor. 217 <p> 218 * @param orig the instance to copy. 219 */ public 220 QualExtension(QualExtension orig) { 221 this(libsbmlJNI.new_QualExtension__SWIG_1(QualExtension.getCPtr(orig), orig), true); 222 } 223 224 225/** 226 * Creates and returns a deep copy of this {@link QualExtension} object. 227 <p> 228 * @return a (deep) copy of this {@link SBase} object. 229 */ public 230 QualExtension cloneObject() { 231 long cPtr = libsbmlJNI.QualExtension_cloneObject(swigCPtr, this); 232 return (cPtr == 0) ? null : new QualExtension(cPtr, true); 233 } 234 235 236/** 237 * Returns the name of this package ('qual') 238 <p> 239 * @return a string representing the name of this package ('qual'). 240 */ public 241 String getName() { 242 return libsbmlJNI.QualExtension_getName(swigCPtr, this); 243 } 244 245 246/** 247 * Returns a string representing the SBML XML namespace of this SBML 248 * Level 3 package. 249 <p> 250 * The namespace URI constructed by this method corresponds to the 251 * combination of the Level and Version of SBML, and the Version of the SBML 252 * Level 3 package. (At the time of this writing, the only SBML Level 253 * that supports packages is Level 3, so the value of <code>sbmlLevel</code> must 254 * necessarily always be <code>3</code>.) 255 <p> 256 * @param sbmlLevel the level of SBML. 257 * @param sbmlVersion the version of SBML. 258 * @param pkgVersion the version of the package. 259 <p> 260 * @return a string of the package URI, or an empty string if no 261 * corresponding URI exists. 262 */ public 263 String getURI(long sbmlLevel, long sbmlVersion, long pkgVersion) { 264 return libsbmlJNI.QualExtension_getURI(swigCPtr, this, sbmlLevel, sbmlVersion, pkgVersion); 265 } 266 267 268/** 269 * Returns the SBML Level for the given URI of this package. 270 <p> 271 * @param uri a URI that represents a version of this package. 272 <p> 273 * @return the SBML Level for the given URI of this package, or <code>0</code> if the 274 * given URI is invalid, or for a different package. 275 */ public 276 long getLevel(String uri) { 277 return libsbmlJNI.QualExtension_getLevel(swigCPtr, this, uri); 278 } 279 280 281/** 282 * Returns the Version within the SBML Level for the given URI of this 283 * package. 284 <p> 285 * @param uri a URI that represents a version of this package. 286 <p> 287 * @return the SBML Version within the SBML Level for the given URI of this 288 * package, or <code>0</code> if the given URI is invalid, or for a different package. 289 */ public 290 long getVersion(String uri) { 291 return libsbmlJNI.QualExtension_getVersion(swigCPtr, this, uri); 292 } 293 294 295/** 296 * Returns the SBML Level 3 package version for the given URI of this 297 * package. 298 <p> 299 * @param uri a URI that represents one of the valid versions of this 300 * package. 301 <p> 302 * @return the version of the SBML Level 3 package with the given URI, 303 * or <code>0</code> if the given URI is invalid, or for a different package. 304 */ public 305 long getPackageVersion(String uri) { 306 return libsbmlJNI.QualExtension_getPackageVersion(swigCPtr, this, uri); 307 } 308 309 310/** 311 * Returns an {@link QualPkgNamespaces} object. 312 <p> 313 * @param uri a URI that represents one of the valid versions of the 314 * “qual” package. 315 <p> 316 * @return an QualPkgNamespace object corresponding to the given <code>uri</code>, or 317 * <code>null</code> if the URI is not defined in the Qual 318 * package. 319 */ public 320 SBMLNamespaces getSBMLExtensionNamespaces(String uri) { 321 return libsbml.DowncastSBMLNamespaces(libsbmlJNI.QualExtension_getSBMLExtensionNamespaces(swigCPtr, this, uri), false); 322} 323 324 325/** 326 * Takes a type code of the “qual” package and returns a string 327 * describing the code. 328 <p> 329 * @param typeCode a libSBML type code defined by the libSBML extension 330 * implementing support for the SBML Level 3 “qual” package. 331 <p> 332 * @return a text string representing the type code given by <code>typeCode</code>. 333 * If the type code is unrecognized for this implementation of the libSBML 334 * “qual” package, the string returned will be 335 * <code>'(Unknown SBML Qual Type)'</code>. 336 */ public 337 String getStringFromTypeCode(int typeCode) { 338 return libsbmlJNI.QualExtension_getStringFromTypeCode(swigCPtr, this, typeCode); 339 } 340 341 342/** * @internal */ public 343 static void init() { 344 libsbmlJNI.QualExtension_init(); 345 } 346 347 348/** * @internal */ public 349 SWIGTYPE_p_packageErrorTableEntry getErrorTable(long index) { 350 return new SWIGTYPE_p_packageErrorTableEntry(libsbmlJNI.QualExtension_getErrorTable(swigCPtr, this, index), true); 351 } 352 353 354/** * @internal */ public 355 long getErrorTableIndex(long errorId) { 356 return libsbmlJNI.QualExtension_getErrorTableIndex(swigCPtr, this, errorId); 357 } 358 359 360/** * @internal */ public 361 long getErrorIdOffset() { 362 return libsbmlJNI.QualExtension_getErrorIdOffset(swigCPtr, this); 363 } 364 365}