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 Replacing extends SBaseRef { 012 private long swigCPtr; 013 014 protected Replacing(long cPtr, boolean cMemoryOwn) 015 { 016 super(libsbmlJNI.Replacing_SWIGUpcast(cPtr), cMemoryOwn); 017 swigCPtr = cPtr; 018 } 019 020 protected static long getCPtr(Replacing obj) 021 { 022 return (obj == null) ? 0 : obj.swigCPtr; 023 } 024 025 protected static long getCPtrAndDisown (Replacing 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_Replacing(swigCPtr); 047 } 048 swigCPtr = 0; 049 } 050 super.delete(); 051 } 052 053 public String getSubmodelRef() { 054 return libsbmlJNI.Replacing_getSubmodelRef(swigCPtr, this); 055 } 056 057 public boolean isSetSubmodelRef() { 058 return libsbmlJNI.Replacing_isSetSubmodelRef(swigCPtr, this); 059 } 060 061 public int setSubmodelRef(String id) { 062 return libsbmlJNI.Replacing_setSubmodelRef(swigCPtr, this, id); 063 } 064 065 public int unsetSubmodelRef() { 066 return libsbmlJNI.Replacing_unsetSubmodelRef(swigCPtr, this); 067 } 068 069 070/** 071 * Subclasses should override this method to write out their contained 072 * SBML objects as XML elements. Be sure to call your parents 073 * implementation of this method as well. For example: 074 * @internal 075 */ public 076 boolean hasRequiredAttributes() { 077 return libsbmlJNI.Replacing_hasRequiredAttributes(swigCPtr, this); 078 } 079 080 public int saveReferencedElement() { 081 return libsbmlJNI.Replacing_saveReferencedElement(swigCPtr, this); 082 } 083 084 085/** 086 * Renames all the <code>SIdRef</code> attributes on this element, including any 087 * found in MathML content (if such exists). 088 * <p> 089 * This method works by looking at all attributes and (if appropriate) 090 * mathematical formulas, comparing the identifiers to the value of 091 * <code>oldid</code>. If any matches are found, the matching identifiers are replaced 092 * with <code>newid</code>. The method does <em>not</em> descend into child elements. 093 * <p> 094 * @param oldid the old identifier 095 * @param newid the new identifier 096 */ public 097 void renameSIdRefs(String oldid, String newid) { 098 libsbmlJNI.Replacing_renameSIdRefs(swigCPtr, this, oldid, newid); 099 } 100 101 public int performReplacement() { 102 return libsbmlJNI.Replacing_performReplacement(swigCPtr, this); 103 } 104 105 106/** 107 * Sets this SBML object to child SBML objects (if any). 108 * (Creates a child-parent relationship by the parent) 109 * <p> 110 * Subclasses must override this function if they define 111 * one ore more child elements. 112 * Basically, this function needs to be called in 113 * constructor, copy constructor, assignment operator. 114 * <p> 115 * <p> 116 * @internal 117 */ public 118 void connectToChild() { 119 libsbmlJNI.Replacing_connectToChild(swigCPtr, this); 120 } 121 122 public int replaceWithAndMaybeDelete(SBase replacement, boolean deleteme, ASTNode conversionFactor) { 123 return libsbmlJNI.Replacing_replaceWithAndMaybeDelete(swigCPtr, this, SBase.getCPtr(replacement), replacement, deleteme, ASTNode.getCPtr(conversionFactor), conversionFactor); 124 } 125 126}