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 ListOfSpeciesReferenceGlyphs 015 * construct from the “layout” package. 016 <p> 017 * The {@link ListOfSpeciesReferenceGlyphs} is a container for the SpeciesReferenceGlyphs elements of a {@link ReactionGlyph}. 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 SpeciesReferenceGlyph 063 */ 064 065public class ListOfSpeciesReferenceGlyphs extends ListOf { 066 private long swigCPtr; 067 068 protected ListOfSpeciesReferenceGlyphs(long cPtr, boolean cMemoryOwn) 069 { 070 super(libsbmlJNI.ListOfSpeciesReferenceGlyphs_SWIGUpcast(cPtr), cMemoryOwn); 071 swigCPtr = cPtr; 072 } 073 074 protected static long getCPtr(ListOfSpeciesReferenceGlyphs obj) 075 { 076 return (obj == null) ? 0 : obj.swigCPtr; 077 } 078 079 protected static long getCPtrAndDisown (ListOfSpeciesReferenceGlyphs 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_ListOfSpeciesReferenceGlyphs(swigCPtr); 101 } 102 swigCPtr = 0; 103 } 104 super.delete(); 105 } 106 107 108/** 109 * Creates and returns a deep copy of this {@link ListOfSpeciesReferenceGlyphs}. 110 <p> 111 * @return a (deep) copy of this {@link ListOfSpeciesReferenceGlyphs}. 112 */ public 113 ListOfSpeciesReferenceGlyphs cloneObject() { 114 long cPtr = libsbmlJNI.ListOfSpeciesReferenceGlyphs_cloneObject(swigCPtr, this); 115 return (cPtr == 0) ? null : new ListOfSpeciesReferenceGlyphs(cPtr, true); 116 } 117 118 119/** 120 * Ctor. 121 */ public 122 ListOfSpeciesReferenceGlyphs(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 123 this(libsbmlJNI.new_ListOfSpeciesReferenceGlyphs__SWIG_0(level, version, pkgVersion), true); 124 } 125 126 127/** 128 * Ctor. 129 */ public 130 ListOfSpeciesReferenceGlyphs(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 131 this(libsbmlJNI.new_ListOfSpeciesReferenceGlyphs__SWIG_1(level, version), true); 132 } 133 134 135/** 136 * Ctor. 137 */ public 138 ListOfSpeciesReferenceGlyphs(long level) throws org.sbml.libsbml.SBMLConstructorException { 139 this(libsbmlJNI.new_ListOfSpeciesReferenceGlyphs__SWIG_2(level), true); 140 } 141 142 143/** 144 * Ctor. 145 */ public 146 ListOfSpeciesReferenceGlyphs() throws org.sbml.libsbml.SBMLConstructorException { 147 this(libsbmlJNI.new_ListOfSpeciesReferenceGlyphs__SWIG_3(), true); 148 } 149 150 151/** 152 * Ctor. 153 */ public 154 ListOfSpeciesReferenceGlyphs(LayoutPkgNamespaces layoutns) throws org.sbml.libsbml.SBMLConstructorException { 155 this(libsbmlJNI.new_ListOfSpeciesReferenceGlyphs__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_SPECIESREFERENCEGLYPH SBML_LAYOUT_SPECIESREFERENCEGLYPH} (default). 176 <p> 177 * @see #getElementName() 178 * @see #getPackageName() 179 */ public 180 int getItemTypeCode() { 181 return libsbmlJNI.ListOfSpeciesReferenceGlyphs_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.ListOfSpeciesReferenceGlyphs_getElementName(swigCPtr, this); 191 } 192 193 194/** 195 * Get a {@link SpeciesReferenceGlyph} from the {@link ListOfSpeciesReferenceGlyphs}. 196 <p> 197 * @param n the index number of the {@link SpeciesReferenceGlyph} to get. 198 <p> 199 * @return the nth {@link SpeciesReferenceGlyph} in this {@link ListOfSpeciesReferenceGlyphs}. 200 <p> 201 * @see #size() 202 */ public 203 SpeciesReferenceGlyph get(long n) { 204 long cPtr = libsbmlJNI.ListOfSpeciesReferenceGlyphs_get__SWIG_0(swigCPtr, this, n); 205 return (cPtr == 0) ? null : new SpeciesReferenceGlyph(cPtr, false); 206 } 207 208 209/** 210 * Get a {@link SpeciesReferenceGlyph} from the {@link ListOfSpeciesReferenceGlyphs} 211 * based on its identifier. 212 <p> 213 * @param sid a string representing the identifier 214 * of the {@link SpeciesReferenceGlyph} to get. 215 <p> 216 * @return {@link SpeciesReferenceGlyph} in this {@link ListOfSpeciesReferenceGlyphs} 217 * with the given <code>sid</code> or <code>null</code> if no such 218 * {@link SpeciesReferenceGlyph} exists. 219 <p> 220 * @see #get(long n) 221 * @see #size() 222 */ public 223 SpeciesReferenceGlyph get(String sid) { 224 long cPtr = libsbmlJNI.ListOfSpeciesReferenceGlyphs_get__SWIG_2(swigCPtr, this, sid); 225 return (cPtr == 0) ? null : new SpeciesReferenceGlyph(cPtr, false); 226 } 227 228 229/** 230 * Removes the nth item from this {@link ListOfSpeciesReferenceGlyphs} items and returns a pointer to 231 * it. 232 <p> 233 * The caller owns the returned item and is responsible for deleting it. 234 <p> 235 * @param n the index of the item to remove 236 <p> 237 * @see #size() 238 */ public 239 SpeciesReferenceGlyph remove(long n) { 240 long cPtr = libsbmlJNI.ListOfSpeciesReferenceGlyphs_remove__SWIG_0(swigCPtr, this, n); 241 return (cPtr == 0) ? null : new SpeciesReferenceGlyph(cPtr, true); 242 } 243 244 245/** 246 * Removes item in this {@link ListOfSpeciesReferenceGlyphs} items with the given identifier. 247 <p> 248 * The caller owns the returned item and is responsible for deleting it. 249 * If none of the items in this list have the identifier <code>sid</code>, then 250 * <code>null</code> is returned. 251 <p> 252 * @param sid the identifier of the item to remove 253 <p> 254 * @return the item removed. As mentioned above, the caller owns the 255 * returned item. 256 */ public 257 SpeciesReferenceGlyph remove(String sid) { 258 long cPtr = libsbmlJNI.ListOfSpeciesReferenceGlyphs_remove__SWIG_1(swigCPtr, this, sid); 259 return (cPtr == 0) ? null : new SpeciesReferenceGlyph(cPtr, true); 260 } 261 262 263/** 264 * Creates an {@link XMLNode} object from this. 265 */ public 266 XMLNode toXML() { 267 return new XMLNode(libsbmlJNI.ListOfSpeciesReferenceGlyphs_toXML(swigCPtr, this), true); 268 } 269 270}