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 CompSBMLDocumentPlugin extends SBMLDocumentPlugin {
012   private long swigCPtr;
013
014   protected CompSBMLDocumentPlugin(long cPtr, boolean cMemoryOwn)
015   {
016     super(libsbmlJNI.CompSBMLDocumentPlugin_SWIGUpcast(cPtr), cMemoryOwn);
017     swigCPtr = cPtr;
018   }
019
020   protected static long getCPtr(CompSBMLDocumentPlugin obj)
021   {
022     return (obj == null) ? 0 : obj.swigCPtr;
023   }
024
025   protected static long getCPtrAndDisown (CompSBMLDocumentPlugin 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_CompSBMLDocumentPlugin(swigCPtr);
047      }
048      swigCPtr = 0;
049    }
050    super.delete();
051  }
052
053  public CompSBMLDocumentPlugin(String uri, String prefix, CompPkgNamespaces compns) {
054    this(libsbmlJNI.new_CompSBMLDocumentPlugin__SWIG_0(uri, prefix, CompPkgNamespaces.getCPtr(compns), compns), true);
055  }
056
057  public CompSBMLDocumentPlugin(CompSBMLDocumentPlugin orig) {
058    this(libsbmlJNI.new_CompSBMLDocumentPlugin__SWIG_1(CompSBMLDocumentPlugin.getCPtr(orig), orig), true);
059  }
060
061  
062/**
063   * Creates and returns a deep copy of this {@link SBMLDocumentPlugin} object.
064   * <p>
065   * @return a (deep) copy of this object
066   */ public
067 SBasePlugin cloneObject() {
068    long cPtr = libsbmlJNI.CompSBMLDocumentPlugin_cloneObject(swigCPtr, this);
069    return (cPtr == 0) ? null : new CompSBMLDocumentPlugin(cPtr, true);
070  }
071
072  
073/**
074   * Returns the first child element found that has the given <code>id</code> in the model-wide SId namespace, or <code>null</code> if no such object is found.
075   * <p>
076   * @param id string representing the id of objects to find
077   * <p>
078   * @return pointer to the first element found with the given <code>id</code>.
079   */ public
080 SBase getElementBySId(String id) {
081  return libsbml.DowncastSBase(libsbmlJNI.CompSBMLDocumentPlugin_getElementBySId(swigCPtr, this, id), false);
082}
083
084  
085/**
086   * Returns the first child element it can find with the given <code>metaid</code>, or <code>null</code> if no such object is found.
087   * <p>
088   * @param metaid string representing the metaid of objects to find
089   * <p>
090   * @return pointer to the first element found with the given <code>metaid</code>.
091   */ public
092 SBase getElementByMetaId(String metaid) {
093  return libsbml.DowncastSBase(libsbmlJNI.CompSBMLDocumentPlugin_getElementByMetaId(swigCPtr, this, metaid), false);
094}
095
096  public SBase createObject(XMLInputStream stream) {
097  return libsbml.DowncastSBase(libsbmlJNI.CompSBMLDocumentPlugin_createObject(swigCPtr, this, XMLInputStream.getCPtr(stream), stream), false);
098}
099
100  
101/**
102   * Unsets the value of the 'required' attribute of this {@link SBMLDocumentPlugin}.
103   * <p>
104   * @return integer value indicating success/failure of the
105   * function.   The possible values
106   * returned by this function are:
107   * <ul>
108   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
109   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED }
110   * </ul>
111   * @internal
112   */ public
113 boolean isFlatteningImplemented() {
114    return libsbmlJNI.CompSBMLDocumentPlugin_isFlatteningImplemented(swigCPtr, this);
115  }
116
117  
118/**
119   * Unsets the value of the 'required' attribute of this {@link SBMLDocumentPlugin}.
120   * <p>
121   * @return integer value indicating success/failure of the
122   * function.   The possible values
123   * returned by this function are:
124   * <ul>
125   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
126   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED }
127   * </ul>
128   * @internal
129   */ public
130 long checkConsistency() {
131    return libsbmlJNI.CompSBMLDocumentPlugin_checkConsistency(swigCPtr, this);
132  }
133
134  public boolean acceptComp(SWIGTYPE_p_CompVisitor v) {
135    return libsbmlJNI.CompSBMLDocumentPlugin_acceptComp(swigCPtr, this, SWIGTYPE_p_CompVisitor.getCPtr(v));
136  }
137
138  public ListOfModelDefinitions getListOfModelDefinitions() {
139    long cPtr = libsbmlJNI.CompSBMLDocumentPlugin_getListOfModelDefinitions(swigCPtr, this);
140    return (cPtr == 0) ? null : new ListOfModelDefinitions(cPtr, false);
141  }
142
143  public ModelDefinition getModelDefinition(long n) {
144    long cPtr = libsbmlJNI.CompSBMLDocumentPlugin_getModelDefinition__SWIG_0(swigCPtr, this, n);
145    return (cPtr == 0) ? null : new ModelDefinition(cPtr, false);
146  }
147
148  public ModelDefinition getModelDefinition(String sid) {
149    long cPtr = libsbmlJNI.CompSBMLDocumentPlugin_getModelDefinition__SWIG_2(swigCPtr, this, sid);
150    return (cPtr == 0) ? null : new ModelDefinition(cPtr, false);
151  }
152
153  public int addModelDefinition(ModelDefinition modelDefinition) {
154    return libsbmlJNI.CompSBMLDocumentPlugin_addModelDefinition(swigCPtr, this, ModelDefinition.getCPtr(modelDefinition), modelDefinition);
155  }
156
157  public long getNumModelDefinitions() {
158    return libsbmlJNI.CompSBMLDocumentPlugin_getNumModelDefinitions(swigCPtr, this);
159  }
160
161  public ModelDefinition createModelDefinition() {
162    long cPtr = libsbmlJNI.CompSBMLDocumentPlugin_createModelDefinition(swigCPtr, this);
163    return (cPtr == 0) ? null : new ModelDefinition(cPtr, false);
164  }
165
166  public ModelDefinition removeModelDefinition(long index) {
167    long cPtr = libsbmlJNI.CompSBMLDocumentPlugin_removeModelDefinition__SWIG_0(swigCPtr, this, index);
168    return (cPtr == 0) ? null : new ModelDefinition(cPtr, false);
169  }
170
171  public ModelDefinition removeModelDefinition(String id) {
172    long cPtr = libsbmlJNI.CompSBMLDocumentPlugin_removeModelDefinition__SWIG_1(swigCPtr, this, id);
173    return (cPtr == 0) ? null : new ModelDefinition(cPtr, false);
174  }
175
176  public ListOfExternalModelDefinitions getListOfExternalModelDefinitions() {
177    long cPtr = libsbmlJNI.CompSBMLDocumentPlugin_getListOfExternalModelDefinitions(swigCPtr, this);
178    return (cPtr == 0) ? null : new ListOfExternalModelDefinitions(cPtr, false);
179  }
180
181  public ExternalModelDefinition getExternalModelDefinition(long n) {
182    long cPtr = libsbmlJNI.CompSBMLDocumentPlugin_getExternalModelDefinition__SWIG_0(swigCPtr, this, n);
183    return (cPtr == 0) ? null : new ExternalModelDefinition(cPtr, false);
184  }
185
186  public ExternalModelDefinition getExternalModelDefinition(String sid) {
187    long cPtr = libsbmlJNI.CompSBMLDocumentPlugin_getExternalModelDefinition__SWIG_2(swigCPtr, this, sid);
188    return (cPtr == 0) ? null : new ExternalModelDefinition(cPtr, false);
189  }
190
191  public SBase getModel(String sid) {
192  return libsbml.DowncastSBase(libsbmlJNI.CompSBMLDocumentPlugin_getModel__SWIG_0(swigCPtr, this, sid), false);
193}
194
195  public int addExternalModelDefinition(ExternalModelDefinition externalModelDefinition) {
196    return libsbmlJNI.CompSBMLDocumentPlugin_addExternalModelDefinition(swigCPtr, this, ExternalModelDefinition.getCPtr(externalModelDefinition), externalModelDefinition);
197  }
198
199  public long getNumExternalModelDefinitions() {
200    return libsbmlJNI.CompSBMLDocumentPlugin_getNumExternalModelDefinitions(swigCPtr, this);
201  }
202
203  public ExternalModelDefinition createExternalModelDefinition() {
204    long cPtr = libsbmlJNI.CompSBMLDocumentPlugin_createExternalModelDefinition(swigCPtr, this);
205    return (cPtr == 0) ? null : new ExternalModelDefinition(cPtr, false);
206  }
207
208  public ExternalModelDefinition removeExternalModelDefinition(long index) {
209    long cPtr = libsbmlJNI.CompSBMLDocumentPlugin_removeExternalModelDefinition__SWIG_0(swigCPtr, this, index);
210    return (cPtr == 0) ? null : new ExternalModelDefinition(cPtr, false);
211  }
212
213  public ExternalModelDefinition removeExternalModelDefinition(String id) {
214    long cPtr = libsbmlJNI.CompSBMLDocumentPlugin_removeExternalModelDefinition__SWIG_1(swigCPtr, this, id);
215    return (cPtr == 0) ? null : new ExternalModelDefinition(cPtr, false);
216  }
217
218  public void connectToChild() {
219    libsbmlJNI.CompSBMLDocumentPlugin_connectToChild(swigCPtr, this);
220  }
221
222  
223/**
224   * Sets the parent SBML object of this plugin object to
225   * this object and child elements (if any).
226   * (Creates a child-parent relationship by this plugin object)
227   * <p>
228   * This function is called when this object is created by
229   * the parent element.
230   * Subclasses must override this this function if they have one
231   * or more child elements. Also, {@link SBasePlugin#connectToParent(SBase sbase)}
232   * must be called in the overridden function.
233   * <p>
234   * @param sbase the {@link SBase} object to use
235   * <p>
236   * @see setSBMLDocument
237   * @see enablePackageInternal
238   * @internal
239   */ public
240 void connectToParent(SBase parent) {
241    libsbmlJNI.CompSBMLDocumentPlugin_connectToParent(swigCPtr, this, SBase.getCPtr(parent), parent);
242  }
243
244  
245/**
246   * Enables/Disables the given package with child elements in this plugin 
247   * object (if any).
248   * (This is an internal implementation invoked from 
249   *  {@link SBase#enablePackageInternal()} function)
250   * <p>
251   * Subclasses which contain one or more {@link SBase} derived elements should 
252   * override this function if elements defined in them can be extended by
253   * some other package extension.
254   * <p>
255   * @see setSBMLDocument
256   * @see connectToParent
257   * @internal
258   */ public
259 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) {
260    libsbmlJNI.CompSBMLDocumentPlugin_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag);
261  }
262
263}