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 ListOfCompartmentGlyphs extends ListOf { 012 private long swigCPtr; 013 014 protected ListOfCompartmentGlyphs(long cPtr, boolean cMemoryOwn) 015 { 016 super(libsbmlJNI.ListOfCompartmentGlyphs_SWIGUpcast(cPtr), cMemoryOwn); 017 swigCPtr = cPtr; 018 } 019 020 protected static long getCPtr(ListOfCompartmentGlyphs obj) 021 { 022 return (obj == null) ? 0 : obj.swigCPtr; 023 } 024 025 protected static long getCPtrAndDisown (ListOfCompartmentGlyphs 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_ListOfCompartmentGlyphs(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 ListOfCompartmentGlyphs cloneObject() { 060 long cPtr = libsbmlJNI.ListOfCompartmentGlyphs_cloneObject(swigCPtr, this); 061 return (cPtr == 0) ? null : new ListOfCompartmentGlyphs(cPtr, true); 062 } 063 064 public ListOfCompartmentGlyphs(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 065 this(libsbmlJNI.new_ListOfCompartmentGlyphs__SWIG_0(level, version, pkgVersion), true); 066 } 067 068 public ListOfCompartmentGlyphs(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 069 this(libsbmlJNI.new_ListOfCompartmentGlyphs__SWIG_1(level, version), true); 070 } 071 072 public ListOfCompartmentGlyphs(long level) throws org.sbml.libsbml.SBMLConstructorException { 073 this(libsbmlJNI.new_ListOfCompartmentGlyphs__SWIG_2(level), true); 074 } 075 076 public ListOfCompartmentGlyphs() throws org.sbml.libsbml.SBMLConstructorException { 077 this(libsbmlJNI.new_ListOfCompartmentGlyphs__SWIG_3(), true); 078 } 079 080 public ListOfCompartmentGlyphs(LayoutPkgNamespaces layoutns) throws org.sbml.libsbml.SBMLConstructorException { 081 this(libsbmlJNI.new_ListOfCompartmentGlyphs__SWIG_4(LayoutPkgNamespaces.getCPtr(layoutns), layoutns), true); 082 } 083 084 085/** 086 * Get the type code of the objects contained in this {@link ListOf}. 087 * <p> 088 * LibSBML attaches an identifying code to every 089 * kind of SBML object. These are known as <em>SBML type codes</em>. In 090 * other languages, the set of type codes is stored in an enumeration; in 091 * the Java language interface for libSBML, the type codes are defined as 092 * static integer constants in the interface class {@link 093 * libsbmlConstants}. The names of the type codes all begin with the 094 * characters <code>SBML_.</code> 095 * <p> 096 * @return the SBML type code for the objects contained in this {@link ListOf} 097 * instance, or {@link libsbmlConstants#SBML_UNKNOWN SBML_UNKNOWN} (default). 098 */ public 099 int getItemTypeCode() { 100 return libsbmlJNI.ListOfCompartmentGlyphs_getItemTypeCode(swigCPtr, this); 101 } 102 103 104/** 105 * Returns the XML element name of this object, which for {@link ListOf}, is 106 * always <code>'listOf'.</code> 107 * <p> 108 * @return the XML name of this element. 109 */ public 110 String getElementName() { 111 return libsbmlJNI.ListOfCompartmentGlyphs_getElementName(swigCPtr, this); 112 } 113 114 public XMLNode toXML() { 115 return new XMLNode(libsbmlJNI.ListOfCompartmentGlyphs_toXML(swigCPtr, this), true); 116 } 117 118 119/** 120 * Get an item from the list. 121 * <p> 122 * @param n the index number of the item to get. 123 * <p> 124 * @return the nth item in this {@link ListOf} items. 125 * <p> 126 * @see #size() 127 */ public 128 CompartmentGlyph get(long n) { 129 long cPtr = libsbmlJNI.ListOfCompartmentGlyphs_get__SWIG_0(swigCPtr, this, n); 130 return (cPtr == 0) ? null : new CompartmentGlyph(cPtr, false); 131 } 132 133 134/** 135 * Get an item from the list based on its identifier. 136 * <p> 137 * @param sid a string representing the the identifier of the item to get. 138 * <p> 139 * @return item in this {@link ListOf} items with the given <code>sid</code> or <code>null</code> if no such 140 * item exists. 141 * <p> 142 * @see #get(long n) 143 * @see #size() 144 */ public 145 CompartmentGlyph get(String sid) { 146 long cPtr = libsbmlJNI.ListOfCompartmentGlyphs_get__SWIG_2(swigCPtr, this, sid); 147 return (cPtr == 0) ? null : new CompartmentGlyph(cPtr, false); 148 } 149 150 151/** 152 * Removes the <em>n</em>th item from this {@link ListOf} items and returns a 153 * pointer to it. 154 * <p> 155 * The caller owns the returned item and is responsible for deleting it. 156 * <p> 157 * @param n the index of the item to remove 158 * <p> 159 * @see #size() 160 */ public 161 CompartmentGlyph remove(long n) { 162 long cPtr = libsbmlJNI.ListOfCompartmentGlyphs_remove__SWIG_0(swigCPtr, this, n); 163 return (cPtr == 0) ? null : new CompartmentGlyph(cPtr, true); 164 } 165 166 167/** 168 * Removes item in this {@link ListOf} items with the given identifier. 169 * <p> 170 * The caller owns the returned item and is responsible for deleting it. 171 * If none of the items in this list have the identifier <code>sid</code>, then 172 * <code>null</code> is returned. 173 * <p> 174 * @param sid the identifier of the item to remove 175 * <p> 176 * @return the item removed. As mentioned above, the caller owns the 177 * returned item. 178 */ public 179 CompartmentGlyph remove(String sid) { 180 long cPtr = libsbmlJNI.ListOfCompartmentGlyphs_remove__SWIG_1(swigCPtr, this, sid); 181 return (cPtr == 0) ? null : new CompartmentGlyph(cPtr, true); 182 } 183 184}