1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199
|
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 2.0.4
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package org.sbml.libsbml;
/**
* SBML converter for transforming documents from one
* Level+Version to another.
<p>
* <p style='color: #777; font-style: italic'>
This class of objects is defined by libSBML only and has no direct
equivalent in terms of SBML components. It is a class used in
the implementation of extra functionality provided by libSBML.
</p>
<p>
* This SBML converter takes an SBML document of one SBML Level+Version
* combination and attempts to convert it to another Level+Version combination.
* The target Level+Version is set using an SBMLNamespace object in the
* {@link ConversionProperties} object that controls this converter.
<p>
* This class is the basis for
* {@link SBMLDocument#setLevelAndVersion(long lev, long ver, boolean strict)}.
<p>
* @see SBMLFunctionDefinitionConverter
* @see SBMLInitialAssignmentConverter
* @see SBMLRuleConverter
* @see SBMLStripPackageConverter
* @see SBMLUnitsConverter
*/
public class SBMLLevelVersionConverter extends SBMLConverter {
private long swigCPtr;
protected SBMLLevelVersionConverter(long cPtr, boolean cMemoryOwn)
{
super(libsbmlJNI.SBMLLevelVersionConverter_SWIGUpcast(cPtr), cMemoryOwn);
swigCPtr = cPtr;
}
protected static long getCPtr(SBMLLevelVersionConverter obj)
{
return (obj == null) ? 0 : obj.swigCPtr;
}
protected static long getCPtrAndDisown (SBMLLevelVersionConverter obj)
{
long ptr = 0;
if (obj != null)
{
ptr = obj.swigCPtr;
obj.swigCMemOwn = false;
}
return ptr;
}
protected void finalize() {
delete();
}
public synchronized void delete() {
if (swigCPtr != 0) {
if (swigCMemOwn) {
swigCMemOwn = false;
libsbmlJNI.delete_SBMLLevelVersionConverter(swigCPtr);
}
swigCPtr = 0;
}
super.delete();
}
public static void init() {
libsbmlJNI.SBMLLevelVersionConverter_init();
}
/**
* Creates a new {@link SBMLLevelVersionConverter} object.
*/ public
SBMLLevelVersionConverter() {
this(libsbmlJNI.new_SBMLLevelVersionConverter__SWIG_0(), true);
}
/**
* Copy constructor; creates a copy of an {@link SBMLLevelVersionConverter}
* object.
<p>
* @param obj the {@link SBMLLevelVersionConverter} object to copy.
*/ public
SBMLLevelVersionConverter(SBMLLevelVersionConverter obj) {
this(libsbmlJNI.new_SBMLLevelVersionConverter__SWIG_1(SBMLLevelVersionConverter.getCPtr(obj), obj), true);
}
/**
* Creates and returns a deep copy of this {@link SBMLConverter} object.
<p>
* @return a (deep) copy of this {@link SBMLConverter} object.
*/ public
SBMLConverter cloneObject() {
long cPtr = libsbmlJNI.SBMLLevelVersionConverter_cloneObject(swigCPtr, this);
return (cPtr == 0) ? null : new SBMLLevelVersionConverter(cPtr, true);
}
/**
* Predicate returning <code>true</code> if this converter's properties matches a
* given set of configuration properties.
<p>
* @param props the configuration properties to match.
<p>
* @return <code>true</code> if this converter's properties match, <code>false</code>
* otherwise.
*/ public
boolean matchesProperties(ConversionProperties props) {
return libsbmlJNI.SBMLLevelVersionConverter_matchesProperties(swigCPtr, this, ConversionProperties.getCPtr(props), props);
}
/**
* Perform the conversion.
<p>
* This method causes the converter to do the actual conversion work,
* that is, to convert the {@link SBMLDocument} object set by
* {@link SBMLConverter#setDocument(SBMLDocument doc)} and
* with the configuration options set by
* {@link SBMLConverter#setProperties(ConversionProperties props)}.
<p>
* @return integer value indicating the success/failure of the operation.
* The set of possible values that may
* be returned depends on the converter subclass; please consult
* the documentation for the relevant class to find out what the
* possibilities are.
*/ public
int convert() {
return libsbmlJNI.SBMLLevelVersionConverter_convert(swigCPtr, this);
}
/**
* Returns the default properties of this converter.
<p>
* A given converter exposes one or more properties that can be adjusted
* in order to influence the behavior of the converter. This method
* returns the <em>default</em> property settings for this converter. It is
* meant to be called in order to discover all the settings for the
* converter object. The run-time properties of the converter object can
* be adjusted by using the method
* {@link SBMLConverter#setProperties(ConversionProperties props)}.
<p>
* @return the default properties for the converter.
<p>
* @see #setProperties(ConversionProperties props)
* @see #matchesProperties(ConversionProperties props)
*/ public
ConversionProperties getDefaultProperties() {
return new ConversionProperties(libsbmlJNI.SBMLLevelVersionConverter_getDefaultProperties(swigCPtr, this), true);
}
/**
* Returns the target SBML Level for the conversion.
<p>
* @return an integer indicating the SBML Level.
*/ public
long getTargetLevel() {
return libsbmlJNI.SBMLLevelVersionConverter_getTargetLevel(swigCPtr, this);
}
/**
* Returns the target SBML Version for the conversion.
<p>
* @return an integer indicating the Version within the SBML Level.
*/ public
long getTargetVersion() {
return libsbmlJNI.SBMLLevelVersionConverter_getTargetVersion(swigCPtr, this);
}
/**
* Returns the flag indicating whether the conversion has been set to 'strict'.
<p>
* @return <code>true</code> if strict validity has been requested, <code>false</code>
* otherwise.
*/ public
boolean getValidityFlag() {
return libsbmlJNI.SBMLLevelVersionConverter_getValidityFlag(swigCPtr, this);
}
}
|