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 * SBML converter for transforming documents from one 013 * Level+Version to another. 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. It is a class used in 018the implementation of extra functionality provided by libSBML. 019</p> 020 021 <p> 022 * This SBML converter takes an SBML document of one SBML Level+Version 023 * combination and attempts to convert it to another Level+Version combination. 024 * The target Level+Version is set using an SBMLNamespace object in the 025 * {@link ConversionProperties} object that controls this converter. 026 <p> 027 * This class is the basis for 028 * {@link SBMLDocument#setLevelAndVersion(long lev, long ver, boolean strict)}. 029 <p> 030 * @see SBMLFunctionDefinitionConverter 031 * @see SBMLInitialAssignmentConverter 032 * @see SBMLRuleConverter 033 * @see SBMLStripPackageConverter 034 * @see SBMLUnitsConverter 035 */ 036 037public class SBMLLevelVersionConverter extends SBMLConverter { 038 private long swigCPtr; 039 040 protected SBMLLevelVersionConverter(long cPtr, boolean cMemoryOwn) 041 { 042 super(libsbmlJNI.SBMLLevelVersionConverter_SWIGUpcast(cPtr), cMemoryOwn); 043 swigCPtr = cPtr; 044 } 045 046 protected static long getCPtr(SBMLLevelVersionConverter obj) 047 { 048 return (obj == null) ? 0 : obj.swigCPtr; 049 } 050 051 protected static long getCPtrAndDisown (SBMLLevelVersionConverter obj) 052 { 053 long ptr = 0; 054 055 if (obj != null) 056 { 057 ptr = obj.swigCPtr; 058 obj.swigCMemOwn = false; 059 } 060 061 return ptr; 062 } 063 064 protected void finalize() { 065 delete(); 066 } 067 068 public synchronized void delete() { 069 if (swigCPtr != 0) { 070 if (swigCMemOwn) { 071 swigCMemOwn = false; 072 libsbmlJNI.delete_SBMLLevelVersionConverter(swigCPtr); 073 } 074 swigCPtr = 0; 075 } 076 super.delete(); 077 } 078 079 public static void init() { 080 libsbmlJNI.SBMLLevelVersionConverter_init(); 081 } 082 083 084/** 085 * Creates a new {@link SBMLLevelVersionConverter} object. 086 */ public 087 SBMLLevelVersionConverter() { 088 this(libsbmlJNI.new_SBMLLevelVersionConverter__SWIG_0(), true); 089 } 090 091 092/** 093 * Copy constructor; creates a copy of an {@link SBMLLevelVersionConverter} 094 * object. 095 <p> 096 * @param obj the {@link SBMLLevelVersionConverter} object to copy. 097 */ public 098 SBMLLevelVersionConverter(SBMLLevelVersionConverter obj) { 099 this(libsbmlJNI.new_SBMLLevelVersionConverter__SWIG_1(SBMLLevelVersionConverter.getCPtr(obj), obj), true); 100 } 101 102 103/** 104 * Creates and returns a deep copy of this {@link SBMLConverter} object. 105 <p> 106 * @return a (deep) copy of this {@link SBMLConverter} object. 107 */ public 108 SBMLConverter cloneObject() { 109 long cPtr = libsbmlJNI.SBMLLevelVersionConverter_cloneObject(swigCPtr, this); 110 return (cPtr == 0) ? null : new SBMLLevelVersionConverter(cPtr, true); 111 } 112 113 114/** 115 * Predicate returning <code>true</code> if this converter's properties matches a 116 * given set of configuration properties. 117 <p> 118 * @param props the configuration properties to match. 119 <p> 120 * @return <code>true</code> if this converter's properties match, <code>false</code> 121 * otherwise. 122 */ public 123 boolean matchesProperties(ConversionProperties props) { 124 return libsbmlJNI.SBMLLevelVersionConverter_matchesProperties(swigCPtr, this, ConversionProperties.getCPtr(props), props); 125 } 126 127 128/** 129 * Perform the conversion. 130 <p> 131 * This method causes the converter to do the actual conversion work, 132 * that is, to convert the {@link SBMLDocument} object set by 133 * {@link SBMLConverter#setDocument(SBMLDocument doc)} and 134 * with the configuration options set by 135 * {@link SBMLConverter#setProperties(ConversionProperties props)}. 136 <p> 137 * @return integer value indicating the success/failure of the operation. 138 * The set of possible values that may 139 * be returned depends on the converter subclass; please consult 140 * the documentation for the relevant class to find out what the 141 * possibilities are. 142 */ public 143 int convert() { 144 return libsbmlJNI.SBMLLevelVersionConverter_convert(swigCPtr, this); 145 } 146 147 148/** 149 * Returns the default properties of this converter. 150 <p> 151 * A given converter exposes one or more properties that can be adjusted 152 * in order to influence the behavior of the converter. This method 153 * returns the <em>default</em> property settings for this converter. It is 154 * meant to be called in order to discover all the settings for the 155 * converter object. The run-time properties of the converter object can 156 * be adjusted by using the method 157 * {@link SBMLConverter#setProperties(ConversionProperties props)}. 158 <p> 159 * @return the default properties for the converter. 160 <p> 161 * @see #setProperties(ConversionProperties props) 162 * @see #matchesProperties(ConversionProperties props) 163 */ public 164 ConversionProperties getDefaultProperties() { 165 return new ConversionProperties(libsbmlJNI.SBMLLevelVersionConverter_getDefaultProperties(swigCPtr, this), true); 166 } 167 168 169/** 170 * Returns the target SBML Level for the conversion. 171 <p> 172 * @return an integer indicating the SBML Level. 173 */ public 174 long getTargetLevel() { 175 return libsbmlJNI.SBMLLevelVersionConverter_getTargetLevel(swigCPtr, this); 176 } 177 178 179/** 180 * Returns the target SBML Version for the conversion. 181 <p> 182 * @return an integer indicating the Version within the SBML Level. 183 */ public 184 long getTargetVersion() { 185 return libsbmlJNI.SBMLLevelVersionConverter_getTargetVersion(swigCPtr, this); 186 } 187 188 189/** 190 * Returns the flag indicating whether the conversion has been set to 'strict'. 191 <p> 192 * @return <code>true</code> if strict validity has been requested, <code>false</code> 193 * otherwise. 194 */ public 195 boolean getValidityFlag() { 196 return libsbmlJNI.SBMLLevelVersionConverter_getValidityFlag(swigCPtr, this); 197 } 198 199}