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