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