001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 3.0.10 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 011/** 012 * <span class="pkg-marker pkg-color-layout"><a href="group__layout.html">layout</a></span> 013 014 A list of {@link CompartmentGlyph} objects. 015 <p> 016 * The {@link ListOfCompartmentGlyphs} is a container for the {@link CompartmentGlyph} elements of a {@link Layout}. 017 <p> 018 * <p> 019 * The various ListOf___ classes in SBML 020 * are merely containers used for organizing the main components of an SBML 021 * model. In libSBML's implementation, ListOf___ 022 * classes are derived from the 023 * intermediate utility class {@link ListOf}, which 024 * is not defined by the SBML specifications but serves as a useful 025 * programmatic construct. {@link ListOf} is itself is in turn derived from {@link SBase}, 026 * which provides all of the various ListOf___ 027 * classes with common features 028 * defined by the SBML specification, such as 'metaid' attributes and 029 * annotations. 030 <p> 031 * Readers may wonder about the motivations for using the ListOf___ 032 * containers in SBML. A simpler approach in XML might be to place the 033 * components all directly at the top level of the model definition. The 034 * choice made in SBML is to group them within XML elements named after 035 * ListOf<em>Classname</em>, in part because it helps organize the 036 * components. More importantly, the fact that the container classes are 037 * derived from {@link SBase} means that software tools can add information <em>about</em> 038 * the lists themselves into each list container's 'annotation'. 039 <p> 040 * @see ListOfFunctionDefinitions 041 * @see ListOfUnitDefinitions 042 * @see ListOfCompartmentTypes 043 * @see ListOfSpeciesTypes 044 * @see ListOfCompartments 045 * @see ListOfSpecies 046 * @see ListOfParameters 047 * @see ListOfInitialAssignments 048 * @see ListOfRules 049 * @see ListOfConstraints 050 * @see ListOfReactions 051 * @see ListOfEvents 052 <p> 053 * @see CompartmentGlyph 054 */ 055 056public class ListOfCompartmentGlyphs extends ListOf { 057 private long swigCPtr; 058 059 protected ListOfCompartmentGlyphs(long cPtr, boolean cMemoryOwn) 060 { 061 super(libsbmlJNI.ListOfCompartmentGlyphs_SWIGUpcast(cPtr), cMemoryOwn); 062 swigCPtr = cPtr; 063 } 064 065 protected static long getCPtr(ListOfCompartmentGlyphs obj) 066 { 067 return (obj == null) ? 0 : obj.swigCPtr; 068 } 069 070 protected static long getCPtrAndDisown (ListOfCompartmentGlyphs obj) 071 { 072 long ptr = 0; 073 074 if (obj != null) 075 { 076 ptr = obj.swigCPtr; 077 obj.swigCMemOwn = false; 078 } 079 080 return ptr; 081 } 082 083 protected void finalize() { 084 delete(); 085 } 086 087 public synchronized void delete() { 088 if (swigCPtr != 0) { 089 if (swigCMemOwn) { 090 swigCMemOwn = false; 091 libsbmlJNI.delete_ListOfCompartmentGlyphs(swigCPtr); 092 } 093 swigCPtr = 0; 094 } 095 super.delete(); 096 } 097 098 099/** 100 * Creates and returns a deep copy of this {@link ListOfCompartmentGlyphs}. 101 <p> 102 * @return a (deep) copy of this {@link ListOfCompartmentGlyphs}. 103 */ public 104 ListOfCompartmentGlyphs cloneObject() { 105 long cPtr = libsbmlJNI.ListOfCompartmentGlyphs_cloneObject(swigCPtr, this); 106 return (cPtr == 0) ? null : new ListOfCompartmentGlyphs(cPtr, true); 107 } 108 109 110/** 111 * Ctor. 112 */ public 113 ListOfCompartmentGlyphs(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 114 this(libsbmlJNI.new_ListOfCompartmentGlyphs__SWIG_0(level, version, pkgVersion), true); 115 } 116 117 118/** 119 * Ctor. 120 */ public 121 ListOfCompartmentGlyphs(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 122 this(libsbmlJNI.new_ListOfCompartmentGlyphs__SWIG_1(level, version), true); 123 } 124 125 126/** 127 * Ctor. 128 */ public 129 ListOfCompartmentGlyphs(long level) throws org.sbml.libsbml.SBMLConstructorException { 130 this(libsbmlJNI.new_ListOfCompartmentGlyphs__SWIG_2(level), true); 131 } 132 133 134/** 135 * Ctor. 136 */ public 137 ListOfCompartmentGlyphs() throws org.sbml.libsbml.SBMLConstructorException { 138 this(libsbmlJNI.new_ListOfCompartmentGlyphs__SWIG_3(), true); 139 } 140 141 142/** 143 * Ctor. 144 */ public 145 ListOfCompartmentGlyphs(LayoutPkgNamespaces layoutns) throws org.sbml.libsbml.SBMLConstructorException { 146 this(libsbmlJNI.new_ListOfCompartmentGlyphs__SWIG_4(LayoutPkgNamespaces.getCPtr(layoutns), layoutns), true); 147 } 148 149 150/** 151 * Returns the libSBML type code for the SBML objects 152 * contained in this {@link ListOf} object. 153 <p> 154 * <p> 155 * LibSBML attaches an identifying code to every kind of SBML object. These 156 * are integer constants known as <em>SBML type codes</em>. The names of all 157 * the codes begin with the characters <code>SBML_</code>. 158 * In the Java language interface for libSBML, the 159 * type codes are defined as static integer constants in the interface class 160 * {@link libsbmlConstants}. Note that different Level 3 161 * package plug-ins may use overlapping type codes; to identify the package 162 * to which a given object belongs, call the <code>getPackageName()</code> 163 * method on the object. 164 <p> 165 * @return the SBML type code for objects contained in this list: 166 * {@link libsbmlConstants#SBML_LAYOUT_COMPARTMENTGLYPH SBML_LAYOUT_COMPARTMENTGLYPH} (default). 167 <p> 168 * @see #getElementName() 169 * @see #getPackageName() 170 */ public 171 int getItemTypeCode() { 172 return libsbmlJNI.ListOfCompartmentGlyphs_getItemTypeCode(swigCPtr, this); 173 } 174 175 176/** 177 * Returns the XML element name of 178 * this SBML object. 179 <p> 180 * @return the string of the name of this element 181 */ public 182 String getElementName() { 183 return libsbmlJNI.ListOfCompartmentGlyphs_getElementName(swigCPtr, this); 184 } 185 186 187/** 188 * Creates an {@link XMLNode} object from this. 189 */ public 190 XMLNode toXML() { 191 return new XMLNode(libsbmlJNI.ListOfCompartmentGlyphs_toXML(swigCPtr, this), true); 192 } 193 194 195/** 196 * Get a {@link CompartmentGlyph} from the {@link ListOfCompartmentGlyphs}. 197 <p> 198 * @param n the index number of the {@link CompartmentGlyph} to get. 199 <p> 200 * @return the nth {@link CompartmentGlyph} in this {@link ListOfCompartmentGlyphs}. 201 <p> 202 * @see #size() 203 */ public 204 CompartmentGlyph get(long n) { 205 long cPtr = libsbmlJNI.ListOfCompartmentGlyphs_get__SWIG_0(swigCPtr, this, n); 206 return (cPtr == 0) ? null : new CompartmentGlyph(cPtr, false); 207 } 208 209 210/** 211 * Get a {@link CompartmentGlyph} from the {@link ListOfCompartmentGlyphs} 212 * based on its identifier. 213 <p> 214 * @param sid a string representing the identifier 215 * of the {@link CompartmentGlyph} to get. 216 <p> 217 * @return {@link CompartmentGlyph} in this {@link ListOfCompartmentGlyphs} 218 * with the given <code>sid</code> or <code>null</code> if no such 219 * {@link CompartmentGlyph} exists. 220 <p> 221 * @see #get(long n) 222 * @see #size() 223 */ public 224 CompartmentGlyph get(String sid) { 225 long cPtr = libsbmlJNI.ListOfCompartmentGlyphs_get__SWIG_2(swigCPtr, this, sid); 226 return (cPtr == 0) ? null : new CompartmentGlyph(cPtr, false); 227 } 228 229 230/** 231 * Removes the nth item from this {@link ListOfCompartmentGlyphs} items and returns a pointer to 232 * it. 233 <p> 234 * The caller owns the returned item and is responsible for deleting it. 235 <p> 236 * @param n the index of the item to remove 237 <p> 238 * @see #size() 239 */ public 240 CompartmentGlyph remove(long n) { 241 long cPtr = libsbmlJNI.ListOfCompartmentGlyphs_remove__SWIG_0(swigCPtr, this, n); 242 return (cPtr == 0) ? null : new CompartmentGlyph(cPtr, true); 243 } 244 245 246/** 247 * Removes item in this {@link ListOfCompartmentGlyphs} items with the given identifier. 248 <p> 249 * The caller owns the returned item and is responsible for deleting it. 250 * If none of the items in this list have the identifier <code>sid</code>, then 251 * <code>null</code> is returned. 252 <p> 253 * @param sid the identifier of the item to remove 254 <p> 255 * @return the item removed. As mentioned above, the caller owns the 256 * returned item. 257 */ public 258 CompartmentGlyph remove(String sid) { 259 long cPtr = libsbmlJNI.ListOfCompartmentGlyphs_remove__SWIG_1(swigCPtr, this, sid); 260 return (cPtr == 0) ? null : new CompartmentGlyph(cPtr, true); 261 } 262 263}