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-comp"><a href="group__comp.html">comp</a></span> 013 Convenience class for {@link SBase}-derived classes. 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 <p> 023 * The {@link CompBase} class derives from {@link SBase}, and defines a few functions and 024 * features common to all {@link SBase}-derived classes in the SBML Level 3 025 * <a href='../../../extensions-summary.html#comp'>Hierarchical Model Composition</a> (“comp”) package. 026 */ 027 028public class CompBase extends SBase { 029 private long swigCPtr; 030 031 protected CompBase(long cPtr, boolean cMemoryOwn) 032 { 033 super(libsbmlJNI.CompBase_SWIGUpcast(cPtr), cMemoryOwn); 034 swigCPtr = cPtr; 035 } 036 037 protected static long getCPtr(CompBase obj) 038 { 039 return (obj == null) ? 0 : obj.swigCPtr; 040 } 041 042 protected static long getCPtrAndDisown (CompBase obj) 043 { 044 long ptr = 0; 045 046 if (obj != null) 047 { 048 ptr = obj.swigCPtr; 049 obj.swigCMemOwn = false; 050 } 051 052 return ptr; 053 } 054 055 protected void finalize() { 056 delete(); 057 } 058 059 public synchronized void delete() { 060 if (swigCPtr != 0) { 061 if (swigCMemOwn) { 062 swigCMemOwn = false; 063 libsbmlJNI.delete_CompBase(swigCPtr); 064 } 065 swigCPtr = 0; 066 } 067 super.delete(); 068 } 069 070 071/** 072 * Returns the XML namespace (URI) of the package extension 073 * of this object. 074 <p> 075 * @return the URI of the package extension of this plugin object. 076 */ public 077 String getPackageURI() { 078 return libsbmlJNI.CompBase_getPackageURI(swigCPtr, this); 079 } 080 081 082/** 083 * Returns the package name of this plugin object. 084 <p> 085 * @return the package name of this plugin object. 086 */ public 087 String getPackageName() { 088 return libsbmlJNI.CompBase_getPackageName(swigCPtr, this); 089 } 090 091 092/** 093 * Returns the package version of the package extension of 094 * this plugin object. 095 <p> 096 * @return the package version of the package extension of 097 * this plugin object. 098 */ public 099 long getPackageVersion() { 100 return libsbmlJNI.CompBase_getPackageVersion(swigCPtr, this); 101 } 102 103 104/** 105 * Returns the {@link Model} object to which the referenced child object belongs. 106 */ public 107 static Model getParentModel(SBase child) { 108 long cPtr = libsbmlJNI.CompBase_getParentModel(SBase.getCPtr(child), child); 109 return (cPtr == 0) ? null : new Model(cPtr, false); 110 } 111 112}