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 TextGlyph} objects. 015 <p> 016 * The {@link ListOfTextGlyphs} is a container for the {@link TextGlyph} 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 TextGlyph 054 */ 055 056public class ListOfTextGlyphs extends ListOf { 057 private long swigCPtr; 058 059 protected ListOfTextGlyphs(long cPtr, boolean cMemoryOwn) 060 { 061 super(libsbmlJNI.ListOfTextGlyphs_SWIGUpcast(cPtr), cMemoryOwn); 062 swigCPtr = cPtr; 063 } 064 065 protected static long getCPtr(ListOfTextGlyphs obj) 066 { 067 return (obj == null) ? 0 : obj.swigCPtr; 068 } 069 070 protected static long getCPtrAndDisown (ListOfTextGlyphs 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_ListOfTextGlyphs(swigCPtr); 092 } 093 swigCPtr = 0; 094 } 095 super.delete(); 096 } 097 098 099/** 100 * Creates and returns a deep copy of this {@link ListOfTextGlyphs}. 101 <p> 102 * @return a (deep) copy of this {@link ListOfTextGlyphs}. 103 */ public 104 ListOfTextGlyphs cloneObject() { 105 long cPtr = libsbmlJNI.ListOfTextGlyphs_cloneObject(swigCPtr, this); 106 return (cPtr == 0) ? null : new ListOfTextGlyphs(cPtr, true); 107 } 108 109 110/** 111 * Ctor. 112 */ public 113 ListOfTextGlyphs(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 114 this(libsbmlJNI.new_ListOfTextGlyphs__SWIG_0(level, version, pkgVersion), true); 115 } 116 117 118/** 119 * Ctor. 120 */ public 121 ListOfTextGlyphs(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 122 this(libsbmlJNI.new_ListOfTextGlyphs__SWIG_1(level, version), true); 123 } 124 125 126/** 127 * Ctor. 128 */ public 129 ListOfTextGlyphs(long level) throws org.sbml.libsbml.SBMLConstructorException { 130 this(libsbmlJNI.new_ListOfTextGlyphs__SWIG_2(level), true); 131 } 132 133 134/** 135 * Ctor. 136 */ public 137 ListOfTextGlyphs() throws org.sbml.libsbml.SBMLConstructorException { 138 this(libsbmlJNI.new_ListOfTextGlyphs__SWIG_3(), true); 139 } 140 141 142/** 143 * Ctor. 144 */ public 145 ListOfTextGlyphs(LayoutPkgNamespaces layoutns) throws org.sbml.libsbml.SBMLConstructorException { 146 this(libsbmlJNI.new_ListOfTextGlyphs__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_TEXTGLYPH SBML_LAYOUT_TEXTGLYPH} (default). 167 <p> 168 * @see #getElementName() 169 * @see #getPackageName() 170 */ public 171 int getItemTypeCode() { 172 return libsbmlJNI.ListOfTextGlyphs_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.ListOfTextGlyphs_getElementName(swigCPtr, this); 184 } 185 186 187/** 188 * Get a {@link TextGlyph} from the {@link ListOfTextGlyphs}. 189 <p> 190 * @param n the index number of the {@link TextGlyph} to get. 191 <p> 192 * @return the nth {@link TextGlyph} in this {@link ListOfTextGlyphs}. 193 <p> 194 * @see #size() 195 */ public 196 TextGlyph get(long n) { 197 long cPtr = libsbmlJNI.ListOfTextGlyphs_get__SWIG_0(swigCPtr, this, n); 198 return (cPtr == 0) ? null : new TextGlyph(cPtr, false); 199 } 200 201 202/** 203 * Get a {@link TextGlyph} from the {@link ListOfTextGlyphs} 204 * based on its identifier. 205 <p> 206 * @param sid a string representing the identifier 207 * of the {@link TextGlyph} to get. 208 <p> 209 * @return {@link TextGlyph} in this {@link ListOfTextGlyphs} 210 * with the given <code>sid</code> or <code>null</code> if no such 211 * {@link TextGlyph} exists. 212 <p> 213 * @see #get(long n) 214 * @see #size() 215 */ public 216 TextGlyph get(String sid) { 217 long cPtr = libsbmlJNI.ListOfTextGlyphs_get__SWIG_2(swigCPtr, this, sid); 218 return (cPtr == 0) ? null : new TextGlyph(cPtr, false); 219 } 220 221 222/** 223 * Removes the nth item from this {@link ListOfTextGlyphs} items and returns a pointer to 224 * it. 225 <p> 226 * The caller owns the returned item and is responsible for deleting it. 227 <p> 228 * @param n the index of the item to remove 229 <p> 230 * @see #size() 231 */ public 232 TextGlyph remove(long n) { 233 long cPtr = libsbmlJNI.ListOfTextGlyphs_remove__SWIG_0(swigCPtr, this, n); 234 return (cPtr == 0) ? null : new TextGlyph(cPtr, true); 235 } 236 237 238/** 239 * Removes item in this {@link ListOfTextGlyphs} items with the given identifier. 240 <p> 241 * The caller owns the returned item and is responsible for deleting it. 242 * If none of the items in this list have the identifier <code>sid</code>, then 243 * <code>null</code> is returned. 244 <p> 245 * @param sid the identifier of the item to remove 246 <p> 247 * @return the item removed. As mentioned above, the caller owns the 248 * returned item. 249 */ public 250 TextGlyph remove(String sid) { 251 long cPtr = libsbmlJNI.ListOfTextGlyphs_remove__SWIG_1(swigCPtr, this, sid); 252 return (cPtr == 0) ? null : new TextGlyph(cPtr, true); 253 } 254 255 256/** 257 * Creates an {@link XMLNode} object from this. 258 */ public 259 XMLNode toXML() { 260 return new XMLNode(libsbmlJNI.ListOfTextGlyphs_toXML(swigCPtr, this), true); 261 } 262 263}