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 ListOfReplacedElements extends ListOf { 012 private long swigCPtr; 013 014 protected ListOfReplacedElements(long cPtr, boolean cMemoryOwn) 015 { 016 super(libsbmlJNI.ListOfReplacedElements_SWIGUpcast(cPtr), cMemoryOwn); 017 swigCPtr = cPtr; 018 } 019 020 protected static long getCPtr(ListOfReplacedElements obj) 021 { 022 return (obj == null) ? 0 : obj.swigCPtr; 023 } 024 025 protected static long getCPtrAndDisown (ListOfReplacedElements 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_ListOfReplacedElements(swigCPtr); 047 } 048 swigCPtr = 0; 049 } 050 super.delete(); 051 } 052 053 054/** 055 * Creates and returns a deep copy of this {@link ListOf}. 056 * <p> 057 * @return a (deep) copy of this {@link ListOf}. 058 */ public 059 ListOfReplacedElements cloneObject() { 060 long cPtr = libsbmlJNI.ListOfReplacedElements_cloneObject(swigCPtr, this); 061 return (cPtr == 0) ? null : new ListOfReplacedElements(cPtr, true); 062 } 063 064 public ListOfReplacedElements(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 065 this(libsbmlJNI.new_ListOfReplacedElements__SWIG_0(level, version, pkgVersion), true); 066 } 067 068 public ListOfReplacedElements(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 069 this(libsbmlJNI.new_ListOfReplacedElements__SWIG_1(level, version), true); 070 } 071 072 public ListOfReplacedElements(long level) throws org.sbml.libsbml.SBMLConstructorException { 073 this(libsbmlJNI.new_ListOfReplacedElements__SWIG_2(level), true); 074 } 075 076 public ListOfReplacedElements() throws org.sbml.libsbml.SBMLConstructorException { 077 this(libsbmlJNI.new_ListOfReplacedElements__SWIG_3(), true); 078 } 079 080 public ListOfReplacedElements(CompPkgNamespaces compns) throws org.sbml.libsbml.SBMLConstructorException { 081 this(libsbmlJNI.new_ListOfReplacedElements__SWIG_4(CompPkgNamespaces.getCPtr(compns), compns), true); 082 } 083 084 085/** 086 * Get an item from the list. 087 * <p> 088 * @param n the index number of the item to get. 089 * <p> 090 * @return the nth item in this {@link ListOf} items. 091 * <p> 092 * @see #size() 093 */ public 094 SBase get(long n) { 095 long cPtr = libsbmlJNI.ListOfReplacedElements_get__SWIG_0(swigCPtr, this, n); 096 return (cPtr == 0) ? null : new ReplacedElement(cPtr, false); 097 } 098 099 100/** 101 * Removes the <em>n</em>th item from this {@link ListOf} items and returns a 102 * pointer to it. 103 * <p> 104 * The caller owns the returned item and is responsible for deleting it. 105 * <p> 106 * @param n the index of the item to remove 107 * <p> 108 * @see #size() 109 */ public 110 SBase remove(long n) { 111 long cPtr = libsbmlJNI.ListOfReplacedElements_remove(swigCPtr, this, n); 112 return (cPtr == 0) ? null : new ReplacedElement(cPtr, true); 113 } 114 115 116/** 117 * Get the type code of the objects contained in this {@link ListOf}. 118 * <p> 119 * LibSBML attaches an identifying code to every 120 * kind of SBML object. These are known as <em>SBML type codes</em>. In 121 * other languages, the set of type codes is stored in an enumeration; in 122 * the Java language interface for libSBML, the type codes are defined as 123 * static integer constants in the interface class {@link 124 * libsbmlConstants}. The names of the type codes all begin with the 125 * characters <code>SBML_.</code> 126 * <p> 127 * @return the SBML type code for the objects contained in this {@link ListOf} 128 * instance, or {@link libsbmlConstants#SBML_UNKNOWN SBML_UNKNOWN} (default). 129 */ public 130 int getItemTypeCode() { 131 return libsbmlJNI.ListOfReplacedElements_getItemTypeCode(swigCPtr, this); 132 } 133 134 135/** 136 * Returns the XML element name of this object, which for {@link ListOf}, is 137 * always <code>'listOf'.</code> 138 * <p> 139 * @return the XML name of this element. 140 */ public 141 String getElementName() { 142 return libsbmlJNI.ListOfReplacedElements_getElementName(swigCPtr, this); 143 } 144 145}