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 CompBase extends SBase { 012 private long swigCPtr; 013 014 protected CompBase(long cPtr, boolean cMemoryOwn) 015 { 016 super(libsbmlJNI.CompBase_SWIGUpcast(cPtr), cMemoryOwn); 017 swigCPtr = cPtr; 018 } 019 020 protected static long getCPtr(CompBase obj) 021 { 022 return (obj == null) ? 0 : obj.swigCPtr; 023 } 024 025 protected static long getCPtrAndDisown (CompBase 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_CompBase(swigCPtr); 047 } 048 swigCPtr = 0; 049 } 050 super.delete(); 051 } 052 053 public String getPackageURI() { 054 return libsbmlJNI.CompBase_getPackageURI(swigCPtr, this); 055 } 056 057 058/** 059 * Return the prefix of this element. 060 * @internal 061 */ public 062 String getPrefix() { 063 return libsbmlJNI.CompBase_getPrefix(swigCPtr, this); 064 } 065 066 067/** 068 * Returns the name of the SBML Level 3 package in which this 069 * element is defined. 070 * <p> 071 * @return the name of the SBML package in which this element is defined. 072 * The string <code>"core"</code> will be returned if this 073 * element is defined in SBML Level 3 Core. The string 074 * <code>"unknown"</code> will be returned if this element is 075 * not defined in any SBML package. 076 */ public 077 String getPackageName() { 078 return libsbmlJNI.CompBase_getPackageName(swigCPtr, this); 079 } 080 081 082/** 083 * Returns the Version of the SBML Level 3 package to which this 084 * element belongs to. 085 * <p> 086 * @return the version of the SBML Level 3 package to which this 087 * element belongs. The value <code>0</code> will be returned if this element 088 * belongs to the SBML Level 3 Core package. 089 * <p> 090 * @see #getLevel() 091 * @see #getVersion() 092 */ public 093 long getPackageVersion() { 094 return libsbmlJNI.CompBase_getPackageVersion(swigCPtr, this); 095 } 096 097 public static Model getParentModel(SBase child) { 098 long cPtr = libsbmlJNI.CompBase_getParentModel(SBase.getCPtr(child), child); 099 return (cPtr == 0) ? null : new Model(cPtr, false); 100 } 101 102}