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