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