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 ReplacedBy extends Replacing {
012   private long swigCPtr;
013
014   protected ReplacedBy(long cPtr, boolean cMemoryOwn)
015   {
016     super(libsbmlJNI.ReplacedBy_SWIGUpcast(cPtr), cMemoryOwn);
017     swigCPtr = cPtr;
018   }
019
020   protected static long getCPtr(ReplacedBy obj)
021   {
022     return (obj == null) ? 0 : obj.swigCPtr;
023   }
024
025   protected static long getCPtrAndDisown (ReplacedBy 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_ReplacedBy(swigCPtr);
047      }
048      swigCPtr = 0;
049    }
050    super.delete();
051  }
052
053  public ReplacedBy(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException {
054    this(libsbmlJNI.new_ReplacedBy__SWIG_0(level, version, pkgVersion), true);
055  }
056
057  public ReplacedBy(long level, long version) throws org.sbml.libsbml.SBMLConstructorException {
058    this(libsbmlJNI.new_ReplacedBy__SWIG_1(level, version), true);
059  }
060
061  public ReplacedBy(long level) throws org.sbml.libsbml.SBMLConstructorException {
062    this(libsbmlJNI.new_ReplacedBy__SWIG_2(level), true);
063  }
064
065  public ReplacedBy() throws org.sbml.libsbml.SBMLConstructorException {
066    this(libsbmlJNI.new_ReplacedBy__SWIG_3(), true);
067  }
068
069  public ReplacedBy(CompPkgNamespaces compns) throws org.sbml.libsbml.SBMLConstructorException {
070    this(libsbmlJNI.new_ReplacedBy__SWIG_4(CompPkgNamespaces.getCPtr(compns), compns), true);
071  }
072
073  public ReplacedBy(ReplacedBy source) throws org.sbml.libsbml.SBMLConstructorException {
074    this(libsbmlJNI.new_ReplacedBy__SWIG_5(ReplacedBy.getCPtr(source), source), true);
075  }
076
077  
078/**
079   * Creates and returns a deep copy of this {@link SBase} object.
080   * <p>
081   * @return a (deep) copy of this {@link SBase} object.
082   */ public
083 SBase cloneObject() {
084    long cPtr = libsbmlJNI.ReplacedBy_cloneObject(swigCPtr, this);
085    return (cPtr == 0) ? null : new ReplacedBy(cPtr, true);
086  }
087
088  
089/**
090   * Returns the XML element name of this object.
091   * <p>
092   * This is overridden by subclasses to return a string appropriate to the
093   * SBML component.  For example, {@link Model} defines it as returning 
094   * <code>'model'</code>, {@link CompartmentType} defines it as returning <code>'compartmentType'</code>,
095   * and so on.
096   */ public
097 String getElementName() {
098    return libsbmlJNI.ReplacedBy_getElementName(swigCPtr, this);
099  }
100
101  
102/**
103   * Returns the libSBML type code for this object.
104   * <p>
105   * This method may return the type code of this SBML object, or it may
106   * return {@link  libsbmlConstants#SBML_UNKNOWN SBML_UNKNOWN}.  This
107   * is because subclasses of {@link SBase} are not required to implement this
108   * method to return a type code.  This method is meant primarily for the
109   * LibSBML C interface, in which class and subclass information is not
110   * readily available.
111   * <p>
112   * @return the SBML object type code
113   * of this SBML object or
114   * {@link  libsbmlConstants#SBML_UNKNOWN SBML_UNKNOWN} (the default).
115   * <p>
116   * @see #getElementName()
117   * @see #getPackageName()
118   */ public
119 int getTypeCode() {
120    return libsbmlJNI.ReplacedBy_getTypeCode(swigCPtr, this);
121  }
122
123  
124/**
125   * Removes itself from its parent.  If the parent was storing it as a
126   * pointer, it is deleted.  If not, it is simply cleared (as in {@link ListOf}
127   * objects).  Pure virutal, as every {@link SBase} element has different parents,
128   * and therefore different methods of removing itself.  Will fail (and
129   * not delete itself) if it has no parent object.  This function is
130   * designed to be overridden, but for all objects whose parent is of the
131   * class {@link ListOf}, the default implementation will work.
132   * <p>
133   * @return integer value indicating success/failure of the
134   * function.   The possible values
135   * returned by this function are:
136   * <ul>
137   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS }
138   * <li> {@link  libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED }
139   * </ul>
140   */ public
141 int removeFromParentAndDelete() {
142    return libsbmlJNI.ReplacedBy_removeFromParentAndDelete(swigCPtr, this);
143  }
144
145  public int performReplacement() {
146    return libsbmlJNI.ReplacedBy_performReplacement(swigCPtr, this);
147  }
148
149  public boolean acceptComp(SWIGTYPE_p_CompVisitor v) {
150    return libsbmlJNI.ReplacedBy_acceptComp(swigCPtr, this, SWIGTYPE_p_CompVisitor.getCPtr(v));
151  }
152
153}