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 ReplacedElement extends Replacing { 012 private long swigCPtr; 013 014 protected ReplacedElement(long cPtr, boolean cMemoryOwn) 015 { 016 super(libsbmlJNI.ReplacedElement_SWIGUpcast(cPtr), cMemoryOwn); 017 swigCPtr = cPtr; 018 } 019 020 protected static long getCPtr(ReplacedElement obj) 021 { 022 return (obj == null) ? 0 : obj.swigCPtr; 023 } 024 025 protected static long getCPtrAndDisown (ReplacedElement 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_ReplacedElement(swigCPtr); 047 } 048 swigCPtr = 0; 049 } 050 super.delete(); 051 } 052 053 public ReplacedElement(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 054 this(libsbmlJNI.new_ReplacedElement__SWIG_0(level, version, pkgVersion), true); 055 } 056 057 public ReplacedElement(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 058 this(libsbmlJNI.new_ReplacedElement__SWIG_1(level, version), true); 059 } 060 061 public ReplacedElement(long level) throws org.sbml.libsbml.SBMLConstructorException { 062 this(libsbmlJNI.new_ReplacedElement__SWIG_2(level), true); 063 } 064 065 public ReplacedElement() throws org.sbml.libsbml.SBMLConstructorException { 066 this(libsbmlJNI.new_ReplacedElement__SWIG_3(), true); 067 } 068 069 public ReplacedElement(CompPkgNamespaces compns) throws org.sbml.libsbml.SBMLConstructorException { 070 this(libsbmlJNI.new_ReplacedElement__SWIG_4(CompPkgNamespaces.getCPtr(compns), compns), true); 071 } 072 073 public ReplacedElement(ReplacedElement source) throws org.sbml.libsbml.SBMLConstructorException { 074 this(libsbmlJNI.new_ReplacedElement__SWIG_5(ReplacedElement.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.ReplacedElement_cloneObject(swigCPtr, this); 085 return (cPtr == 0) ? null : new ReplacedElement(cPtr, true); 086 } 087 088 public String getConversionFactor() { 089 return libsbmlJNI.ReplacedElement_getConversionFactor(swigCPtr, this); 090 } 091 092 public boolean isSetConversionFactor() { 093 return libsbmlJNI.ReplacedElement_isSetConversionFactor(swigCPtr, this); 094 } 095 096 public int setConversionFactor(String id) { 097 return libsbmlJNI.ReplacedElement_setConversionFactor(swigCPtr, this, id); 098 } 099 100 public int unsetConversionFactor() { 101 return libsbmlJNI.ReplacedElement_unsetConversionFactor(swigCPtr, this); 102 } 103 104 public String getDeletion() { 105 return libsbmlJNI.ReplacedElement_getDeletion(swigCPtr, this); 106 } 107 108 public boolean isSetDeletion() { 109 return libsbmlJNI.ReplacedElement_isSetDeletion(swigCPtr, this); 110 } 111 112 public int setDeletion(String id) { 113 return libsbmlJNI.ReplacedElement_setDeletion(swigCPtr, this, id); 114 } 115 116 public int unsetDeletion() { 117 return libsbmlJNI.ReplacedElement_unsetDeletion(swigCPtr, this); 118 } 119 120 121/** 122 * Returns the XML element name of this object. 123 * <p> 124 * This is overridden by subclasses to return a string appropriate to the 125 * SBML component. For example, {@link Model} defines it as returning 126 * <code>'model'</code>, {@link CompartmentType} defines it as returning <code>'compartmentType'</code>, 127 * and so on. 128 */ public 129 String getElementName() { 130 return libsbmlJNI.ReplacedElement_getElementName(swigCPtr, this); 131 } 132 133 public int getNumReferents() { 134 return libsbmlJNI.ReplacedElement_getNumReferents(swigCPtr, this); 135 } 136 137 138/** 139 * Returns the libSBML type code for this object. 140 * <p> 141 * This method may return the type code of this SBML object, or it may 142 * return {@link libsbmlConstants#SBML_UNKNOWN SBML_UNKNOWN}. This 143 * is because subclasses of {@link SBase} are not required to implement this 144 * method to return a type code. This method is meant primarily for the 145 * LibSBML C interface, in which class and subclass information is not 146 * readily available. 147 * <p> 148 * @return the SBML object type code 149 * of this SBML object or 150 * {@link libsbmlConstants#SBML_UNKNOWN SBML_UNKNOWN} (the default). 151 * <p> 152 * @see #getElementName() 153 * @see #getPackageName() 154 */ public 155 int getTypeCode() { 156 return libsbmlJNI.ReplacedElement_getTypeCode(swigCPtr, this); 157 } 158 159 160/** 161 * Renames all the <code>SIdRef</code> attributes on this element, including any 162 * found in MathML content (if such exists). 163 * <p> 164 * This method works by looking at all attributes and (if appropriate) 165 * mathematical formulas, comparing the identifiers to the value of 166 * <code>oldid</code>. If any matches are found, the matching identifiers are replaced 167 * with <code>newid</code>. The method does <em>not</em> descend into child elements. 168 * <p> 169 * @param oldid the old identifier 170 * @param newid the new identifier 171 */ public 172 void renameSIdRefs(String oldid, String newid) { 173 libsbmlJNI.ReplacedElement_renameSIdRefs(swigCPtr, this, oldid, newid); 174 } 175 176 public int performReplacement() { 177 return libsbmlJNI.ReplacedElement_performReplacement(swigCPtr, this); 178 } 179 180 public SBase getReferencedElementFrom(Model model) { 181 return libsbml.DowncastSBase(libsbmlJNI.ReplacedElement_getReferencedElementFrom(swigCPtr, this, Model.getCPtr(model), model), false); 182} 183 184 public boolean acceptComp(SWIGTYPE_p_CompVisitor v) { 185 return libsbmlJNI.ReplacedElement_acceptComp(swigCPtr, this, SWIGTYPE_p_CompVisitor.getCPtr(v)); 186 } 187 188}