001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 2.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 The core module of the 'qual' package extension. 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 public SBasePlugin DowncastSBasePlugin(long cPtr, boolean owner) 060 { 061 if (cPtr == 0) return null; 062 063 SBasePlugin sbp = new SBasePlugin(cPtr, false); 064 SBase sb = sbp.getParentSBMLObject(); 065 066 switch( sb.getTypeCode() ) 067 { 068 case (int) libsbml.SBML_MODEL: 069 return new QualModelPlugin(cPtr,owner); 070 default: 071 return new SBasePlugin(cPtr,owner); 072 } 073 } 074 075 public SBase DowncastSBase(long cPtr, boolean owner) 076 { 077 if (cPtr == 0) return null; 078 079 SBase sb = new SBase(cPtr, false); 080 switch( sb.getTypeCode() ) 081 { 082 case (int) libsbml.SBML_LIST_OF: 083 String name = sb.getElementName(); 084 if(name =="listOfFunctionTerms") 085 { 086 return new ListOfFunctionTerms(cPtr, owner); 087 } 088 else if(name =="listOfInputs") 089 { 090 return new ListOfInputs(cPtr, owner); 091 } 092 else if(name =="listOfOutputs") 093 { 094 return new ListOfOutputs(cPtr, owner); 095 } 096 else if(name =="listOfQualitativeSpecies") 097 { 098 return new ListOfQualitativeSpecies(cPtr, owner); 099 } 100 else if(name =="listOfTransitions") 101 { 102 return new ListOfTransitions(cPtr, owner); 103 } 104 105 return new ListOf(cPtr, owner); 106 107 case (int) libsbml.SBML_QUAL_QUALITATIVE_SPECIES: 108 return new QualitativeSpecies(cPtr, owner); 109 110 case (int) libsbml.SBML_QUAL_TRANSITION: 111 return new Transition(cPtr, owner); 112 113 case (int) libsbml.SBML_QUAL_INPUT: 114 return new Input(cPtr, owner); 115 116 case (int) libsbml.SBML_QUAL_OUTPUT: 117 return new Output(cPtr, owner); 118 119 case (int) libsbml.SBML_QUAL_FUNCTION_TERM: 120 return new FunctionTerm(cPtr, owner); 121 122 case (int) libsbml.SBML_QUAL_DEFAULT_TERM: 123 return new DefaultTerm(cPtr, owner); 124 125 default: 126 return new SBase(cPtr, owner); 127 } 128 } 129 130 131 132/** 133 * Returns the package name of this extension. 134 */ public 135 static String getPackageName() { 136 return libsbmlJNI.QualExtension_getPackageName(); 137 } 138 139 140/** 141 * Returns the default SBML Level this extension. 142 */ public 143 static long getDefaultLevel() { 144 return libsbmlJNI.QualExtension_getDefaultLevel(); 145 } 146 147 148/** 149 * Returns the default SBML Version this extension. 150 */ public 151 static long getDefaultVersion() { 152 return libsbmlJNI.QualExtension_getDefaultVersion(); 153 } 154 155 156/** 157 * Returns the default SBML version this extension. 158 */ public 159 static long getDefaultPackageVersion() { 160 return libsbmlJNI.QualExtension_getDefaultPackageVersion(); 161 } 162 163 164/** 165 * Returns URI of supported versions of this package. 166 */ public 167 static String getXmlnsL3V1V1() { 168 return libsbmlJNI.QualExtension_getXmlnsL3V1V1(); 169 } 170 171 172/** 173 * Constructor 174 */ public 175 QualExtension() { 176 this(libsbmlJNI.new_QualExtension__SWIG_0(), true); 177 } 178 179 180/** 181 * Copy constructor. 182 */ public 183 QualExtension(QualExtension orig) { 184 this(libsbmlJNI.new_QualExtension__SWIG_1(QualExtension.getCPtr(orig), orig), true); 185 } 186 187 188/** 189 * Creates and returns a deep copy of this {@link QualExtension} object. 190 <p> 191 * @return a (deep) copy of this {@link SBase} object 192 */ public 193 QualExtension cloneObject() { 194 long cPtr = libsbmlJNI.QualExtension_cloneObject(swigCPtr, this); 195 return (cPtr == 0) ? null : new QualExtension(cPtr, true); 196 } 197 198 199/** 200 * Returns the name of this package ('qual') 201 <p> 202 * @return a string representing the name of this package ('qual') 203 */ public 204 String getName() { 205 return libsbmlJNI.QualExtension_getName(swigCPtr, this); 206 } 207 208 209/** 210 * Returns the namespace URI corresponding to the combination of the given 211 * SBML Level, Version, and package version. 212 <p> 213 * @param sbmlLevel the level of SBML 214 * @param sbmlVersion the version of SBML 215 * @param pkgVersion the version of package 216 <p> 217 * @return a string of the package URI, or an empty string if no 218 * corresponding URI exists. 219 */ public 220 String getURI(long sbmlLevel, long sbmlVersion, long pkgVersion) { 221 return libsbmlJNI.QualExtension_getURI(swigCPtr, this, sbmlLevel, sbmlVersion, pkgVersion); 222 } 223 224 225/** 226 * Returns the SBML Level for the given URI of this package. 227 <p> 228 * @param uri the string of URI that represents one of versions of the 229 * “qual” package 230 <p> 231 * @return the SBML Level with the given URI of this package, or <code>0</code> if 232 * the given URI is invalid. 233 */ public 234 long getLevel(String uri) { 235 return libsbmlJNI.QualExtension_getLevel(swigCPtr, this, uri); 236 } 237 238 239/** 240 * Returns the SBML Version for the given URI of this package. 241 <p> 242 * @param uri the string of URI that represents one of versions of the 243 * “qual” package 244 <p> 245 * @return the SBML version with the given URI of this package, or <code>0</code> if 246 * the given URI is invalid. 247 */ public 248 long getVersion(String uri) { 249 return libsbmlJNI.QualExtension_getVersion(swigCPtr, this, uri); 250 } 251 252 253/** 254 * Returns the package version for the given URI of this package. 255 <p> 256 * @param uri the string of URI that represents one of versions of the 257 * “qual” package 258 <p> 259 * @return the package version with the given URI of this package, or <code>0</code> 260 * if the given URI is invalid. 261 */ public 262 long getPackageVersion(String uri) { 263 return libsbmlJNI.QualExtension_getPackageVersion(swigCPtr, this, uri); 264 } 265 266 267/** 268 * Returns an {@link QualPkgNamespaces} object. 269 <p> 270 * @param uri the string of URI that represents one of versions of the 271 * “qual” package 272 <p> 273 * @return an QualPkgNamespace object corresponding to the given <code>uri</code>, or 274 * <code>null</code> if the URI is not defined in the Hierarchical Model Qualosition 275 * package. 276 */ public 277 SBMLNamespaces getSBMLExtensionNamespaces(String uri) { 278 return libsbml.DowncastSBMLNamespaces(libsbmlJNI.QualExtension_getSBMLExtensionNamespaces(swigCPtr, this, uri), false); 279} 280 281 282/** 283 * Takes a type code of the “qual” package and returns a string 284 * describing the code. 285 */ public 286 String getStringFromTypeCode(int typeCode) { 287 return libsbmlJNI.QualExtension_getStringFromTypeCode(swigCPtr, this, typeCode); 288 } 289 290 291/** 292 * Initializes qual extension by creating an object of this class with 293 * required {@link SBasePlugin} derived objects and registering the object 294 * to the {@link SBMLExtensionRegistry} class. 295 <p> 296 * (NOTE) This function is automatically invoked when creating the following 297 * global object in {@link QualExtension}.cpp 298 <p> 299 * static SBMLExtensionRegister<{@link QualExtension}> qualExtensionRegistry; 300 <p> 301 * @internal 302 */ public 303 static void init() { 304 libsbmlJNI.QualExtension_init(); 305 } 306 307 308/** 309 * Return the entry in the error table at this index. 310 <p> 311 * @param index a long integergere representing the index of the error in the QualSBMLErrorTable 312 <p> 313 * @return packageErrorTableEntry object in the QualSBMLErrorTable corresponding to the index given. 314 * @internal 315 */ public 316 SWIGTYPE_p_packageErrorTableEntry getErrorTable(long index) { 317 return new SWIGTYPE_p_packageErrorTableEntry(libsbmlJNI.QualExtension_getErrorTable(swigCPtr, this, index), true); 318 } 319 320 321/** 322 * Return the index in the error table with the given errorId. 323 <p> 324 * @param errorId a long integergere representing the errorId of the error in the QualSBMLErrorTable 325 <p> 326 * @return longeger representing the index in the QualSBMLErrorTable corresponding to the errorId given. 327 * @internal 328 */ public 329 long getErrorTableIndex(long errorId) { 330 return libsbmlJNI.QualExtension_getErrorTableIndex(swigCPtr, this, errorId); 331 } 332 333 334/** 335 * Return the offset for the errorId range for the qual L3 package. 336 <p> 337 * @return longege representing the offset for errors QualSBMLErrorTable. 338 * @internal 339 */ public 340 long getErrorIdOffset() { 341 return libsbmlJNI.QualExtension_getErrorIdOffset(swigCPtr, this); 342 } 343 344}