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