001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 3.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 A list of {@link FunctionTerm} objects. 015 <p> 016 * The {@link ListOfFunctionTerms} is a container for the FunctionTerms 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 * SBML Level 3 Version 1 has essentially the same structure as 040 * Level 2 Version 4, depicted above, but SBML Level 3 041 * Version 2 allows 042 * containers to contain zero or more of the relevant object, instead of 043 * requiring at least one. As such, libsbml will write out an 044 * otherwise-empty ListOf___ element that has any optional attribute set 045 * (such as 'id' or 'metaid'), that has an optional child (such 046 * as a 'notes' or 'annotation'), or that has attributes or children set 047 * from any SBML Level 3 package, whether or not the ListOf___ has 048 * any other children. 049 <p> 050 * Readers may wonder about the motivations for using the ListOf___ 051 * containers in SBML. A simpler approach in XML might be to place the 052 * components all directly at the top level of the model definition. The 053 * choice made in SBML is to group them within XML elements named after 054 * ListOf<em>Classname</em>, in part because it helps organize the 055 * components. More importantly, the fact that the container classes are 056 * derived from {@link SBase} means that software tools can add information <em>about</em> 057 * the lists themselves into each list container's 'annotation'. 058 <p> 059 * @see ListOfFunctionDefinitions 060 * @see ListOfUnitDefinitions 061 * @see ListOfCompartmentTypes 062 * @see ListOfSpeciesTypes 063 * @see ListOfCompartments 064 * @see ListOfSpecies 065 * @see ListOfParameters 066 * @see ListOfInitialAssignments 067 * @see ListOfRules 068 * @see ListOfConstraints 069 * @see ListOfReactions 070 * @see ListOfEvents 071 <p> 072 * @see Input 073 */ 074 075public class ListOfFunctionTerms extends ListOf { 076 private long swigCPtr; 077 078 protected ListOfFunctionTerms(long cPtr, boolean cMemoryOwn) 079 { 080 super(libsbmlJNI.ListOfFunctionTerms_SWIGUpcast(cPtr), cMemoryOwn); 081 swigCPtr = cPtr; 082 } 083 084 protected static long getCPtr(ListOfFunctionTerms obj) 085 { 086 return (obj == null) ? 0 : obj.swigCPtr; 087 } 088 089 protected static long getCPtrAndDisown (ListOfFunctionTerms obj) 090 { 091 long ptr = 0; 092 093 if (obj != null) 094 { 095 ptr = obj.swigCPtr; 096 obj.swigCMemOwn = false; 097 } 098 099 return ptr; 100 } 101 102 protected void finalize() { 103 delete(); 104 } 105 106 public synchronized void delete() { 107 if (swigCPtr != 0) { 108 if (swigCMemOwn) { 109 swigCMemOwn = false; 110 libsbmlJNI.delete_ListOfFunctionTerms(swigCPtr); 111 } 112 swigCPtr = 0; 113 } 114 super.delete(); 115 } 116 117 118/** 119 * Creates a new {@link ListOfFunctionTerms} with the given level, version, and package version. 120 <p> 121 * @param level a long integer, the SBML Level to assign to this {@link ListOfFunctionTerms}. 122 <p> 123 * @param version a long integer, the SBML Version to assign to this {@link ListOfFunctionTerms}. 124 <p> 125 * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link ListOfFunctionTerms}. 126 <p> 127 * <p> 128 * @note Attempting to add an object to an {@link SBMLDocument} having a different 129 * combination of SBML Level, Version and XML namespaces than the object 130 * itself will result in an error at the time a caller attempts to make the 131 * addition. A parent object must have compatible Level, Version and XML 132 * namespaces. (Strictly speaking, a parent may also have more XML 133 * namespaces than a child, but the reverse is not permitted.) The 134 * restriction is necessary to ensure that an SBML model has a consistent 135 * overall structure. This requires callers to manage their objects 136 * carefully, but the benefit is increased flexibility in how models can be 137 * created by permitting callers to create objects bottom-up if desired. In 138 * situations where objects are not yet attached to parents (e.g., 139 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 140 * libSBML determine such things as whether it is valid to assign a 141 * particular value to an attribute. For packages, this means that the 142 * parent object to which this package element is being added must have 143 * been created with the package namespace, or that the package namespace 144 * was added to it, even if that parent is not a package object itself. 145 */ public 146 ListOfFunctionTerms(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException { 147 this(libsbmlJNI.new_ListOfFunctionTerms__SWIG_0(level, version, pkgVersion), true); 148 } 149 150 151/** 152 * Creates a new {@link ListOfFunctionTerms} with the given level, version, and package version. 153 <p> 154 * @param level a long integer, the SBML Level to assign to this {@link ListOfFunctionTerms}. 155 <p> 156 * @param version a long integer, the SBML Version to assign to this {@link ListOfFunctionTerms}. 157 <p> 158 * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link ListOfFunctionTerms}. 159 <p> 160 * <p> 161 * @note Attempting to add an object to an {@link SBMLDocument} having a different 162 * combination of SBML Level, Version and XML namespaces than the object 163 * itself will result in an error at the time a caller attempts to make the 164 * addition. A parent object must have compatible Level, Version and XML 165 * namespaces. (Strictly speaking, a parent may also have more XML 166 * namespaces than a child, but the reverse is not permitted.) The 167 * restriction is necessary to ensure that an SBML model has a consistent 168 * overall structure. This requires callers to manage their objects 169 * carefully, but the benefit is increased flexibility in how models can be 170 * created by permitting callers to create objects bottom-up if desired. In 171 * situations where objects are not yet attached to parents (e.g., 172 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 173 * libSBML determine such things as whether it is valid to assign a 174 * particular value to an attribute. For packages, this means that the 175 * parent object to which this package element is being added must have 176 * been created with the package namespace, or that the package namespace 177 * was added to it, even if that parent is not a package object itself. 178 */ public 179 ListOfFunctionTerms(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 180 this(libsbmlJNI.new_ListOfFunctionTerms__SWIG_1(level, version), true); 181 } 182 183 184/** 185 * Creates a new {@link ListOfFunctionTerms} with the given level, version, and package version. 186 <p> 187 * @param level a long integer, the SBML Level to assign to this {@link ListOfFunctionTerms}. 188 <p> 189 * @param version a long integer, the SBML Version to assign to this {@link ListOfFunctionTerms}. 190 <p> 191 * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link ListOfFunctionTerms}. 192 <p> 193 * <p> 194 * @note Attempting to add an object to an {@link SBMLDocument} having a different 195 * combination of SBML Level, Version and XML namespaces than the object 196 * itself will result in an error at the time a caller attempts to make the 197 * addition. A parent object must have compatible Level, Version and XML 198 * namespaces. (Strictly speaking, a parent may also have more XML 199 * namespaces than a child, but the reverse is not permitted.) The 200 * restriction is necessary to ensure that an SBML model has a consistent 201 * overall structure. This requires callers to manage their objects 202 * carefully, but the benefit is increased flexibility in how models can be 203 * created by permitting callers to create objects bottom-up if desired. In 204 * situations where objects are not yet attached to parents (e.g., 205 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 206 * libSBML determine such things as whether it is valid to assign a 207 * particular value to an attribute. For packages, this means that the 208 * parent object to which this package element is being added must have 209 * been created with the package namespace, or that the package namespace 210 * was added to it, even if that parent is not a package object itself. 211 */ public 212 ListOfFunctionTerms(long level) throws org.sbml.libsbml.SBMLConstructorException { 213 this(libsbmlJNI.new_ListOfFunctionTerms__SWIG_2(level), true); 214 } 215 216 217/** 218 * Creates a new {@link ListOfFunctionTerms} with the given level, version, and package version. 219 <p> 220 * @param level a long integer, the SBML Level to assign to this {@link ListOfFunctionTerms}. 221 <p> 222 * @param version a long integer, the SBML Version to assign to this {@link ListOfFunctionTerms}. 223 <p> 224 * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link ListOfFunctionTerms}. 225 <p> 226 * <p> 227 * @note Attempting to add an object to an {@link SBMLDocument} having a different 228 * combination of SBML Level, Version and XML namespaces than the object 229 * itself will result in an error at the time a caller attempts to make the 230 * addition. A parent object must have compatible Level, Version and XML 231 * namespaces. (Strictly speaking, a parent may also have more XML 232 * namespaces than a child, but the reverse is not permitted.) The 233 * restriction is necessary to ensure that an SBML model has a consistent 234 * overall structure. This requires callers to manage their objects 235 * carefully, but the benefit is increased flexibility in how models can be 236 * created by permitting callers to create objects bottom-up if desired. In 237 * situations where objects are not yet attached to parents (e.g., 238 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 239 * libSBML determine such things as whether it is valid to assign a 240 * particular value to an attribute. For packages, this means that the 241 * parent object to which this package element is being added must have 242 * been created with the package namespace, or that the package namespace 243 * was added to it, even if that parent is not a package object itself. 244 */ public 245 ListOfFunctionTerms() throws org.sbml.libsbml.SBMLConstructorException { 246 this(libsbmlJNI.new_ListOfFunctionTerms__SWIG_3(), true); 247 } 248 249 250/** 251 * Creates a new {@link ListOfFunctionTerms} with the given {@link QualPkgNamespaces} object. 252 <p> 253 * <p> 254 * The package namespaces object used in this constructor is derived from a 255 * {@link SBMLNamespaces} object, which encapsulates SBML Level/Version/namespaces 256 * information. It is used to communicate the SBML Level, Version, and 257 * package version and name information used in addition to SBML Level 3 Core. A 258 * common approach to using libSBML's {@link SBMLNamespaces} facilities is to create an 259 * package namespace object somewhere in a program once, then hand that object 260 * as needed to object constructors of that package that accept it as and 261 * argument, such as this one. 262 <p> 263 * @param qualns the {@link QualPkgNamespaces} object. 264 <p> 265 * <p> 266 * @note Attempting to add an object to an {@link SBMLDocument} having a different 267 * combination of SBML Level, Version and XML namespaces than the object 268 * itself will result in an error at the time a caller attempts to make the 269 * addition. A parent object must have compatible Level, Version and XML 270 * namespaces. (Strictly speaking, a parent may also have more XML 271 * namespaces than a child, but the reverse is not permitted.) The 272 * restriction is necessary to ensure that an SBML model has a consistent 273 * overall structure. This requires callers to manage their objects 274 * carefully, but the benefit is increased flexibility in how models can be 275 * created by permitting callers to create objects bottom-up if desired. In 276 * situations where objects are not yet attached to parents (e.g., 277 * {@link SBMLDocument}), knowledge of the intented SBML Level and Version help 278 * libSBML determine such things as whether it is valid to assign a 279 * particular value to an attribute. For packages, this means that the 280 * parent object to which this package element is being added must have 281 * been created with the package namespace, or that the package namespace 282 * was added to it, even if that parent is not a package object itself. 283 */ public 284 ListOfFunctionTerms(QualPkgNamespaces qualns) throws org.sbml.libsbml.SBMLConstructorException { 285 this(libsbmlJNI.new_ListOfFunctionTerms__SWIG_4(QualPkgNamespaces.getCPtr(qualns), qualns), true); 286 } 287 288 289/** 290 * Creates a new {@link ListOfFunctionTerms} from the original. 291 <p> 292 * @param orig the {@link ListOfFunctionTerms} object. 293 */ public 294 ListOfFunctionTerms(ListOfFunctionTerms orig) throws org.sbml.libsbml.SBMLConstructorException { 295 this(libsbmlJNI.new_ListOfFunctionTerms__SWIG_5(ListOfFunctionTerms.getCPtr(orig), orig), true); 296 } 297 298 299/** 300 * Creates and returns a deep copy of this {@link ListOfFunctionTerms} object. 301 <p> 302 * @return a (deep) copy of this {@link ListOfFunctionTerms} object. 303 */ public 304 ListOfFunctionTerms cloneObject() { 305 long cPtr = libsbmlJNI.ListOfFunctionTerms_cloneObject(swigCPtr, this); 306 return (cPtr == 0) ? null : new ListOfFunctionTerms(cPtr, true); 307 } 308 309 310/** 311 * Get a {@link FunctionTerm} from the {@link ListOfFunctionTerms}. 312 <p> 313 * @param n the index number of the {@link FunctionTerm} to get. 314 <p> 315 * @return the nth {@link FunctionTerm} in this {@link ListOfFunctionTerms}. 316 <p> 317 * @see #size() 318 */ public 319 FunctionTerm get(long n) { 320 long cPtr = libsbmlJNI.ListOfFunctionTerms_get__SWIG_0(swigCPtr, this, n); 321 return (cPtr == 0) ? null : new FunctionTerm(cPtr, false); 322 } 323 324 325/** 326 * Get a {@link FunctionTerm} from the {@link ListOfFunctionTerms} 327 * based on its identifier. 328 <p> 329 * @param sid a string representing the identifier 330 * of the {@link FunctionTerm} to get. 331 <p> 332 * @return {@link FunctionTerm} in this {@link ListOfFunctionTerms} 333 * with the given id or <code>null</code> if no such 334 * {@link FunctionTerm} exists. 335 <p> 336 * @see #get(long n) * 337 * @see #size() 338 */ public 339 FunctionTerm get(String sid) { 340 long cPtr = libsbmlJNI.ListOfFunctionTerms_get__SWIG_2(swigCPtr, this, sid); 341 return (cPtr == 0) ? null : new FunctionTerm(cPtr, false); 342 } 343 344 345/** 346 * Removes the nth {@link FunctionTerm} from this {@link ListOfFunctionTerms} 347 * and returns a pointer to it. 348 <p> 349 * The caller owns the returned item and is responsible for deleting it. 350 <p> 351 * @param n the index of the {@link FunctionTerm} to remove. 352 <p> 353 * @see #size() 354 */ public 355 FunctionTerm remove(long n) { 356 long cPtr = libsbmlJNI.ListOfFunctionTerms_remove__SWIG_0(swigCPtr, this, n); 357 return (cPtr == 0) ? null : new FunctionTerm(cPtr, true); 358 } 359 360 361/** 362 * Removes the {@link FunctionTerm} from this {@link ListOfFunctionTerms} with the given identifier 363 * and returns a pointer to it. 364 <p> 365 * The caller owns the returned item and is responsible for deleting it. 366 * If none of the items in this list have the identifier <code>sid</code>, then 367 * <code>null</code> is returned. 368 <p> 369 * @param sid the identifier of the {@link FunctionTerm} to remove. 370 <p> 371 * @return the {@link FunctionTerm} removed. As mentioned above, the caller owns the 372 * returned item. 373 */ public 374 FunctionTerm remove(String sid) { 375 long cPtr = libsbmlJNI.ListOfFunctionTerms_remove__SWIG_1(swigCPtr, this, sid); 376 return (cPtr == 0) ? null : new FunctionTerm(cPtr, true); 377 } 378 379 380/** 381 * Returns the XML name of this object. 382 <p> 383 * @return the name of this element. 384 */ public 385 String getElementName() { 386 return libsbmlJNI.ListOfFunctionTerms_getElementName(swigCPtr, this); 387 } 388 389 390/** 391 * Returns the libSBML type code for the SBML objects 392 * contained in this {@link ListOf} object. 393 <p> 394 * <p> 395 * LibSBML attaches an identifying code to every kind of SBML object. These 396 * are integer constants known as <em>SBML type codes</em>. The names of all 397 * the codes begin with the characters <code>SBML_</code>. 398 * In the Java language interface for libSBML, the 399 * type codes are defined as static integer constants in the interface class 400 * {@link libsbmlConstants}. Note that different Level 3 401 * package plug-ins may use overlapping type codes; to identify the package 402 * to which a given object belongs, call the 403 * <code>{@link SBase#getPackageName()} 404 * </code> 405 * method on the object. 406 <p> 407 * @return the SBML type code for objects contained in this list: 408 * {@link libsbmlConstants#SBML_QUAL_FUNCTION_TERM SBML_QUAL_FUNCTION_TERM} (default). 409 <p> 410 * @see #getElementName() 411 * @see #getPackageName() 412 */ public 413 int getItemTypeCode() { 414 return libsbmlJNI.ListOfFunctionTerms_getItemTypeCode(swigCPtr, this); 415 } 416 417 418/** 419 * Get the {@link DefaultTerm} from this {@link ListOfFunctionTerms}. 420 <p> 421 * @return the {@link DefaultTerm} in this {@link ListOfFunctionTerms}, or <code>null</code> if no such value is set. 422 <p> 423 * @see Transition#getDefaultTerm 424 */ public 425 DefaultTerm getDefaultTerm() { 426 long cPtr = libsbmlJNI.ListOfFunctionTerms_getDefaultTerm__SWIG_0(swigCPtr, this); 427 return (cPtr == 0) ? null : new DefaultTerm(cPtr, false); 428 } 429 430 431/** 432 * Sets the given {@link DefaultTerm} to this {@link Transition}. 433 <p> 434 * @param dt the {@link DefaultTerm} object to add. 435 <p> 436 * <p> 437 * @return integer value indicating success/failure of the 438 * function. The possible values 439 * returned by this function are: 440 * <ul> 441 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 442 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 443 * </ul> 444 */ public 445 int setDefaultTerm(DefaultTerm dt) { 446 return libsbmlJNI.ListOfFunctionTerms_setDefaultTerm(swigCPtr, this, DefaultTerm.getCPtr(dt), dt); 447 } 448 449 450/** 451 * Predicate returning <code>true</code> if the defaultTerm 452 * for this {@link ListOfFunctionTerms} object has been set. 453 <p> 454 * @return a boolean value indicating whether the defaultTerm 455 * child for this object has been defined. 456 */ public 457 boolean isSetDefaultTerm() { 458 return libsbmlJNI.ListOfFunctionTerms_isSetDefaultTerm(swigCPtr, this); 459 } 460 461 462/** 463 * Creates a new {@link DefaultTerm} object, adds it to this 464 * {@link ListOfFunctionTerms} and returns the {@link DefaultTerm} object created. 465 <p> 466 * @return a new {@link DefaultTerm} object instance. 467 <p> 468 * @see #setDefaultTerm(DefaultTerm ft) 469 */ public 470 DefaultTerm createDefaultTerm() { 471 long cPtr = libsbmlJNI.ListOfFunctionTerms_createDefaultTerm(swigCPtr, this); 472 return (cPtr == 0) ? null : new DefaultTerm(cPtr, false); 473 } 474 475}