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-multi"><a href="group__multi.html">multi</a></span> 013 Extension of {@link Species} for the 'multi' package. 014 <p> 015 * The {@link MultiSpeciesPlugin} class extends the {@link Species} class to have a new 016 * attribute 'speciesType', and two extra optional {@link ListOfOutwardBindingSites} 017 * and {@link ListOfSpeciesFeatures} children. A species may have a 018 * {@link ListOfOutwardBindingSites} child and/or a {@link ListOfSpeciesFeatures} child only 019 * when its speciesType attribute has been defined. The relationship among 020 * the elements of a {@link ListOfOutwardBindingSites} or a {@link ListOfSpeciesFeatures} is 021 * 'and'. 022 */ 023 024public class MultiSpeciesPlugin extends SBasePlugin { 025 private long swigCPtr; 026 027 protected MultiSpeciesPlugin(long cPtr, boolean cMemoryOwn) 028 { 029 super(libsbmlJNI.MultiSpeciesPlugin_SWIGUpcast(cPtr), cMemoryOwn); 030 swigCPtr = cPtr; 031 } 032 033 protected static long getCPtr(MultiSpeciesPlugin obj) 034 { 035 return (obj == null) ? 0 : obj.swigCPtr; 036 } 037 038 protected static long getCPtrAndDisown (MultiSpeciesPlugin obj) 039 { 040 long ptr = 0; 041 042 if (obj != null) 043 { 044 ptr = obj.swigCPtr; 045 obj.swigCMemOwn = false; 046 } 047 048 return ptr; 049 } 050 051 protected void finalize() { 052 delete(); 053 } 054 055 public synchronized void delete() { 056 if (swigCPtr != 0) { 057 if (swigCMemOwn) { 058 swigCMemOwn = false; 059 libsbmlJNI.delete_MultiSpeciesPlugin(swigCPtr); 060 } 061 swigCPtr = 0; 062 } 063 super.delete(); 064 } 065 066 067/** 068 * Creates a new {@link MultiSpeciesPlugin} object. 069 <p> 070 * <p> 071 * In the XML representation of an SBML document, XML namespaces are used to 072 * identify the origin of each XML construct used. XML namespaces are 073 * identified by their unique resource identifiers (URIs). The core SBML 074 * specifications stipulate the namespaces that must be used for core SBML 075 * constructs; for example, all XML elements that belong to SBML Level 3 076 * Version 1 Core must be placed in the XML namespace identified by the URI 077 * <code>'http://www.sbml.org/sbml/level3/version1/core'</code>. Individual 078 * SBML Level 3 packages define their own XML namespaces; for example, 079 * all elements belonging to the SBML Level 3 Layout Version 1 080 * package must be placed in the XML namespace 081 * <code>'http://www.sbml.org/sbml/level3/version1/layout/version1/'</code>. 082 <p> 083 * <p> 084 * The {@link SBMLNamespaces} object encapsulates SBML Level/Version/namespaces 085 * information. It is used to communicate the SBML Level, Version, and (in 086 * Level 3) packages used in addition to SBML Level 3 Core. A 087 * common approach to using libSBML's {@link SBMLNamespaces} facilities is to create an 088 * {@link SBMLNamespaces} object somewhere in a program once, then hand that object 089 * as needed to object constructors that accept {@link SBMLNamespaces} as arguments. 090 <p> 091 * @param uri the URI of the SBML Level 3 package implemented by 092 * this libSBML package extension. 093 <p> 094 * @param prefix the XML namespace prefix being used for the package. 095 <p> 096 * @param multins the namespaces object for the package. 097 */ public 098 MultiSpeciesPlugin(String uri, String prefix, MultiPkgNamespaces multins) { 099 this(libsbmlJNI.new_MultiSpeciesPlugin__SWIG_0(uri, prefix, MultiPkgNamespaces.getCPtr(multins), multins), true); 100 } 101 102 103/** 104 * Copy constructor for {@link MultiSpeciesPlugin}. 105 <p> 106 * @param orig the {@link MultiSpeciesPlugin} instance to copy. 107 */ public 108 MultiSpeciesPlugin(MultiSpeciesPlugin orig) { 109 this(libsbmlJNI.new_MultiSpeciesPlugin__SWIG_1(MultiSpeciesPlugin.getCPtr(orig), orig), true); 110 } 111 112 113/** 114 * Creates and returns a deep copy of this {@link MultiSpeciesPlugin} object. 115 <p> 116 * @return a (deep) copy of this {@link MultiSpeciesPlugin} object. 117 */ public 118 SBasePlugin cloneObject() { 119 long cPtr = libsbmlJNI.MultiSpeciesPlugin_cloneObject(swigCPtr, this); 120 return (cPtr == 0) ? null : new MultiSpeciesPlugin(cPtr, true); 121 } 122 123 124/** * @internal */ public 125 SBase createObject(XMLInputStream stream) { 126 return libsbml.DowncastSBase(libsbmlJNI.MultiSpeciesPlugin_createObject(swigCPtr, this, XMLInputStream.getCPtr(stream), stream), false); 127} 128 129 130/** 131 * Returns <code>true</code> if this object has all the required elements. 132 <p> 133 * @return <code>true</code> if this object has all the elements required by the 134 * package specification; otherwise, <code>false</code> will be returned. 135 */ public 136 boolean hasRequiredElements() { 137 return libsbmlJNI.MultiSpeciesPlugin_hasRequiredElements(swigCPtr, this); 138 } 139 140 141/** 142 * Returns the value of the 'speciesType' attribute of this 'multi' {@link Species}. 143 <p> 144 * @return the value of the 'speciesType' attribute. 145 */ public 146 String getSpeciesType() { 147 return libsbmlJNI.MultiSpeciesPlugin_getSpeciesType(swigCPtr, this); 148 } 149 150 151/** 152 * Returns <code>true</code> if the 'speciesType' attribute of this 'multi' {@link Species} 153 * has been set. 154 <p> 155 * @return <code>true</code> if this SpeciesPlugin's 'speciesType' attribute has been set, 156 * otherwise <code>false</code> is returned. 157 */ public 158 boolean isSetSpeciesType() { 159 return libsbmlJNI.MultiSpeciesPlugin_isSetSpeciesType(swigCPtr, this); 160 } 161 162 163/** 164 * Sets the value of the 'speciesType' attribute on this 'multi' {@link Species}. 165 <p> 166 * @param speciesType the new value for the attribute. 167 <p> 168 * <p> 169 * @return integer value indicating success/failure of the 170 * function. The possible values 171 * returned by this function are: 172 * <ul> 173 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 174 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 175 * </ul> 176 */ public 177 int setSpeciesType(String speciesType) { 178 return libsbmlJNI.MultiSpeciesPlugin_setSpeciesType(swigCPtr, this, speciesType); 179 } 180 181 182/** 183 * Unsets the value of the 'speciesType' attribute on this 'multi' {@link Species}. 184 <p> 185 * <p> 186 * @return integer value indicating success/failure of the 187 * function. The possible values 188 * returned by this function are: 189 * <ul> 190 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 191 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 192 * </ul> 193 */ public 194 int unsetSpeciesType() { 195 return libsbmlJNI.MultiSpeciesPlugin_unsetSpeciesType(swigCPtr, this); 196 } 197 198 199/** 200 * Returns the {@link ListOfOutwardBindingSites} of this 'multi' {@link Species}. 201 <p> 202 * @return the {@link ListOfOutwardBindingSites} object. 203 */ public 204 ListOfOutwardBindingSites getListOfOutwardBindingSites() { 205 long cPtr = libsbmlJNI.MultiSpeciesPlugin_getListOfOutwardBindingSites__SWIG_0(swigCPtr, this); 206 return (cPtr == 0) ? null : new ListOfOutwardBindingSites(cPtr, false); 207 } 208 209 210/** 211 * Returns the nth {@link OutwardBindingSite} object. 212 <p> 213 * @param n the index number of the {@link OutwardBindingSite} to get 214 <p> 215 * @return the nth {@link OutwardBindingSite} in the {@link ListOfOutwardBindingSites}. If 216 * the index is invalid, null is returned. 217 */ public 218 OutwardBindingSite getOutwardBindingSite(long n) { 219 long cPtr = libsbmlJNI.MultiSpeciesPlugin_getOutwardBindingSite__SWIG_0(swigCPtr, this, n); 220 return (cPtr == 0) ? null : new OutwardBindingSite(cPtr, false); 221 } 222 223 224/** 225 * Returns the {@link OutwardBindingSite} object with the given identifier <code>sid</code>. 226 <p> 227 * @param sid a string representing the id of the {@link OutwardBindingSite} to get. 228 <p> 229 * @return {@link OutwardBindingSite} in the {@link ListOfOutwardBindingSites} with the given id 230 * or <code>null</code> if no such {@link OutwardBindingSite} exists. 231 */ public 232 OutwardBindingSite getOutwardBindingSite(String sid) { 233 long cPtr = libsbmlJNI.MultiSpeciesPlugin_getOutwardBindingSite__SWIG_2(swigCPtr, this, sid); 234 return (cPtr == 0) ? null : new OutwardBindingSite(cPtr, false); 235 } 236 237 238/** 239 * Adds a copy of the given {@link OutwardBindingSite} to the 240 * {@link ListOfOutwardBindingSites}. 241 <p> 242 * @param outwardBindingSite the outwardBindingSite to be added. 243 <p> 244 * <p> 245 * @return integer value indicating success/failure of the 246 * function. The possible values 247 * returned by this function are: 248 * <ul> 249 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 250 * </ul> 251 */ public 252 int addOutwardBindingSite(OutwardBindingSite outwardBindingSite) { 253 return libsbmlJNI.MultiSpeciesPlugin_addOutwardBindingSite(swigCPtr, this, OutwardBindingSite.getCPtr(outwardBindingSite), outwardBindingSite); 254 } 255 256 257/** 258 * Creates a new {@link OutwardBindingSite} object and adds it to the 259 * {@link ListOfOutwardBindingSites}. 260 <p> 261 * @return the newly created {@link OutwardBindingSite} object. 262 */ public 263 OutwardBindingSite createOutwardBindingSite() { 264 long cPtr = libsbmlJNI.MultiSpeciesPlugin_createOutwardBindingSite(swigCPtr, this); 265 return (cPtr == 0) ? null : new OutwardBindingSite(cPtr, false); 266 } 267 268 269/** 270 * Removes the nth {@link OutwardBindingSite} object and returns a pointer to it. 271 <p> 272 * @param n the index of the {@link OutwardBindingSite} to remove. 273 <p> 274 * @return the {@link OutwardBindingSite} object removed or <code>null</code> index was out of 275 * range. Note that the caller owns the returned object and is responsible 276 * for deleting it. 277 */ public 278 OutwardBindingSite removeOutwardBindingSite(long n) { 279 long cPtr = libsbmlJNI.MultiSpeciesPlugin_removeOutwardBindingSite__SWIG_0(swigCPtr, this, n); 280 return (cPtr == 0) ? null : new OutwardBindingSite(cPtr, true); 281 } 282 283 284/** 285 * Removes the {@link OutwardBindingSite} object with the given id <code>sid</code> and 286 * returns a pointer to it. 287 <p> 288 * @param sid a string representing the id of the {@link OutwardBindingSite} to remove. 289 <p> 290 * @return the {@link OutwardBindingSite} object removed or <code>null</code> index was out of 291 * range. Note that the caller owns the returned object and is responsible 292 * for deleting it. 293 */ public 294 OutwardBindingSite removeOutwardBindingSite(String sid) { 295 long cPtr = libsbmlJNI.MultiSpeciesPlugin_removeOutwardBindingSite__SWIG_1(swigCPtr, this, sid); 296 return (cPtr == 0) ? null : new OutwardBindingSite(cPtr, true); 297 } 298 299 300/** 301 * Returns the number of {@link OutwardBindingSite} objects of this 'multi' {@link Species}. 302 <p> 303 * @return the number of {@link OutwardBindingSite} objects in this plugin object. 304 */ public 305 long getNumOutwardBindingSites() { 306 return libsbmlJNI.MultiSpeciesPlugin_getNumOutwardBindingSites(swigCPtr, this); 307 } 308 309 310/** 311 * Returns the {@link ListOfSpeciesFeatures} of this 'multi' {@link Species}. 312 <p> 313 * @return {@link ListOfSpeciesFeatures} object in this plugin object. 314 */ public 315 ListOfSpeciesFeatures getListOfSpeciesFeatures() { 316 long cPtr = libsbmlJNI.MultiSpeciesPlugin_getListOfSpeciesFeatures__SWIG_0(swigCPtr, this); 317 return (cPtr == 0) ? null : new ListOfSpeciesFeatures(cPtr, false); 318 } 319 320 321/** 322 * Returns the nth {@link SpeciesFeature} object. 323 <p> 324 * @param n the index number of the {@link SpeciesFeature} to get. 325 <p> 326 * @return the nth {@link SpeciesFeature} in the {@link ListOfSpeciesFeatures}. If the 327 * index is invalid, null is returned. 328 */ public 329 SpeciesFeature getSpeciesFeature(long n) { 330 long cPtr = libsbmlJNI.MultiSpeciesPlugin_getSpeciesFeature__SWIG_0(swigCPtr, this, n); 331 return (cPtr == 0) ? null : new SpeciesFeature(cPtr, false); 332 } 333 334 335/** 336 * Returns the {@link SpeciesFeature} object with the given identifier <code>sid</code>. 337 <p> 338 * @param sid a string representing the id of the {@link SpeciesFeature} to get 339 <p> 340 * @return {@link SpeciesFeature} in the {@link ListOfSpeciesFeatures} with the given id 341 * <code>sid</code>, or <code>null</code> if no such {@link SpeciesFeature} exists. 342 */ public 343 SpeciesFeature getSpeciesFeature(String sid) { 344 long cPtr = libsbmlJNI.MultiSpeciesPlugin_getSpeciesFeature__SWIG_2(swigCPtr, this, sid); 345 return (cPtr == 0) ? null : new SpeciesFeature(cPtr, false); 346 } 347 348 349/** 350 * Adds a copy of the given {@link SpeciesFeature} to the {@link ListOfSpeciesFeatures} of 351 * this 'multi' {@link Species}. 352 <p> 353 * @param speciesFeature the {@link SpeciesFeature} to be added. 354 <p> 355 * <p> 356 * @return integer value indicating success/failure of the 357 * function. The possible values 358 * returned by this function are: 359 * <ul> 360 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 361 * </ul> 362 */ public 363 int addSpeciesFeature(SpeciesFeature speciesFeature) { 364 return libsbmlJNI.MultiSpeciesPlugin_addSpeciesFeature(swigCPtr, this, SpeciesFeature.getCPtr(speciesFeature), speciesFeature); 365 } 366 367 368/** 369 * Creates a new {@link SpeciesFeature} object and adds it to the 370 * {@link ListOfSpeciesFeatures} of this 'multi' {@link Species}. 371 <p> 372 * @return the newly created {@link SpeciesFeature} object. 373 */ public 374 SpeciesFeature createSpeciesFeature() { 375 long cPtr = libsbmlJNI.MultiSpeciesPlugin_createSpeciesFeature(swigCPtr, this); 376 return (cPtr == 0) ? null : new SpeciesFeature(cPtr, false); 377 } 378 379 380/** 381 * Returns the nth {@link SubListOfSpeciesFeatures} object. 382 <p> 383 * @param n the index number of the {@link SubListOfSpeciesFeatures} to get 384 <p> 385 * @return the nth {@link SubListOfSpeciesFeatures} in the {@link ListOfSpeciesFeatures}. 386 * If the index is invalid, null is returned. 387 */ public 388 SubListOfSpeciesFeatures getSubListOfSpeciesFeatures(long n) { 389 long cPtr = libsbmlJNI.MultiSpeciesPlugin_getSubListOfSpeciesFeatures__SWIG_0(swigCPtr, this, n); 390 return (cPtr == 0) ? null : new SubListOfSpeciesFeatures(cPtr, false); 391 } 392 393 394/** 395 * Returns the {@link SubListOfSpeciesFeatures} object with the given identifier <code>sid</code>. 396 <p> 397 * @param sid the id of the {@link SubListOfSpeciesFeatures} to get. 398 <p> 399 * @return {@link SubListOfSpeciesFeatures} in the {@link ListOfSpeciesFeatures} with the 400 * given id <code>sid</code>, or <code>null</code> if no such {@link SubListOfSpeciesFeatures} exists. 401 */ public 402 SubListOfSpeciesFeatures getSubListOfSpeciesFeatures(String sid) { 403 long cPtr = libsbmlJNI.MultiSpeciesPlugin_getSubListOfSpeciesFeatures__SWIG_2(swigCPtr, this, sid); 404 return (cPtr == 0) ? null : new SubListOfSpeciesFeatures(cPtr, false); 405 } 406 407 408/** 409 * Adds a copy of the given {@link SubListOfSpeciesFeatures} to the 410 * {@link ListOfSpeciesFeatures}. 411 <p> 412 * @param subListOfSpeciesFeatures the {@link SubListOfSpeciesFeatures} to be added. 413 <p> 414 * <p> 415 * @return integer value indicating success/failure of the 416 * function. The possible values 417 * returned by this function are: 418 * <ul> 419 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 420 * </ul> 421 */ public 422 int addSubListOfSpeciesFeatures(SubListOfSpeciesFeatures subListOfSpeciesFeatures) { 423 return libsbmlJNI.MultiSpeciesPlugin_addSubListOfSpeciesFeatures(swigCPtr, this, SubListOfSpeciesFeatures.getCPtr(subListOfSpeciesFeatures), subListOfSpeciesFeatures); 424 } 425 426 427/** 428 * Creates a new {@link SubListOfSpeciesFeatures} object and adds it to the 429 * {@link SubListOfSpeciesFeatures}. 430 <p> 431 * @return the newly created {@link SubListOfSpeciesFeatures} object. 432 */ public 433 SubListOfSpeciesFeatures createSubListOfSpeciesFeatures() { 434 long cPtr = libsbmlJNI.MultiSpeciesPlugin_createSubListOfSpeciesFeatures(swigCPtr, this); 435 return (cPtr == 0) ? null : new SubListOfSpeciesFeatures(cPtr, false); 436 } 437 438 439/** 440 * Removes the nth {@link SpeciesFeature} object and returns a pointer to it. 441 <p> 442 * @param n the index of the {@link SpeciesFeature} to remove. 443 <p> 444 * @return the {@link SpeciesFeature} object removed or <code>null</code> index was out of 445 * range. Note that the caller owns the returned object and is responsible 446 * for deleting it. 447 */ public 448 SpeciesFeature removeSpeciesFeature(long n) { 449 long cPtr = libsbmlJNI.MultiSpeciesPlugin_removeSpeciesFeature__SWIG_0(swigCPtr, this, n); 450 return (cPtr == 0) ? null : new SpeciesFeature(cPtr, true); 451 } 452 453 454/** 455 * Removes the {@link SpeciesFeature} object with the given identifier <code>sid</code>. 456 <p> 457 * @param sid a string representing the id of the {@link SpeciesFeature} to get. 458 <p> 459 * @return the {@link SpeciesFeature} object removed or <code>null</code> index was out of 460 * range. Note that the caller owns the returned object and is responsible 461 * for deleting it. 462 */ public 463 SpeciesFeature removeSpeciesFeature(String sid) { 464 long cPtr = libsbmlJNI.MultiSpeciesPlugin_removeSpeciesFeature__SWIG_1(swigCPtr, this, sid); 465 return (cPtr == 0) ? null : new SpeciesFeature(cPtr, true); 466 } 467 468 469/** 470 * Returns the number of {@link SpeciesFeature} objects of this 'multi' {@link Species}. 471 <p> 472 * @return the number of {@link SpeciesFeature} objects in this plugin object. 473 */ public 474 long getNumSpeciesFeatures() { 475 return libsbmlJNI.MultiSpeciesPlugin_getNumSpeciesFeatures(swigCPtr, this); 476 } 477 478 479/** 480 * Returns the number of {@link SubListOfSpeciesFeatures} objects of this 'multi' {@link Species}. 481 <p> 482 * @return the number of {@link SubListOfSpeciesFeatures} objects in this plugin object. 483 */ public 484 long getNumSubListOfSpeciesFeatures() { 485 return libsbmlJNI.MultiSpeciesPlugin_getNumSubListOfSpeciesFeatures(swigCPtr, this); 486 } 487 488 489/** * @internal */ public 490 void connectToParent(SBase sbase) { 491 libsbmlJNI.MultiSpeciesPlugin_connectToParent(swigCPtr, this, SBase.getCPtr(sbase), sbase); 492 } 493 494 495/** * @internal */ public 496 void connectToChild() { 497 libsbmlJNI.MultiSpeciesPlugin_connectToChild(swigCPtr, this); 498 } 499 500 501/** * @internal */ public 502 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) { 503 libsbmlJNI.MultiSpeciesPlugin_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag); 504 } 505 506}