1 //------------------------------------------------------------------------------ 2 // <auto-generated /> 3 // 4 // This file was automatically generated by SWIG (http://www.swig.org). 5 // Version 4.0.2 6 // 7 // Do not make changes to this file unless you know what you are doing--modify 8 // the SWIG interface file instead. 9 //------------------------------------------------------------------------------ 10 11 namespace libsbml { 12 13 using System; 14 using System.Runtime.InteropServices; 15 16 /** 17 * @sbmlpackage{core} 18 * 19 @htmlinclude pkg-marker-core.html Parent class for libSBML's 'ListOfXYZ' classes. 20 * 21 * @htmlinclude not-sbml-warning.html 22 * 23 * The ListOf class in libSBML is a utility class that serves as the parent 24 * class for implementing the ListOf__ classes. It provides methods for 25 * working generically with the various SBML lists of objects in a program. 26 * LibSBML uses this separate list class rather than ordinary 27 * @if conly C@endif@if cpp C++; @endif@if java Java@endif@if python Python@endif lists, 28 * so that it can provide the methods and features associated with SBase. 29 * 30 * Whether a given ListOf element may be empty or not depends on the 31 * element in question, and on what level and version of SBML it 32 * is being used for. For ListOf elements in SBML Level 3 33 * Version 1 and prior, no core list and few package lists could 34 * be empty. As of SBML Level 3 Version 2, the rules 35 * were relaxed, and lists were allowed to be empty. In libSBML, 36 * documents created for Level 3 Version 2 will be written 37 * with empty ListOf's if that ListOf contains some other 'extra' 38 * information: an attribute such as metaid or sboTerm, a child 39 * '<notes>' or '<annotation>', or information from a SBML 40 * Level 3 package. 41 * 42 * 43 * 44 * The various ListOf___ @if conly structures @else classes@endif in SBML 45 * are merely containers used for organizing the main components of an SBML 46 * model. In libSBML's implementation, ListOf___ 47 * @if conly data structures @else classes@endif are derived from the 48 * intermediate utility @if conly structure @else class@endif ListOf, which 49 * is not defined by the SBML specifications but serves as a useful 50 * programmatic construct. ListOf is itself is in turn derived from SBase, 51 * which provides all of the various ListOf___ 52 * @if conly data structures @else classes@endif with common features 53 * defined by the SBML specification, such as 'metaid' attributes and 54 * annotations. 55 * 56 * The relationship between the lists and the rest of an SBML model is 57 * illustrated by the following (for SBML Level 2 Version 4): 58 * 59 * @htmlinclude listof-illustration.html 60 * 61 * SBML Level 3 Version 1 has essentially the same structure as 62 * Level 2 Version 4, depicted above, but SBML Level 3 63 * Version 2 allows 64 * containers to contain zero or more of the relevant object, instead of 65 * requiring at least one. As such, libsbml will write out an 66 * otherwise-empty ListOf___ element that has any optional attribute set 67 * (such as 'id' or 'metaid'), that has an optional child (such 68 * as a 'notes' or 'annotation'), or that has attributes or children set 69 * from any SBML Level 3 package, whether or not the ListOf___ has 70 * any other children. 71 * 72 * Readers may wonder about the motivations for using the ListOf___ 73 * containers in SBML. A simpler approach in XML might be to place the 74 * components all directly at the top level of the model definition. The 75 * choice made in SBML is to group them within XML elements named after 76 * %ListOf<em>Classname</em>, in part because it helps organize the 77 * components. More importantly, the fact that the container classes are 78 * derived from SBase means that software tools can add information @em about 79 * the lists themselves into each list container's 'annotation'. 80 * 81 * @see ListOfFunctionDefinitions 82 * @see ListOfUnitDefinitions 83 * @see ListOfCompartmentTypes 84 * @see ListOfSpeciesTypes 85 * @see ListOfCompartments 86 * @see ListOfSpecies 87 * @see ListOfParameters 88 * @see ListOfInitialAssignments 89 * @see ListOfRules 90 * @see ListOfConstraints 91 * @see ListOfReactions 92 * @see ListOfEvents 93 * 94 * @if conly 95 * @note In the C API for libSBML, functions that in other language APIs 96 * would be inherited by the various ListOf___ structures not shown in the 97 * pages for the individual ListOf___'s. Instead, the functions are defined 98 * on ListOf_t. <strong>Please consult the documentation for ListOf_t for 99 * the many common functions available for manipulating ListOf___ 100 * structures</strong>. The documentation for the individual ListOf___ 101 * structures (ListOfCompartments_t, ListOfReactions_t, etc.) does not reveal 102 * all of the functionality available. @endif 103 * 104 * 105 */ 106 107 public class ListOf : SBase { 108 private HandleRef swigCPtr; 109 ListOf(IntPtr cPtr, bool cMemoryOwn)110 internal ListOf(IntPtr cPtr, bool cMemoryOwn) : base(libsbmlPINVOKE.ListOf_SWIGUpcast(cPtr), cMemoryOwn) 111 { 112 //super(libsbmlPINVOKE.ListOfUpcast(cPtr), cMemoryOwn); 113 swigCPtr = new HandleRef(this, cPtr); 114 } 115 getCPtr(ListOf obj)116 internal static HandleRef getCPtr(ListOf obj) 117 { 118 return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; 119 } 120 getCPtrAndDisown(ListOf obj)121 internal static HandleRef getCPtrAndDisown (ListOf obj) 122 { 123 HandleRef ptr = new HandleRef(null, IntPtr.Zero); 124 125 if (obj != null) 126 { 127 ptr = obj.swigCPtr; 128 obj.swigCMemOwn = false; 129 } 130 131 return ptr; 132 } 133 Dispose(bool disposing)134 protected override void Dispose(bool disposing) { 135 lock(this) { 136 if (swigCPtr.Handle != global::System.IntPtr.Zero) { 137 if (swigCMemOwn) { 138 swigCMemOwn = false; 139 libsbmlPINVOKE.delete_ListOf(swigCPtr); 140 } 141 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); 142 } 143 base.Dispose(disposing); 144 } 145 } 146 147 148 /** 149 * Creates a new ListOf object. 150 * 151 * @param level the SBML Level; if not assigned, defaults to the 152 * value of SBMLDocument::getDefaultLevel(). 153 * 154 * @param version the Version within the SBML Level; if not assigned, 155 * defaults to the value of SBMLDocument::getDefaultVersion(). 156 * 157 * 158 * @note Bare ListOf @if conly structures @else objects@endif are 159 * impossible to add to SBML models. The ListOf 160 * @if conly structure type@else class@endif is simply the base 161 * of <em>other</em> @if conly structure types @else classes@endif in 162 * libSBML. Calling programs are not intended to create bare ListOf 163 * @if conly structures @else objects@endif themselves. 164 * 165 * 166 * @note Attempting to add an object to an SBMLDocument having a different 167 * combination of SBML Level, Version and XML namespaces than the object 168 * itself will result in an error at the time a caller attempts to make the 169 * addition. A parent object must have compatible Level, Version and XML 170 * namespaces. (Strictly speaking, a parent may also have more XML 171 * namespaces than a child, but the reverse is not permitted.) The 172 * restriction is necessary to ensure that an SBML model has a consistent 173 * overall structure. This requires callers to manage their objects 174 * carefully, but the benefit is increased flexibility in how models can be 175 * created by permitting callers to create objects bottom-up if desired. In 176 * situations where objects are not yet attached to parents (e.g., 177 * SBMLDocument), knowledge of the intented SBML Level and Version help 178 * libSBML determine such things as whether it is valid to assign a 179 * particular value to an attribute. 180 * 181 * 182 * 183 * @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif 184 */ public ListOf(long level, long version)185 ListOf(long level, long version) : this(libsbmlPINVOKE.new_ListOf__SWIG_0(level, version), true) { 186 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 187 } 188 189 190 /** 191 * Creates a new ListOf object. 192 * 193 * @param level the SBML Level; if not assigned, defaults to the 194 * value of SBMLDocument::getDefaultLevel(). 195 * 196 * @param version the Version within the SBML Level; if not assigned, 197 * defaults to the value of SBMLDocument::getDefaultVersion(). 198 * 199 * 200 * @note Bare ListOf @if conly structures @else objects@endif are 201 * impossible to add to SBML models. The ListOf 202 * @if conly structure type@else class@endif is simply the base 203 * of <em>other</em> @if conly structure types @else classes@endif in 204 * libSBML. Calling programs are not intended to create bare ListOf 205 * @if conly structures @else objects@endif themselves. 206 * 207 * 208 * @note Attempting to add an object to an SBMLDocument having a different 209 * combination of SBML Level, Version and XML namespaces than the object 210 * itself will result in an error at the time a caller attempts to make the 211 * addition. A parent object must have compatible Level, Version and XML 212 * namespaces. (Strictly speaking, a parent may also have more XML 213 * namespaces than a child, but the reverse is not permitted.) The 214 * restriction is necessary to ensure that an SBML model has a consistent 215 * overall structure. This requires callers to manage their objects 216 * carefully, but the benefit is increased flexibility in how models can be 217 * created by permitting callers to create objects bottom-up if desired. In 218 * situations where objects are not yet attached to parents (e.g., 219 * SBMLDocument), knowledge of the intented SBML Level and Version help 220 * libSBML determine such things as whether it is valid to assign a 221 * particular value to an attribute. 222 * 223 * 224 * 225 * @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif 226 */ public ListOf(long level)227 ListOf(long level) : this(libsbmlPINVOKE.new_ListOf__SWIG_1(level), true) { 228 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 229 } 230 231 232 /** 233 * Creates a new ListOf object. 234 * 235 * @param level the SBML Level; if not assigned, defaults to the 236 * value of SBMLDocument::getDefaultLevel(). 237 * 238 * @param version the Version within the SBML Level; if not assigned, 239 * defaults to the value of SBMLDocument::getDefaultVersion(). 240 * 241 * 242 * @note Bare ListOf @if conly structures @else objects@endif are 243 * impossible to add to SBML models. The ListOf 244 * @if conly structure type@else class@endif is simply the base 245 * of <em>other</em> @if conly structure types @else classes@endif in 246 * libSBML. Calling programs are not intended to create bare ListOf 247 * @if conly structures @else objects@endif themselves. 248 * 249 * 250 * @note Attempting to add an object to an SBMLDocument having a different 251 * combination of SBML Level, Version and XML namespaces than the object 252 * itself will result in an error at the time a caller attempts to make the 253 * addition. A parent object must have compatible Level, Version and XML 254 * namespaces. (Strictly speaking, a parent may also have more XML 255 * namespaces than a child, but the reverse is not permitted.) The 256 * restriction is necessary to ensure that an SBML model has a consistent 257 * overall structure. This requires callers to manage their objects 258 * carefully, but the benefit is increased flexibility in how models can be 259 * created by permitting callers to create objects bottom-up if desired. In 260 * situations where objects are not yet attached to parents (e.g., 261 * SBMLDocument), knowledge of the intented SBML Level and Version help 262 * libSBML determine such things as whether it is valid to assign a 263 * particular value to an attribute. 264 * 265 * 266 * 267 * @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif 268 */ public ListOf()269 ListOf() : this(libsbmlPINVOKE.new_ListOf__SWIG_2(), true) { 270 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 271 } 272 273 274 /** 275 * Creates a new ListOf with a given SBMLNamespaces object. 276 * 277 * @param sbmlns the set of SBML namespaces that this ListOf should 278 * contain. 279 * 280 * 281 * @note Bare ListOf @if conly structures @else objects@endif are 282 * impossible to add to SBML models. The ListOf 283 * @if conly structure type@else class@endif is simply the base 284 * of <em>other</em> @if conly structure types @else classes@endif in 285 * libSBML. Calling programs are not intended to create bare ListOf 286 * @if conly structures @else objects@endif themselves. 287 * 288 * 289 * @note Attempting to add an object to an SBMLDocument having a different 290 * combination of SBML Level, Version and XML namespaces than the object 291 * itself will result in an error at the time a caller attempts to make the 292 * addition. A parent object must have compatible Level, Version and XML 293 * namespaces. (Strictly speaking, a parent may also have more XML 294 * namespaces than a child, but the reverse is not permitted.) The 295 * restriction is necessary to ensure that an SBML model has a consistent 296 * overall structure. This requires callers to manage their objects 297 * carefully, but the benefit is increased flexibility in how models can be 298 * created by permitting callers to create objects bottom-up if desired. In 299 * situations where objects are not yet attached to parents (e.g., 300 * SBMLDocument), knowledge of the intented SBML Level and Version help 301 * libSBML determine such things as whether it is valid to assign a 302 * particular value to an attribute. 303 * 304 * 305 */ public ListOf(SBMLNamespaces sbmlns)306 ListOf(SBMLNamespaces sbmlns) : this(libsbmlPINVOKE.new_ListOf__SWIG_3(SBMLNamespaces.getCPtr(sbmlns)), true) { 307 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 308 } 309 310 311 /** 312 * Copy constructor; creates a copy of this ListOf. 313 * 314 * @param orig the ListOf instance to copy. 315 */ public ListOf(ListOf orig)316 ListOf(ListOf orig) : this(libsbmlPINVOKE.new_ListOf__SWIG_4(ListOf.getCPtr(orig)), true) { 317 if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve(); 318 } 319 320 321 /** 322 * Creates and returns a deep copy of this ListOf object. 323 * 324 * @return the (deep) copy of this ListOf object. 325 */ public new clone()326 ListOf clone() { 327 global::System.IntPtr cPtr = libsbmlPINVOKE.ListOf_clone(swigCPtr); 328 ListOf ret = (cPtr == global::System.IntPtr.Zero) ? null : new ListOf(cPtr, true); 329 return ret; 330 } 331 332 333 /** 334 * Adds an item to the end of this ListOf's list of items. 335 * 336 * This method makes a clone of the @p item handed to it. This means that 337 * when the ListOf object is destroyed, the original items will not be 338 * destroyed. For a method with an alternative ownership behavior, see the 339 * ListOf::appendAndOwn(@if java SBase@endif) method. 340 * 341 * @param item the item to be added to the list. 342 * 343 * 344 * @return integer value indicating success/failure of the 345 * function. @if clike The value is drawn from the 346 * enumeration #OperationReturnValues_t. @endif The possible values 347 * returned by this function are: 348 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 349 * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink 350 * 351 * @see appendAndOwn(SBase disownedItem) 352 * @see appendFrom(ListOf list) 353 */ public append(SBase item)354 int append(SBase item) { 355 int ret = libsbmlPINVOKE.ListOf_append(swigCPtr, SBase.getCPtr(item)); 356 return ret; 357 } 358 359 360 /** 361 * Adds an item to the end of this ListOf's list of items. 362 * 363 * This method does not clone the @p disownedItem handed to it; instead, it assumes 364 * ownership of it. This means that when the ListOf is destroyed, the item 365 * will be destroyed along with it. For a method with an alternative 366 * ownership behavior, see the ListOf::append(SBase item) method. 367 * 368 * @param disownedItem the item to be added to the list. 369 * Will become a child of the parent list. 370 * 371 * 372 * @return integer value indicating success/failure of the 373 * function. @if clike The value is drawn from the 374 * enumeration #OperationReturnValues_t. @endif The possible values 375 * returned by this function are: 376 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 377 * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink 378 * 379 * @see append(SBase item) 380 * @see appendFrom(ListOf list) 381 */ public appendAndOwn(SBase disownedItem)382 int appendAndOwn(SBase disownedItem) { 383 int ret = libsbmlPINVOKE.ListOf_appendAndOwn(swigCPtr, SBase.getCPtrAndDisown(disownedItem)); 384 return ret; 385 } 386 387 388 /** 389 * Adds a clone of a list of items to this ListOf's list. 390 * 391 * Note that because this clones the objects handed to it, the original 392 * items will not be destroyed when this ListOf object is destroyed. 393 * 394 * @param list a list of items to be added. 395 * 396 * 397 * @return integer value indicating success/failure of the 398 * function. @if clike The value is drawn from the 399 * enumeration #OperationReturnValues_t. @endif The possible values 400 * returned by this function are: 401 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 402 * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink 403 * 404 * @see append(SBase item) 405 * @see appendAndOwn(SBase disownedItem) 406 */ public new appendFrom(ListOf list)407 int appendFrom(ListOf list) { 408 int ret = libsbmlPINVOKE.ListOf_appendFrom(swigCPtr, ListOf.getCPtr(list)); 409 return ret; 410 } 411 412 413 /** 414 * Inserts an item at a given position in this ListOf's list of items. 415 * 416 * This variant of the method makes a clone of the @p item handed to it. 417 * This means that when the ListOf is destroyed, the original @p item will 418 * <em>not</em> be destroyed. 419 * 420 * @param location the location in the list where to insert the item. 421 * @param item the item to be inserted to the list. 422 * 423 * 424 * @return integer value indicating success/failure of the 425 * function. @if clike The value is drawn from the 426 * enumeration #OperationReturnValues_t. @endif The possible values 427 * returned by this function are: 428 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 429 * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink 430 * 431 * @see insertAndOwn(int location, SBase item) 432 */ public insert(int location, SBase item)433 int insert(int location, SBase item) { 434 int ret = libsbmlPINVOKE.ListOf_insert(swigCPtr, location, SBase.getCPtr(item)); 435 return ret; 436 } 437 438 439 /** 440 * Inserts an item at a given position in this ListOf's list of items. 441 * 442 * This variant of the method does not make a clone of the @p disownedItem handed to it. 443 * This means that when the ListOf is destroyed, the original @p item 444 * <em>will</em> be destroyed. 445 * 446 * @param location the location where to insert the item. 447 * @param disownedItem the item to be inserted to the list. 448 * Will become a child of the parent list. 449 * 450 * 451 * @return integer value indicating success/failure of the 452 * function. @if clike The value is drawn from the 453 * enumeration #OperationReturnValues_t. @endif The possible values 454 * returned by this function are: 455 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 456 * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink 457 * 458 * @see insert(int location, SBase item) 459 */ public insertAndOwn(int location, SBase disownedItem)460 int insertAndOwn(int location, SBase disownedItem) { 461 int ret = libsbmlPINVOKE.ListOf_insertAndOwn(swigCPtr, location, SBase.getCPtrAndDisown(disownedItem)); 462 return ret; 463 } 464 465 466 /** 467 * Get an item from the list. 468 * 469 * @param n the index number of the item to get. 470 * 471 * @return the <em>n</em>th item in this ListOf items, or a null pointer if 472 * the index number @p n refers to a nonexistent position in this list. 473 * 474 * @see size() 475 */ public new get(long n)476 SBase get(long n) { 477 SBase ret = (SBase) libsbml.DowncastSBase(libsbmlPINVOKE.ListOf_get__SWIG_0(swigCPtr, n), false); 478 return ret; 479 } 480 481 482 /** 483 * Returns the first child element found that has the given identifier. 484 * 485 * This method searches this ListOf's list of items for SBML objects based 486 * on their 'id' attribute value in the model-wide <code>SId</code> 487 * identifier namespace. 488 * 489 * @param id string representing the id of the object to find. 490 * 491 * @return the first element found with the given @p id, or @c null if no 492 * such object is found. 493 */ public new getElementBySId(string id)494 SBase getElementBySId(string id) { 495 SBase ret = (SBase) libsbml.DowncastSBase(libsbmlPINVOKE.ListOf_getElementBySId(swigCPtr, id), false); 496 return ret; 497 } 498 499 500 /** 501 * Returns the first child element found with the given meta-identifier. 502 * 503 * @param metaid string representing the 'metaid' attribute of the object 504 * to find. 505 * 506 * @return the first element found with the given @p metaid, or @c null if 507 * no such object is found. 508 */ public new getElementByMetaId(string metaid)509 SBase getElementByMetaId(string metaid) { 510 SBase ret = (SBase) libsbml.DowncastSBase(libsbmlPINVOKE.ListOf_getElementByMetaId(swigCPtr, metaid), false); 511 return ret; 512 } 513 514 515 /** 516 * Removes all items in this ListOf object. 517 * 518 * If parameter @p doDelete is @c true (default), all items in this ListOf 519 * object are deleted and cleared, and thus the caller doesn't have to 520 * delete those items. Otherwise, all items are cleared only from this 521 * ListOf object; the caller is still responsible for deleting the actual 522 * items. (In the latter case, callers are advised to store pointers to 523 * all items elsewhere before calling this function.) 524 * 525 * @param doDelete if @c true (default), all items are deleted and cleared. 526 * Otherwise, all items are just cleared and not deleted. 527 * 528 * @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif 529 */ public clear(bool doDelete)530 void clear(bool doDelete) { 531 libsbmlPINVOKE.ListOf_clear__SWIG_0(swigCPtr, doDelete); 532 } 533 534 535 /** 536 * Removes all items in this ListOf object. 537 * 538 * If parameter @p doDelete is @c true (default), all items in this ListOf 539 * object are deleted and cleared, and thus the caller doesn't have to 540 * delete those items. Otherwise, all items are cleared only from this 541 * ListOf object; the caller is still responsible for deleting the actual 542 * items. (In the latter case, callers are advised to store pointers to 543 * all items elsewhere before calling this function.) 544 * 545 * @param doDelete if @c true (default), all items are deleted and cleared. 546 * Otherwise, all items are just cleared and not deleted. 547 * 548 * @ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif 549 */ public clear()550 void clear() { 551 libsbmlPINVOKE.ListOf_clear__SWIG_1(swigCPtr); 552 } 553 554 555 /** 556 * Removes all items in this ListOf object and deletes its properties too. 557 * 558 * This performs a call to clear() with an argument of @c true (thus removing 559 * all the child objects in the list), followed by calls to various libSBML 560 * <code>unset<em>Foo</em></code> methods to delete everything else: CVTerm 561 * objects, model history objects, etc. 562 * 563 * @if cpp Implementations of subclasses of ListOf may need to override 564 * this method if different handling of child objects is needed.@endif 565 * 566 * 567 * @return integer value indicating success/failure of the 568 * function. @if clike The value is drawn from the 569 * enumeration #OperationReturnValues_t. @endif The possible values 570 * returned by this function are: 571 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 572 */ public new removeFromParentAndDelete()573 int removeFromParentAndDelete() { 574 int ret = libsbmlPINVOKE.ListOf_removeFromParentAndDelete(swigCPtr); 575 return ret; 576 } 577 578 579 /** 580 * Removes the <em>n</em>th item from this ListOf list of items and returns 581 * it. 582 * 583 * The caller owns the returned item and is responsible for deleting it. 584 * 585 * @param n the index of the item to remove. 586 * 587 * @see size() 588 */ public new remove(long n)589 SBase remove(long n) { 590 SBase ret = (SBase) libsbml.DowncastSBase(libsbmlPINVOKE.ListOf_remove(swigCPtr, n), true); 591 return ret; 592 } 593 594 595 /** 596 * Returns number of items in this ListOf list. 597 * 598 * @return the number of items in this ListOf items. 599 */ public size()600 long size() { return (long)libsbmlPINVOKE.ListOf_size(swigCPtr); } 601 connectToChild()602 public override void connectToChild() { 603 libsbmlPINVOKE.ListOf_connectToChild(swigCPtr); 604 } 605 606 607 /** 608 * Returns the libSBML type code for this object, namely, 609 * @link libsbml#SBML_LIST_OF SBML_LIST_OF@endlink. 610 * 611 * 612 * 613 * LibSBML attaches an identifying code to every kind of SBML object. These 614 * are integer constants known as <em>SBML type codes</em>. The names of all 615 * the codes begin with the characters <code>SBML_</code>. 616 * @if clike The set of possible type codes for core elements is defined in 617 * the enumeration #SBMLTypeCode_t, and in addition, libSBML plug-ins for 618 * SBML Level 3 packages define their own extra enumerations of type 619 * codes (e.g., #SBMLLayoutTypeCode_t for the Level 3 Layout 620 * package).@endif@if java In the Java language interface for libSBML, the 621 * type codes are defined as static integer constants in the interface class 622 * {@link libsbmlConstants}. @endif@if python In the Python language 623 * interface for libSBML, the type codes are defined as static integer 624 * constants in the interface class @link libsbml@endlink.@endif@if csharp In 625 * the C# language interface for libSBML, the type codes are defined as 626 * static integer constants in the interface class 627 * @link libsbmlcs.libsbml@endlink.@endif Note that different Level 3 628 * package plug-ins may use overlapping type codes; to identify the package 629 * to which a given object belongs, call the 630 * <code>@if conly SBase_getPackageName() 631 * @else SBase::getPackageName() 632 * @endif</code> 633 * method on the object. 634 * 635 * The exception to this is lists: all SBML-style list elements have the type 636 * @link libsbml#SBML_LIST_OF SBML_LIST_OF@endlink, regardless of what package they 637 * are from. 638 * 639 * 640 * 641 * @return the SBML type code for this object: 642 * @link libsbml#SBML_LIST_OF SBML_LIST_OF@endlink (default). 643 * 644 * @note The various ListOf classes mostly differ from each other in what they 645 * contain. Hence, one must call getItemTypeCode() to fully determine the 646 * class of this SBML object. 647 * 648 * 649 * @warning <span class='warning'>The specific integer values of the possible 650 * type codes may be reused by different libSBML plug-ins for SBML Level 3. 651 * packages, To fully identify the correct code, <strong>it is necessary to 652 * invoke both getPackageName() and getTypeCode()</strong> (or 653 * ListOf::getItemTypeCode()).</span> 654 * 655 * 656 * 657 * @see getItemTypeCode() 658 * @see getElementName() 659 * @see getPackageName() 660 */ public new getTypeCode()661 int getTypeCode() { 662 int ret = libsbmlPINVOKE.ListOf_getTypeCode(swigCPtr); 663 return ret; 664 } 665 666 667 /** 668 * Get the type code of the objects contained in this ListOf. 669 * 670 * 671 * 672 * LibSBML attaches an identifying code to every kind of SBML object. These 673 * are integer constants known as <em>SBML type codes</em>. The names of all 674 * the codes begin with the characters <code>SBML_</code>. 675 * @if clike The set of possible type codes for core elements is defined in 676 * the enumeration #SBMLTypeCode_t, and in addition, libSBML plug-ins for 677 * SBML Level 3 packages define their own extra enumerations of type 678 * codes (e.g., #SBMLLayoutTypeCode_t for the Level 3 Layout 679 * package).@endif@if java In the Java language interface for libSBML, the 680 * type codes are defined as static integer constants in the interface class 681 * {@link libsbmlConstants}. @endif@if python In the Python language 682 * interface for libSBML, the type codes are defined as static integer 683 * constants in the interface class @link libsbml@endlink.@endif@if csharp In 684 * the C# language interface for libSBML, the type codes are defined as 685 * static integer constants in the interface class 686 * @link libsbmlcs.libsbml@endlink.@endif Note that different Level 3 687 * package plug-ins may use overlapping type codes; to identify the package 688 * to which a given object belongs, call the 689 * <code>@if conly SBase_getPackageName() 690 * @else SBase::getPackageName() 691 * @endif</code> 692 * method on the object. 693 * 694 * The exception to this is lists: all SBML-style list elements have the type 695 * @link libsbml#SBML_LIST_OF SBML_LIST_OF@endlink, regardless of what package they 696 * are from. 697 * 698 * 699 * 700 * Classes that inherit from the ListOf class should override this method 701 * to return the SBML type code for the objects contained in this ListOf. 702 * If they do not, this method will return 703 * @link libsbml#SBML_UNKNOWN SBML_UNKNOWN@endlink 704 * 705 * @return The ListOf base class contains no SBML objects, and therefore 706 * this method returns @link libsbml#SBML_UNKNOWN SBML_UNKNOWN@endlink. 707 * 708 * @see getElementName() 709 * @see getPackageName() 710 */ public new getItemTypeCode()711 int getItemTypeCode() { 712 int ret = libsbmlPINVOKE.ListOf_getItemTypeCode(swigCPtr); 713 return ret; 714 } 715 716 717 /** 718 * Returns the XML element name of this object, which for ListOf, is 719 * always @c 'listOf'. 720 * 721 * @return the XML name of this element. 722 */ public new getElementName()723 string getElementName() { 724 string ret = libsbmlPINVOKE.ListOf_getElementName(swigCPtr); 725 return ret; 726 } 727 728 729 /** */ /* libsbml-internal */ public new enablePackageInternal(string pkgURI, string pkgPrefix, bool flag)730 void enablePackageInternal(string pkgURI, string pkgPrefix, bool flag) { 731 libsbmlPINVOKE.ListOf_enablePackageInternal(swigCPtr, pkgURI, pkgPrefix, flag); 732 } 733 734 735 /** */ /* libsbml-internal */ public new updateSBMLNamespace(string package, long level, long version)736 void updateSBMLNamespace(string package, long level, long version) { 737 libsbmlPINVOKE.ListOf_updateSBMLNamespace(swigCPtr, package, level, version); 738 } 739 740 741 /** */ /* libsbml-internal */ public new hasOptionalElements()742 bool hasOptionalElements() { 743 bool ret = libsbmlPINVOKE.ListOf_hasOptionalElements(swigCPtr); 744 return ret; 745 } 746 747 748 /** */ /* libsbml-internal */ public isExplicitlyListed()749 bool isExplicitlyListed() { 750 bool ret = libsbmlPINVOKE.ListOf_isExplicitlyListed(swigCPtr); 751 return ret; 752 } 753 754 755 /** */ /* libsbml-internal */ public setExplicitlyListed(bool value)756 void setExplicitlyListed(bool value) { 757 libsbmlPINVOKE.ListOf_setExplicitlyListed__SWIG_0(swigCPtr, value); 758 } 759 760 761 /** */ /* libsbml-internal */ public setExplicitlyListed()762 void setExplicitlyListed() { 763 libsbmlPINVOKE.ListOf_setExplicitlyListed__SWIG_1(swigCPtr); 764 } 765 766 767 /** */ /* libsbml-internal */ public sort()768 void sort() { 769 libsbmlPINVOKE.ListOf_sort(swigCPtr); 770 } 771 772 } 773 774 } 775