001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 3.0.8 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 Input} objects. 015 <p> 016 * The {@link ListOfInputs} is a container for the Inputs 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 Input 062 */ 063 064public class ListOfInputs extends ListOf { 065 private long swigCPtr; 066 067 protected ListOfInputs(long cPtr, boolean cMemoryOwn) 068 { 069 super(libsbmlJNI.ListOfInputs_SWIGUpcast(cPtr), cMemoryOwn); 070 swigCPtr = cPtr; 071 } 072 073 protected static long getCPtr(ListOfInputs obj) 074 { 075 return (obj == null) ? 0 : obj.swigCPtr; 076 } 077 078 protected static long getCPtrAndDisown (ListOfInputs 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_ListOfInputs(swigCPtr); 100 } 101 swigCPtr = 0; 102 } 103 super.delete(); 104 } 105 106 107/** 108 * Creates a new {@link ListOfInputs} with the given level, version, and package version. 109 <p> 110 * @param level a long integer, the SBML Level to assign to this {@link ListOfInputs} 111 <p> 112 * @param version a long integer, the SBML Version to assign to this {@link ListOfInputs} 113 <p> 114 * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link ListOfInputs} 115 */ public 116 ListOfInputs(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 117 this(libsbmlJNI.new_ListOfInputs__SWIG_0(level, version, pkgVersion), true); 118 } 119 120 121/** 122 * Creates a new {@link ListOfInputs} with the given level, version, and package version. 123 <p> 124 * @param level a long integer, the SBML Level to assign to this {@link ListOfInputs} 125 <p> 126 * @param version a long integer, the SBML Version to assign to this {@link ListOfInputs} 127 <p> 128 * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link ListOfInputs} 129 */ public 130 ListOfInputs(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 131 this(libsbmlJNI.new_ListOfInputs__SWIG_1(level, version), true); 132 } 133 134 135/** 136 * Creates a new {@link ListOfInputs} with the given level, version, and package version. 137 <p> 138 * @param level a long integer, the SBML Level to assign to this {@link ListOfInputs} 139 <p> 140 * @param version a long integer, the SBML Version to assign to this {@link ListOfInputs} 141 <p> 142 * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link ListOfInputs} 143 */ public 144 ListOfInputs(long level) throws org.sbml.libsbml.SBMLConstructorException { 145 this(libsbmlJNI.new_ListOfInputs__SWIG_2(level), true); 146 } 147 148 149/** 150 * Creates a new {@link ListOfInputs} with the given level, version, and package version. 151 <p> 152 * @param level a long integer, the SBML Level to assign to this {@link ListOfInputs} 153 <p> 154 * @param version a long integer, the SBML Version to assign to this {@link ListOfInputs} 155 <p> 156 * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link ListOfInputs} 157 */ public 158 ListOfInputs() throws org.sbml.libsbml.SBMLConstructorException { 159 this(libsbmlJNI.new_ListOfInputs__SWIG_3(), true); 160 } 161 162 163/** 164 * Creates a new {@link ListOfInputs} with the given {@link QualPkgNamespaces} object. 165 <p> 166 * @param qualns the {@link QualPkgNamespaces} object 167 */ public 168 ListOfInputs(QualPkgNamespaces qualns) throws org.sbml.libsbml.SBMLConstructorException { 169 this(libsbmlJNI.new_ListOfInputs__SWIG_4(QualPkgNamespaces.getCPtr(qualns), qualns), true); 170 } 171 172 173/** 174 * Creates and returns a deep copy of this {@link ListOfInputs} object. 175 <p> 176 * @return a (deep) copy of this {@link ListOfInputs} object. 177 */ public 178 ListOfInputs cloneObject() { 179 long cPtr = libsbmlJNI.ListOfInputs_cloneObject(swigCPtr, this); 180 return (cPtr == 0) ? null : new ListOfInputs(cPtr, true); 181 } 182 183 184/** 185 * Get a {@link Input} from the {@link ListOfInputs}. 186 <p> 187 * @param n the index number of the {@link Input} to get. 188 <p> 189 * @return the nth {@link Input} in this {@link ListOfInputs}. 190 <p> 191 * @see #size() 192 */ public 193 Input get(long n) { 194 long cPtr = libsbmlJNI.ListOfInputs_get__SWIG_0(swigCPtr, this, n); 195 return (cPtr == 0) ? null : new Input(cPtr, false); 196 } 197 198 199/** 200 * Get a {@link Input} from the {@link ListOfInputs} 201 * based on its identifier. 202 <p> 203 * @param sid a string representing the identifier 204 * of the {@link Input} to get. 205 <p> 206 * @return {@link Input} in this {@link ListOfInputs} 207 * with the given id or null if no such 208 * {@link Input} exists. 209 <p> 210 * @see #get(long n) * 211 * @see #size() 212 */ public 213 Input get(String sid) { 214 long cPtr = libsbmlJNI.ListOfInputs_get__SWIG_2(swigCPtr, this, sid); 215 return (cPtr == 0) ? null : new Input(cPtr, false); 216 } 217 218 219/** 220 * Get a {@link Input} from the {@link ListOfInputs} 221 * based on the qualitativeSpecies to which it refers. 222 <p> 223 * @param sid a string representing the qualitativeSpecies attribute 224 * of the {@link Input} to get. 225 <p> 226 * @return the first {@link Input} in this {@link ListOfInputs} 227 * with the given qualitativeSpecies or null if no such 228 * {@link Input} exists. 229 <p> 230 * @see #get(long n) * 231 * @see #size() 232 */ public 233 Input getBySpecies(String sid) { 234 long cPtr = libsbmlJNI.ListOfInputs_getBySpecies__SWIG_0(swigCPtr, this, sid); 235 return (cPtr == 0) ? null : new Input(cPtr, false); 236 } 237 238 239/** 240 * Removes the nth {@link Input} from this {@link ListOfInputs} 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 Input} to remove. 246 <p> 247 * @see #size() 248 */ public 249 Input remove(long n) { 250 long cPtr = libsbmlJNI.ListOfInputs_remove__SWIG_0(swigCPtr, this, n); 251 return (cPtr == 0) ? null : new Input(cPtr, true); 252 } 253 254 255/** 256 * Removes the {@link Input} from this {@link ListOfInputs} 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 Input} to remove. 264 <p> 265 * @return the {@link Input} removed. As mentioned above, the caller owns the 266 * returned item. 267 */ public 268 Input remove(String sid) { 269 long cPtr = libsbmlJNI.ListOfInputs_remove__SWIG_1(swigCPtr, this, sid); 270 return (cPtr == 0) ? null : new Input(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.ListOfInputs_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_INPUT SBML_QUAL_INPUT} (default). 301 <p> 302 * @see #getElementName() 303 * @see #getPackageName() 304 */ public 305 int getItemTypeCode() { 306 return libsbmlJNI.ListOfInputs_getItemTypeCode(swigCPtr, this); 307 } 308 309}