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 011/** 012 * 013 * SBML converter for removing packages. 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 and removes (strips) a package 023 * from it. No conversion is performed; the package constructs are simply 024 * removed from the SBML document. The package to be stripped is determined 025 * by the value of the option 'package' on the conversion properties. 026 * <p> 027 * @see SBMLFunctionDefinitionConverter 028 * @see SBMLLevelVersionConverter 029 * @see SBMLRuleConverter 030 * @see SBMLLevelVersionConverter 031 * @see SBMLUnitsConverter 032 */ 033 034public class SBMLStripPackageConverter extends SBMLConverter { 035 private long swigCPtr; 036 037 protected SBMLStripPackageConverter(long cPtr, boolean cMemoryOwn) 038 { 039 super(libsbmlJNI.SBMLStripPackageConverter_SWIGUpcast(cPtr), cMemoryOwn); 040 swigCPtr = cPtr; 041 } 042 043 protected static long getCPtr(SBMLStripPackageConverter obj) 044 { 045 return (obj == null) ? 0 : obj.swigCPtr; 046 } 047 048 protected static long getCPtrAndDisown (SBMLStripPackageConverter obj) 049 { 050 long ptr = 0; 051 052 if (obj != null) 053 { 054 ptr = obj.swigCPtr; 055 obj.swigCMemOwn = false; 056 } 057 058 return ptr; 059 } 060 061 protected void finalize() { 062 delete(); 063 } 064 065 public synchronized void delete() { 066 if (swigCPtr != 0) { 067 if (swigCMemOwn) { 068 swigCMemOwn = false; 069 libsbmlJNI.delete_SBMLStripPackageConverter(swigCPtr); 070 } 071 swigCPtr = 0; 072 } 073 super.delete(); 074 } 075 076 public static void init() { 077 libsbmlJNI.SBMLStripPackageConverter_init(); 078 } 079 080 081/** 082 * Creates a new {@link SBMLStripPackageConverter} object. 083 */ public 084 SBMLStripPackageConverter() { 085 this(libsbmlJNI.new_SBMLStripPackageConverter__SWIG_0(), true); 086 } 087 088 089/** 090 * Copy constructor; creates a copy of an {@link SBMLStripPackageConverter} 091 * object. 092 * <p> 093 * @param obj the {@link SBMLStripPackageConverter} object to copy. 094 */ public 095 SBMLStripPackageConverter(SBMLStripPackageConverter obj) { 096 this(libsbmlJNI.new_SBMLStripPackageConverter__SWIG_1(SBMLStripPackageConverter.getCPtr(obj), obj), true); 097 } 098 099 100/** 101 * Creates and returns a deep copy of this {@link SBMLStripPackageConverter} 102 * object. 103 * <p> 104 * @return a (deep) copy of this converter. 105 */ public 106 SBMLConverter cloneObject() { 107 long cPtr = libsbmlJNI.SBMLStripPackageConverter_cloneObject(swigCPtr, this); 108 return (cPtr == 0) ? null : new SBMLStripPackageConverter(cPtr, true); 109 } 110 111 112/** 113 * Returns <code>true</code> if this converter object's properties match the given 114 * properties. 115 * <p> 116 * A typical use of this method involves creating a {@link ConversionProperties} 117 * object, setting the options desired, and then calling this method on 118 * an {@link SBMLStripPackageConverter} object to find out if the object's 119 * property values match the given ones. This method is also used by 120 * {@link SBMLConverterRegistry#getConverterFor(ConversionProperties props)} 121 * to search across all registered converters for one matching particular 122 * properties. 123 * <p> 124 * @param props the properties to match. 125 * <p> 126 * @return <code>true</code> if this converter's properties match, <code>false</code> 127 * otherwise. 128 */ public 129 boolean matchesProperties(ConversionProperties props) { 130 return libsbmlJNI.SBMLStripPackageConverter_matchesProperties(swigCPtr, this, ConversionProperties.getCPtr(props), props); 131 } 132 133 134/** 135 * Perform the conversion. 136 * <p> 137 * This method causes the converter to do the actual conversion work, 138 * that is, to convert the {@link SBMLDocument} object set by 139 * {@link SBMLConverter#setDocument(SBMLDocument doc)} and 140 * with the configuration options set by 141 * {@link SBMLConverter#setProperties(ConversionProperties props)}. 142 * <p> 143 * @return integer value indicating the success/failure of the operation. 144 * The possible values are: 145 * <ul> 146 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 147 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 148 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE } 149 * </ul> 150 */ public 151 int convert() { 152 return libsbmlJNI.SBMLStripPackageConverter_convert(swigCPtr, this); 153 } 154 155 156/** 157 * Returns the default properties of this converter. 158 * <p> 159 * A given converter exposes one or more properties that can be adjusted 160 * in order to influence the behavior of the converter. This method 161 * returns the <em>default</em> property settings for this converter. It is 162 * meant to be called in order to discover all the settings for the 163 * converter object. 164 * <p> 165 * @return the {@link ConversionProperties} object describing the default properties 166 * for this converter. 167 */ public 168 ConversionProperties getDefaultProperties() { 169 return new ConversionProperties(libsbmlJNI.SBMLStripPackageConverter_getDefaultProperties(swigCPtr, this), true); 170 } 171 172}