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 ModelDefinition extends Model { 012 private long swigCPtr; 013 014 protected ModelDefinition(long cPtr, boolean cMemoryOwn) 015 { 016 super(libsbmlJNI.ModelDefinition_SWIGUpcast(cPtr), cMemoryOwn); 017 swigCPtr = cPtr; 018 } 019 020 protected static long getCPtr(ModelDefinition obj) 021 { 022 return (obj == null) ? 0 : obj.swigCPtr; 023 } 024 025 protected static long getCPtrAndDisown (ModelDefinition 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_ModelDefinition(swigCPtr); 047 } 048 swigCPtr = 0; 049 } 050 super.delete(); 051 } 052 053 public ModelDefinition(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 054 this(libsbmlJNI.new_ModelDefinition__SWIG_0(level, version, pkgVersion), true); 055 } 056 057 public ModelDefinition(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 058 this(libsbmlJNI.new_ModelDefinition__SWIG_1(level, version), true); 059 } 060 061 public ModelDefinition(long level) throws org.sbml.libsbml.SBMLConstructorException { 062 this(libsbmlJNI.new_ModelDefinition__SWIG_2(level), true); 063 } 064 065 public ModelDefinition() throws org.sbml.libsbml.SBMLConstructorException { 066 this(libsbmlJNI.new_ModelDefinition__SWIG_3(), true); 067 } 068 069 public ModelDefinition(CompPkgNamespaces compns) throws org.sbml.libsbml.SBMLConstructorException { 070 this(libsbmlJNI.new_ModelDefinition__SWIG_4(CompPkgNamespaces.getCPtr(compns), compns), true); 071 } 072 073 public ModelDefinition(Model source) throws org.sbml.libsbml.SBMLConstructorException { 074 this(libsbmlJNI.new_ModelDefinition__SWIG_5(Model.getCPtr(source), source), true); 075 } 076 077 078/** 079 * Creates and returns a deep copy of this {@link Model} object. 080 * <p> 081 * @return a (deep) copy of this {@link Model}. 082 */ public 083 ModelDefinition cloneObject() { 084 long cPtr = libsbmlJNI.ModelDefinition_cloneObject(swigCPtr, this); 085 return (cPtr == 0) ? null : new ModelDefinition(cPtr, true); 086 } 087 088 089/** 090 * Returns the XML element name of this object, which for {@link Model}, is 091 * always <code>'model'.</code> 092 * <p> 093 * @return the name of this element, i.e., <code>'model'.</code> 094 */ public 095 String getElementName() { 096 return libsbmlJNI.ModelDefinition_getElementName(swigCPtr, this); 097 } 098 099 100/** 101 * Returns the libSBML type code for this SBML object. 102 * <p> 103 * LibSBML attaches an identifying code to every 104 * kind of SBML object. These are known as <em>SBML type codes</em>. In 105 * other languages, the set of type codes is stored in an enumeration; in 106 * the Java language interface for libSBML, the type codes are defined as 107 * static integer constants in the interface class {@link 108 * libsbmlConstants}. The names of the type codes all begin with the 109 * characters <code>SBML_.</code> 110 * <p> 111 * @return the SBML type code for this object, or 112 * {@link libsbmlConstants#SBML_UNKNOWN SBML_UNKNOWN} (default). 113 * <p> 114 * @see #getElementName() 115 */ public 116 int getTypeCode() { 117 return libsbmlJNI.ModelDefinition_getTypeCode(swigCPtr, this); 118 } 119 120 121/** 122 * Finds this {@link Model}'s parent {@link SBMLDocument} and calls setModel(null) on it, 123 * indirectly deleting itself. Overridden from the {@link SBase} function since 124 * the parent is not a {@link ListOf}. 125 * <p> 126 * @return integer value indicating success/failure of the 127 * function. The possible values 128 * returned by this function are: 129 * <ul> 130 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 131 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 132 * </ul> 133 */ public 134 int removeFromParentAndDelete() { 135 return libsbmlJNI.ModelDefinition_removeFromParentAndDelete(swigCPtr, this); 136 } 137 138 public boolean acceptComp(SWIGTYPE_p_CompVisitor v) { 139 return libsbmlJNI.ModelDefinition_acceptComp(swigCPtr, this, SWIGTYPE_p_CompVisitor.getCPtr(v)); 140 } 141 142}