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-qual"><a href="group__qual.html">qual</a></span> 013 014 A list of {@link Output} objects. 015 <p> 016 * The {@link ListOfOutputs} is a container for the {@link Output} elements of a {@link Transition}. 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 Output 062 */ 063 064public class ListOfOutputs extends ListOf { 065 private long swigCPtr; 066 067 protected ListOfOutputs(long cPtr, boolean cMemoryOwn) 068 { 069 super(libsbmlJNI.ListOfOutputs_SWIGUpcast(cPtr), cMemoryOwn); 070 swigCPtr = cPtr; 071 } 072 073 protected static long getCPtr(ListOfOutputs obj) 074 { 075 return (obj == null) ? 0 : obj.swigCPtr; 076 } 077 078 protected static long getCPtrAndDisown (ListOfOutputs 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_ListOfOutputs(swigCPtr); 100 } 101 swigCPtr = 0; 102 } 103 super.delete(); 104 } 105 106 107/** 108 * Creates a new {@link ListOfOutputs} with the given level, version, and package version. 109 <p> 110 * @param level a long integer, the SBML Level to assign to this {@link ListOfOutputs} 111 <p> 112 * @param version a long integer, the SBML Version to assign to this {@link ListOfOutputs} 113 <p> 114 * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link ListOfOutputs} 115 */ public 116 ListOfOutputs(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 117 this(libsbmlJNI.new_ListOfOutputs__SWIG_0(level, version, pkgVersion), true); 118 } 119 120 121/** 122 * Creates a new {@link ListOfOutputs} with the given level, version, and package version. 123 <p> 124 * @param level a long integer, the SBML Level to assign to this {@link ListOfOutputs} 125 <p> 126 * @param version a long integer, the SBML Version to assign to this {@link ListOfOutputs} 127 <p> 128 * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link ListOfOutputs} 129 */ public 130 ListOfOutputs(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 131 this(libsbmlJNI.new_ListOfOutputs__SWIG_1(level, version), true); 132 } 133 134 135/** 136 * Creates a new {@link ListOfOutputs} with the given level, version, and package version. 137 <p> 138 * @param level a long integer, the SBML Level to assign to this {@link ListOfOutputs} 139 <p> 140 * @param version a long integer, the SBML Version to assign to this {@link ListOfOutputs} 141 <p> 142 * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link ListOfOutputs} 143 */ public 144 ListOfOutputs(long level) throws org.sbml.libsbml.SBMLConstructorException { 145 this(libsbmlJNI.new_ListOfOutputs__SWIG_2(level), true); 146 } 147 148 149/** 150 * Creates a new {@link ListOfOutputs} with the given level, version, and package version. 151 <p> 152 * @param level a long integer, the SBML Level to assign to this {@link ListOfOutputs} 153 <p> 154 * @param version a long integer, the SBML Version to assign to this {@link ListOfOutputs} 155 <p> 156 * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link ListOfOutputs} 157 */ public 158 ListOfOutputs() throws org.sbml.libsbml.SBMLConstructorException { 159 this(libsbmlJNI.new_ListOfOutputs__SWIG_3(), true); 160 } 161 162 163/** 164 * Creates a new {@link ListOfOutputs} with the given {@link QualPkgNamespaces} object. 165 <p> 166 * @param qualns the {@link QualPkgNamespaces} object 167 */ public 168 ListOfOutputs(QualPkgNamespaces qualns) throws org.sbml.libsbml.SBMLConstructorException { 169 this(libsbmlJNI.new_ListOfOutputs__SWIG_4(QualPkgNamespaces.getCPtr(qualns), qualns), true); 170 } 171 172 173/** 174 * Creates and returns a deep copy of this {@link ListOfOutputs} object. 175 <p> 176 * @return a (deep) copy of this {@link ListOfOutputs} object. 177 */ public 178 ListOfOutputs cloneObject() { 179 long cPtr = libsbmlJNI.ListOfOutputs_cloneObject(swigCPtr, this); 180 return (cPtr == 0) ? null : new ListOfOutputs(cPtr, true); 181 } 182 183 184/** 185 * Get a {@link Output} from the {@link ListOfOutputs}. 186 <p> 187 * @param n the index number of the {@link Output} to get. 188 <p> 189 * @return the nth {@link Output} in this {@link ListOfOutputs}. 190 <p> 191 * @see #size() 192 */ public 193 Output get(long n) { 194 long cPtr = libsbmlJNI.ListOfOutputs_get__SWIG_0(swigCPtr, this, n); 195 return (cPtr == 0) ? null : new Output(cPtr, false); 196 } 197 198 199/** 200 * Get a {@link Output} from the {@link ListOfOutputs} 201 * based on its identifier. 202 <p> 203 * @param sid a string representing the identifier 204 * of the {@link Output} to get. 205 <p> 206 * @return {@link Output} in this {@link ListOfOutputs} 207 * with the given id or null if no such 208 * {@link Output} exists. 209 <p> 210 * @see #get(long n) * 211 * @see #size() 212 */ public 213 Output get(String sid) { 214 long cPtr = libsbmlJNI.ListOfOutputs_get__SWIG_2(swigCPtr, this, sid); 215 return (cPtr == 0) ? null : new Output(cPtr, false); 216 } 217 218 219/** 220 * Get a {@link Output} from the {@link ListOfOutputs} 221 * based on the qualitativeSpecies to which it refers. 222 <p> 223 * @param sid a string representing the qualitativeSpecies attribute 224 * of the {@link Output} to get. 225 <p> 226 * @return the first {@link Output} in this {@link ListOfOutputs} 227 * with the given qualitativeSpecies or null if no such 228 * {@link Output} exists. 229 <p> 230 * @see #get(long n) * 231 * @see #size() 232 */ public 233 Output getBySpecies(String sid) { 234 long cPtr = libsbmlJNI.ListOfOutputs_getBySpecies__SWIG_0(swigCPtr, this, sid); 235 return (cPtr == 0) ? null : new Output(cPtr, false); 236 } 237 238 239/** 240 * Removes the nth {@link Output} from this {@link ListOfOutputs} 241 * and returns a pointer to it. 242 <p> 243 * The caller owns the returned item and is responsible for deleting it. 244 <p> 245 * @param n the index of the {@link Output} to remove. 246 <p> 247 * @see #size() 248 */ public 249 Output remove(long n) { 250 long cPtr = libsbmlJNI.ListOfOutputs_remove__SWIG_0(swigCPtr, this, n); 251 return (cPtr == 0) ? null : new Output(cPtr, true); 252 } 253 254 255/** 256 * Removes the {@link Output} from this {@link ListOfOutputs} with the given identifier 257 * and returns a pointer to it. 258 <p> 259 * The caller owns the returned item and is responsible for deleting it. 260 * If none of the items in this list have the identifier <code>sid</code>, then 261 * <code>null</code> is returned. 262 <p> 263 * @param sid the identifier of the {@link Output} to remove. 264 <p> 265 * @return the {@link Output} removed. As mentioned above, the caller owns the 266 * returned item. 267 */ public 268 Output remove(String sid) { 269 long cPtr = libsbmlJNI.ListOfOutputs_remove__SWIG_1(swigCPtr, this, sid); 270 return (cPtr == 0) ? null : new Output(cPtr, true); 271 } 272 273 274/** 275 * Returns the XML name of this object. 276 <p> 277 * @return the name of this element. 278 */ public 279 String getElementName() { 280 return libsbmlJNI.ListOfOutputs_getElementName(swigCPtr, this); 281 } 282 283 284/** 285 * Returns the libSBML type code for the SBML objects 286 * contained in this {@link ListOf} object. 287 <p> 288 * <p> 289 * LibSBML attaches an identifying code to every kind of SBML object. These 290 * are integer constants known as <em>SBML type codes</em>. The names of all 291 * the codes begin with the characters <code>SBML_</code>. 292 * In the Java language interface for libSBML, the 293 * type codes are defined as static integer constants in the interface class 294 * {@link libsbmlConstants}. Note that different Level 3 295 * package plug-ins may use overlapping type codes; to identify the package 296 * to which a given object belongs, call the <code>getPackageName()</code> 297 * method on the object. 298 <p> 299 * @return the SBML type code for objects contained in this list: 300 * {@link libsbmlConstants#SBML_QUAL_OUTPUT SBML_QUAL_OUTPUT} (default). 301 <p> 302 * @see #getElementName() 303 * @see #getPackageName() 304 */ public 305 int getItemTypeCode() { 306 return libsbmlJNI.ListOfOutputs_getItemTypeCode(swigCPtr, this); 307 } 308 309}