001/* ----------------------------------------------------------------------------
002 * This file was automatically generated by SWIG (http://www.swig.org).
003 * Version 3.0.7
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 transition of a {@link QualitativeSpecies}.
015 <p>
016 * A {@link Transition} element contains at most one {@link ListOfInputs} and one
017 * {@link ListOfOutputs} and exactly one {@link ListOfFunctionTerms}.
018 <p>
019 * A {@link Transition} defines the changes in level associated with the
020 * {@link QualitativeSpecies} that occur when a {@link Transition} is enabled.
021 <p>
022 * In logical models, a {@link Transition} is used to specify the logical rule
023 * associated with a {@link QualitativeSpecies} (that appears as an {@link Output} of this
024 * {@link Transition}). For example, the rule 'if A > 1 : B = 2' would be
025 * encapsulated as a {@link Transition} with {@link QualitativeSpecies} 'A' as an {@link Input} and
026 * 'B' as an {@link Output}; the 'if A > 1' rule being encode by the math element of
027 * a {@link FunctionTerm} with the resultLevel attribute having a value '2'.
028 <p>
029 * In Petri net models, a {@link Transition} is interpreted, using the common Petri
030 * net semantics, as events that might occur within the system causing tokens
031 * to be moved.
032 */
033
034public class Transition extends SBase {
035   private long swigCPtr;
036
037   protected Transition(long cPtr, boolean cMemoryOwn)
038   {
039     super(libsbmlJNI.Transition_SWIGUpcast(cPtr), cMemoryOwn);
040     swigCPtr = cPtr;
041   }
042
043   protected static long getCPtr(Transition obj)
044   {
045     return (obj == null) ? 0 : obj.swigCPtr;
046   }
047
048   protected static long getCPtrAndDisown (Transition obj)
049   {
050     long ptr = 0;
051
052     if (obj != null)
053     {
054       ptr             = obj.swigCPtr;
055       obj.swigCMemOwn = false;
056     }
057
058     return ptr;
059   }
060
061  protected void finalize() {
062    delete();
063  }
064
065  public synchronized void delete() {
066    if (swigCPtr != 0) {
067      if (swigCMemOwn) {
068        swigCMemOwn = false;
069        libsbmlJNI.delete_Transition(swigCPtr);
070      }
071      swigCPtr = 0;
072    }
073    super.delete();
074  }
075
076  
077/**
078   * Creates a new {@link Transition} with the given level, version, and package version.
079   <p>
080   * @param level a long integer, the SBML Level to assign to this {@link Transition}
081   <p>
082   * @param version a long integer, the SBML Version to assign to this {@link Transition}
083   <p>
084   * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link Transition}
085   */ public
086 Transition(long level, long version, long pkgVersion) throws org.sbml.libsbml.SBMLConstructorException {
087    this(libsbmlJNI.new_Transition__SWIG_0(level, version, pkgVersion), true);
088  }
089
090  
091/**
092   * Creates a new {@link Transition} with the given level, version, and package version.
093   <p>
094   * @param level a long integer, the SBML Level to assign to this {@link Transition}
095   <p>
096   * @param version a long integer, the SBML Version to assign to this {@link Transition}
097   <p>
098   * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link Transition}
099   */ public
100 Transition(long level, long version) throws org.sbml.libsbml.SBMLConstructorException {
101    this(libsbmlJNI.new_Transition__SWIG_1(level, version), true);
102  }
103
104  
105/**
106   * Creates a new {@link Transition} with the given level, version, and package version.
107   <p>
108   * @param level a long integer, the SBML Level to assign to this {@link Transition}
109   <p>
110   * @param version a long integer, the SBML Version to assign to this {@link Transition}
111   <p>
112   * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link Transition}
113   */ public
114 Transition(long level) throws org.sbml.libsbml.SBMLConstructorException {
115    this(libsbmlJNI.new_Transition__SWIG_2(level), true);
116  }
117
118  
119/**
120   * Creates a new {@link Transition} with the given level, version, and package version.
121   <p>
122   * @param level a long integer, the SBML Level to assign to this {@link Transition}
123   <p>
124   * @param version a long integer, the SBML Version to assign to this {@link Transition}
125   <p>
126   * @param pkgVersion a long integer, the SBML Qual Version to assign to this {@link Transition}
127   */ public
128 Transition() throws org.sbml.libsbml.SBMLConstructorException {
129    this(libsbmlJNI.new_Transition__SWIG_3(), true);
130  }
131
132  
133/**
134   * Creates a new {@link Transition} with the given {@link QualPkgNamespaces} object.
135   <p>
136   * @param qualns the {@link QualPkgNamespaces} object
137   */ public
138 Transition(QualPkgNamespaces qualns) throws org.sbml.libsbml.SBMLConstructorException {
139    this(libsbmlJNI.new_Transition__SWIG_4(QualPkgNamespaces.getCPtr(qualns), qualns), true);
140  }
141
142  
143/**
144   * Copy constructor for {@link Transition}.
145   <p>
146   * @param orig the {@link Transition} instance to copy.
147   */ public
148 Transition(Transition orig) throws org.sbml.libsbml.SBMLConstructorException {
149    this(libsbmlJNI.new_Transition__SWIG_5(Transition.getCPtr(orig), orig), true);
150  }
151
152  
153/**
154   * Creates and returns a deep copy of this {@link Transition} object.
155   <p>
156   * @return a (deep) copy of this {@link Transition} object.
157   */ public
158 Transition cloneObject() {
159    long cPtr = libsbmlJNI.Transition_cloneObject(swigCPtr, this);
160    return (cPtr == 0) ? null : new Transition(cPtr, true);
161  }
162
163  
164/**
165   * Returns the first child element found that has the given <code>id</code> 
166   * in the model-wide SId namespace, or <code>null</code> if no such object is found.
167   <p>
168   * @param id string representing the id of objects to find
169   <p>
170   * @return a pointer to the {@link SBase} element with the given <code>id</code>.
171   */ public
172 SBase getElementBySId(String id) {
173  return libsbml.DowncastSBase(libsbmlJNI.Transition_getElementBySId(swigCPtr, this, id), false);
174}
175
176  
177/**
178   * Returns the first child element it can find with the given <code>metaid</code>, 
179   * or itself if it has the given <code>metaid</code>, or <code>null</code> if no such object 
180   * is found.
181   <p>
182   * @param metaid string representing the metaid of objects to find
183   <p>
184   * @return a pointer to the {@link SBase} element with the given <code>metaid</code>.
185   */ public
186 SBase getElementByMetaId(String metaid) {
187  return libsbml.DowncastSBase(libsbmlJNI.Transition_getElementByMetaId(swigCPtr, this, metaid), false);
188}
189
190  
191/**
192   * Returns the value of the 'id' attribute of this {@link Transition}.
193   <p>
194   * @return the value of the 'id' attribute of this {@link Transition} as a string.
195   */ public
196 String getId() {
197    return libsbmlJNI.Transition_getId(swigCPtr, this);
198  }
199
200  
201/**
202   * Returns the value of the 'name' attribute of this {@link Transition}.
203   <p>
204   * @return the value of the 'name' attribute of this {@link Transition} as a string.
205   */ public
206 String getName() {
207    return libsbmlJNI.Transition_getName(swigCPtr, this);
208  }
209
210  
211/**
212   * Predicate returning <code>true</code> or <code>false</code> depending on whether this
213   * {@link Transition}'s 'id' attribute has been set.
214   <p>
215   * @return <code>true</code> if this {@link Transition}'s 'id' attribute has been set,
216   * otherwise <code>false</code> is returned.
217   */ public
218 boolean isSetId() {
219    return libsbmlJNI.Transition_isSetId(swigCPtr, this);
220  }
221
222  
223/**
224   * Predicate returning <code>true</code> or <code>false</code> depending on whether this
225   * {@link Transition}'s 'name' attribute has been set.
226   <p>
227   * @return <code>true</code> if this {@link Transition}'s 'name' attribute has been set,
228   * otherwise <code>false</code> is returned.
229   */ public
230 boolean isSetName() {
231    return libsbmlJNI.Transition_isSetName(swigCPtr, this);
232  }
233
234  
235/**
236   * Sets the value of the 'id' attribute of this {@link Transition}.
237   <p>
238   * @param id String value of the 'id' attribute to be set
239   <p>
240   * <p>
241 * @return integer value indicating success/failure of the
242 * function.   The possible values
243 * returned by this function are:
244   * <ul>
245   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
246   * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
247   * </ul>
248   */ public
249 int setId(String id) {
250    return libsbmlJNI.Transition_setId(swigCPtr, this, id);
251  }
252
253  
254/**
255   * Sets the value of the 'name' attribute of this {@link Transition}.
256   <p>
257   * @param name String value of the 'name' attribute to be set
258   <p>
259   * <p>
260 * @return integer value indicating success/failure of the
261 * function.   The possible values
262 * returned by this function are:
263   * <ul>
264   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
265   * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
266   * </ul>
267   */ public
268 int setName(String name) {
269    return libsbmlJNI.Transition_setName(swigCPtr, this, name);
270  }
271
272  
273/**
274   * Unsets the value of the 'id' attribute of this {@link Transition}.
275   <p>
276   * <p>
277 * @return integer value indicating success/failure of the
278 * function.   The possible values
279 * returned by this function are:
280   * <ul>
281   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
282   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
283   * </ul>
284   */ public
285 int unsetId() {
286    return libsbmlJNI.Transition_unsetId(swigCPtr, this);
287  }
288
289  
290/**
291   * Unsets the value of the 'name' attribute of this {@link Transition}.
292   <p>
293   * <p>
294 * @return integer value indicating success/failure of the
295 * function.   The possible values
296 * returned by this function are:
297   * <ul>
298   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
299   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED}
300   * </ul>
301   */ public
302 int unsetName() {
303    return libsbmlJNI.Transition_unsetName(swigCPtr, this);
304  }
305
306  
307/**
308   * Returns the  'ListOfInputs' in this {@link Transition} object.
309   <p>
310   * @return the 'ListOfInputs' attribute of this {@link Transition}.
311   */ public
312 ListOfInputs getListOfInputs() {
313    long cPtr = libsbmlJNI.Transition_getListOfInputs__SWIG_0(swigCPtr, this);
314    return (cPtr == 0) ? null : new ListOfInputs(cPtr, false);
315  }
316
317  
318/**
319   * Get a {@link Input} from the {@link ListOfInputs}.
320   <p>
321   * @param n the index number of the {@link Input} to get.
322   <p>
323   * @return the nth {@link Input} in the {@link ListOfInputs} within this {@link Transition}.
324   <p>
325   * @see #getNumInputs()
326   */ public
327 Input getInput(long n) {
328    long cPtr = libsbmlJNI.Transition_getInput__SWIG_0(swigCPtr, this, n);
329    return (cPtr == 0) ? null : new Input(cPtr, false);
330  }
331
332  
333/**
334   * Get a {@link Input} from the {@link ListOfInputs}
335   * based on its identifier.
336   <p>
337   * @param sid a string representing the identifier
338   * of the {@link Input} to get.
339   <p>
340   * @return the {@link Input} in the {@link ListOfInputs}
341   * with the given id or null if no such
342   * {@link Input} exists.
343   <p>
344   * @see #getInput(long n)
345   * @see #getNumInputs()
346   */ public
347 Input getInput(String sid) {
348    long cPtr = libsbmlJNI.Transition_getInput__SWIG_2(swigCPtr, this, sid);
349    return (cPtr == 0) ? null : new Input(cPtr, false);
350  }
351
352  
353/**
354   * Get a {@link Input} from the {@link ListOfInputs}
355   * based on its qualitativeSpecies attribute.
356   <p>
357   * @param sid a string representing the qualitativeSpecies
358   * of the {@link Input} to get.
359   <p>
360   * @return the first {@link Input} in the {@link ListOfInputs}
361   * with the given qualitativeSpecies or null if no such
362   * {@link Input} exists.
363   <p>
364   * 
365   * @see #getNumInputs()
366   <p>
367   * @see #getInput(long n)
368   */ public
369 Input getInputBySpecies(String sid) {
370    long cPtr = libsbmlJNI.Transition_getInputBySpecies__SWIG_0(swigCPtr, this, sid);
371    return (cPtr == 0) ? null : new Input(cPtr, false);
372  }
373
374  
375/**
376   * Adds a copy the given 'Input' to this {@link Transition}.
377   <p>
378   * @param i the {@link Input} object to add
379   <p>
380   * <p>
381 * @return integer value indicating success/failure of the
382 * function.   The possible values
383 * returned by this function are:
384   * <ul>
385   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
386   * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
387   * </ul>
388   */ public
389 int addInput(Input i) {
390    return libsbmlJNI.Transition_addInput(swigCPtr, this, Input.getCPtr(i), i);
391  }
392
393  
394/**
395   * Get the number of {@link Input} objects in this {@link Transition}.
396   <p>
397   * @return the number of {@link Input} objects in this {@link Transition}
398   */ public
399 long getNumInputs() {
400    return libsbmlJNI.Transition_getNumInputs(swigCPtr, this);
401  }
402
403  
404/**
405   * Creates a new {@link Input} object, adds it to this Transitions
406   * {@link ListOfInputs} and returns the {@link Input} object created. 
407   <p>
408   * @return a new {@link Input} object instance
409   <p>
410   * @see #addInput(Input i)
411   */ public
412 Input createInput() {
413    long cPtr = libsbmlJNI.Transition_createInput(swigCPtr, this);
414    return (cPtr == 0) ? null : new Input(cPtr, false);
415  }
416
417  
418/**
419   * Removes the nth {@link Input} from the {@link ListOfInputs} within this {@link Transition}.
420   * and returns a pointer to it.
421   <p>
422   * The caller owns the returned item and is responsible for deleting it.
423   <p>
424   * @param n the index of the {@link Input} to remove.
425   <p>
426   * @see #getNumInputs()
427   */ public
428 Input removeInput(long n) {
429    long cPtr = libsbmlJNI.Transition_removeInput__SWIG_0(swigCPtr, this, n);
430    return (cPtr == 0) ? null : new Input(cPtr, true);
431  }
432
433  
434/**
435   * Removes the {@link Input} with the given identifier from the {@link ListOfInputs} within this {@link Transition}
436   * and returns a pointer to it.
437   <p>
438   * The caller owns the returned item and is responsible for deleting it.
439   * If none of the items in this list have the identifier <code>sid</code>, then
440   * <code>null</code> is returned.
441   <p>
442   * @param sid the identifier of the {@link Input} to remove.
443   <p>
444   * @return the {@link Input} removed. As mentioned above, the caller owns the
445   * returned item.
446   */ public
447 Input removeInput(String sid) {
448    long cPtr = libsbmlJNI.Transition_removeInput__SWIG_1(swigCPtr, this, sid);
449    return (cPtr == 0) ? null : new Input(cPtr, true);
450  }
451
452  
453/**
454   * Returns the  'ListOfOutputs' in this {@link Transition} object.
455   <p>
456   * @return the 'ListOfOutputs' attribute of this {@link Transition}.
457   */ public
458 ListOfOutputs getListOfOutputs() {
459    long cPtr = libsbmlJNI.Transition_getListOfOutputs__SWIG_0(swigCPtr, this);
460    return (cPtr == 0) ? null : new ListOfOutputs(cPtr, false);
461  }
462
463  
464/**
465   * Get a {@link Output} from the {@link ListOfOutputs}.
466   <p>
467   * @param n the index number of the {@link Output} to get.
468   <p>
469   * @return the nth {@link Output} in the {@link ListOfOutputs} within this {@link Transition}.
470   <p>
471   * @see #getNumOutputs()
472   */ public
473 Output getOutput(long n) {
474    long cPtr = libsbmlJNI.Transition_getOutput__SWIG_0(swigCPtr, this, n);
475    return (cPtr == 0) ? null : new Output(cPtr, false);
476  }
477
478  
479/**
480   * Get a {@link Output} from the {@link ListOfOutputs}
481   * based on its identifier.
482   <p>
483   * @param sid a string representing the identifier
484   * of the {@link Output} to get.
485   <p>
486   * @return the {@link Output} in the {@link ListOfOutputs}
487   * with the given id or null if no such
488   * {@link Output} exists.
489   <p>
490   * 
491   * @see #getNumOutputs()
492   <p>
493   * @see #getOutput(long n)
494   */ public
495 Output getOutput(String sid) {
496    long cPtr = libsbmlJNI.Transition_getOutput__SWIG_2(swigCPtr, this, sid);
497    return (cPtr == 0) ? null : new Output(cPtr, false);
498  }
499
500  
501/**
502   * Get a {@link Output} from the {@link ListOfOutputs}
503   * based on its qualitativeSpecies attribute.
504   <p>
505   * @param sid a string representing the qualitativeSpecies
506   * of the {@link Output} to get.
507   <p>
508   * @return the first {@link Output} in the {@link ListOfOutputs}
509   * with the given qualitativeSpecies or null if no such
510   * {@link Output} exists.
511   <p>
512   * 
513   * @see #getNumOutputs()
514   <p>
515   * @see #getOutput(long n)
516   */ public
517 Output getOutputBySpecies(String sid) {
518    long cPtr = libsbmlJNI.Transition_getOutputBySpecies__SWIG_0(swigCPtr, this, sid);
519    return (cPtr == 0) ? null : new Output(cPtr, false);
520  }
521
522  
523/**
524   * Adds a copy the given 'Output' to this {@link Transition}.
525   <p>
526   * @param o the {@link Output} object to add
527   <p>
528   * <p>
529 * @return integer value indicating success/failure of the
530 * function.   The possible values
531 * returned by this function are:
532   * <ul>
533   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
534   * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
535   * </ul>
536   */ public
537 int addOutput(Output o) {
538    return libsbmlJNI.Transition_addOutput(swigCPtr, this, Output.getCPtr(o), o);
539  }
540
541  
542/**
543   * Get the number of {@link Output} objects in this {@link Transition}.
544   <p>
545   * @return the number of {@link Output} objects in this {@link Transition}
546   */ public
547 long getNumOutputs() {
548    return libsbmlJNI.Transition_getNumOutputs(swigCPtr, this);
549  }
550
551  
552/**
553   * Creates a new {@link Output} object, adds it to this Transitions
554   * {@link ListOfOutputs} and returns the {@link Output} object created. 
555   <p>
556   * @return a new {@link Output} object instance
557   <p>
558   * @see #addOutput(Output o)
559   */ public
560 Output createOutput() {
561    long cPtr = libsbmlJNI.Transition_createOutput(swigCPtr, this);
562    return (cPtr == 0) ? null : new Output(cPtr, false);
563  }
564
565  
566/**
567   * Removes the nth {@link Output} from the {@link ListOfOutputs} within this {@link Transition}.
568   * and returns a pointer to it.
569   <p>
570   * The caller owns the returned item and is responsible for deleting it.
571   <p>
572   * @param n the index of the {@link Output} to remove.
573   <p>
574   * @see #getNumOutputs()
575   */ public
576 Output removeOutput(long n) {
577    long cPtr = libsbmlJNI.Transition_removeOutput__SWIG_0(swigCPtr, this, n);
578    return (cPtr == 0) ? null : new Output(cPtr, true);
579  }
580
581  
582/**
583   * Removes the {@link Output} with the given identifier from the {@link ListOfOutputs} within this {@link Transition}
584   * and returns a pointer to it.
585   <p>
586   * The caller owns the returned item and is responsible for deleting it.
587   * If none of the items in this list have the identifier <code>sid</code>, then
588   * <code>null</code> is returned.
589   <p>
590   * @param sid the identifier of the {@link Output} to remove.
591   <p>
592   * @return the {@link Output} removed. As mentioned above, the caller owns the
593   * returned item.
594   */ public
595 Output removeOutput(String sid) {
596    long cPtr = libsbmlJNI.Transition_removeOutput__SWIG_1(swigCPtr, this, sid);
597    return (cPtr == 0) ? null : new Output(cPtr, true);
598  }
599
600  
601/**
602   * Returns the  'ListOfFunctionTerms' in this {@link Transition} object.
603   <p>
604   * @return the 'ListOfFunctionTerms' attribute of this {@link Transition}.
605   */ public
606 ListOfFunctionTerms getListOfFunctionTerms() {
607    long cPtr = libsbmlJNI.Transition_getListOfFunctionTerms__SWIG_0(swigCPtr, this);
608    return (cPtr == 0) ? null : new ListOfFunctionTerms(cPtr, false);
609  }
610
611  
612/**
613   * Get a {@link FunctionTerm} from the {@link ListOfFunctionTerms}.
614   <p>
615   * @param n the index number of the {@link FunctionTerm} to get.
616   <p>
617   * @return the nth {@link FunctionTerm} in the {@link ListOfFunctionTerms} within this {@link Transition}.
618   <p>
619   * @see #getNumFunctionTerms()
620   */ public
621 FunctionTerm getFunctionTerm(long n) {
622    long cPtr = libsbmlJNI.Transition_getFunctionTerm__SWIG_0(swigCPtr, this, n);
623    return (cPtr == 0) ? null : new FunctionTerm(cPtr, false);
624  }
625
626  
627/**
628   * Get a {@link FunctionTerm} from the {@link ListOfFunctionTerms}
629   * based on its identifier.
630   <p>
631   * @param sid a string representing the identifier
632   * of the {@link FunctionTerm} to get.
633   <p>
634   * @return the {@link FunctionTerm} in the {@link ListOfFunctionTerms}
635   * with the given id or null if no such
636   * {@link FunctionTerm} exists.
637   <p>
638   * 
639   * @see #getNumFunctionTerms()
640   <p>
641   * @see #getFunctionTerm(long n)
642   */ public
643 FunctionTerm getFunctionTerm(String sid) {
644    long cPtr = libsbmlJNI.Transition_getFunctionTerm__SWIG_2(swigCPtr, this, sid);
645    return (cPtr == 0) ? null : new FunctionTerm(cPtr, false);
646  }
647
648  
649/**
650   * Adds a copy the given 'FunctionTerm' to this {@link Transition}.
651   <p>
652   * @param ft the {@link FunctionTerm} object to add
653   <p>
654   * <p>
655 * @return integer value indicating success/failure of the
656 * function.   The possible values
657 * returned by this function are:
658   * <ul>
659   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
660   * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
661   * </ul>
662   */ public
663 int addFunctionTerm(FunctionTerm ft) {
664    return libsbmlJNI.Transition_addFunctionTerm(swigCPtr, this, FunctionTerm.getCPtr(ft), ft);
665  }
666
667  
668/**
669   * Get the number of {@link FunctionTerm} objects in this {@link Transition}.
670   <p>
671   * @return the number of {@link FunctionTerm} objects in this {@link Transition}
672   */ public
673 long getNumFunctionTerms() {
674    return libsbmlJNI.Transition_getNumFunctionTerms(swigCPtr, this);
675  }
676
677  
678/**
679   * Creates a new {@link FunctionTerm} object, adds it to this Transitions
680   * {@link ListOfFunctionTerms} and returns the {@link FunctionTerm} object created. 
681   <p>
682   * @return a new {@link FunctionTerm} object instance
683   <p>
684   * @see #addFunctionTerm(FunctionTerm ft)
685   */ public
686 FunctionTerm createFunctionTerm() {
687    long cPtr = libsbmlJNI.Transition_createFunctionTerm(swigCPtr, this);
688    return (cPtr == 0) ? null : new FunctionTerm(cPtr, false);
689  }
690
691  
692/**
693   * Removes the nth {@link FunctionTerm} from the {@link ListOfFunctionTerms} within this {@link Transition}.
694   * and returns a pointer to it.
695   <p>
696   * The caller owns the returned item and is responsible for deleting it.
697   <p>
698   * @param n the index of the {@link FunctionTerm} to remove.
699   <p>
700   * @see #getNumFunctionTerms()
701   */ public
702 FunctionTerm removeFunctionTerm(long n) {
703    long cPtr = libsbmlJNI.Transition_removeFunctionTerm__SWIG_0(swigCPtr, this, n);
704    return (cPtr == 0) ? null : new FunctionTerm(cPtr, true);
705  }
706
707  
708/**
709   * Removes the {@link FunctionTerm} with the given identifier from the {@link ListOfFunctionTerms} within this {@link Transition}
710   * and returns a pointer to it.
711   <p>
712   * The caller owns the returned item and is responsible for deleting it.
713   * If none of the items in this list have the identifier <code>sid</code>, then
714   * <code>null</code> is returned.
715   <p>
716   * @param sid the identifier of the {@link FunctionTerm} to remove.
717   <p>
718   * @return the {@link FunctionTerm} removed. As mentioned above, the caller owns the
719   * returned item.
720   */ public
721 FunctionTerm removeFunctionTerm(String sid) {
722    long cPtr = libsbmlJNI.Transition_removeFunctionTerm__SWIG_1(swigCPtr, this, sid);
723    return (cPtr == 0) ? null : new FunctionTerm(cPtr, true);
724  }
725
726  
727/**
728   * Creates a new {@link DefaultTerm} object, adds it to this Transitions
729   * {@link ListOfFunctionTerms} and returns the {@link DefaultTerm} object created. 
730   <p>
731   * @return a new {@link DefaultTerm} object instance
732   <p>
733   * @see #setDefaultTerm(DefaultTerm ft)
734   */ public
735 DefaultTerm createDefaultTerm() {
736    long cPtr = libsbmlJNI.Transition_createDefaultTerm(swigCPtr, this);
737    return (cPtr == 0) ? null : new DefaultTerm(cPtr, false);
738  }
739
740  
741/**
742   * Sets the given 'DefaultTerm' to this {@link Transition}.
743   <p>
744   * @param dt the {@link DefaultTerm} object to add
745   <p>
746   * <p>
747 * @return integer value indicating success/failure of the
748 * function.   The possible values
749 * returned by this function are:
750   * <ul>
751   * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS}
752   * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE}
753   * </ul>
754   */ public
755 int setDefaultTerm(DefaultTerm dt) {
756    return libsbmlJNI.Transition_setDefaultTerm(swigCPtr, this, DefaultTerm.getCPtr(dt), dt);
757  }
758
759  
760/**
761   * Predicate returning <code>true</code> if the defaultTerm
762   * for this {@link Transition} object has been set.
763   <p>
764   * @return a boolean value indicating whether the defaultTerm
765   * child for this object has been defined.
766   */ public
767 boolean isSetDefaultTerm() {
768    return libsbmlJNI.Transition_isSetDefaultTerm(swigCPtr, this);
769  }
770
771  
772/**
773   * Get the {@link DefaultTerm} from the {@link ListOfFunctionTerms}.
774   <p>
775   * @return the {@link DefaultTerm} in the {@link ListOfFunctionTerms} within this {@link Transition}, or null if no such value is set.
776   */ public
777 DefaultTerm getDefaultTerm() {
778    long cPtr = libsbmlJNI.Transition_getDefaultTerm__SWIG_0(swigCPtr, this);
779    return (cPtr == 0) ? null : new DefaultTerm(cPtr, false);
780  }
781
782  
783/**
784   * Returns the XML name of this object.
785   <p>
786   * @return the name of this element.
787   */ public
788 String getElementName() {
789    return libsbmlJNI.Transition_getElementName(swigCPtr, this);
790  }
791
792  
793/**
794   * Returns the libSBML type code of this object instance.
795   <p>
796   * <p>
797 * LibSBML attaches an identifying code to every kind of SBML object.  These
798 * are integer constants known as <em>SBML type codes</em>.  The names of all
799 * the codes begin with the characters <code>SBML_</code>.
800 * In the Java language interface for libSBML, the
801 * type codes are defined as static integer constants in the interface class
802 * {@link libsbmlConstants}.    Note that different Level&nbsp;3
803 * package plug-ins may use overlapping type codes; to identify the package
804 * to which a given object belongs, call the <code>getPackageName()</code>
805 * method on the object.
806   <p>
807   * @return the SBML type code for this object:
808   * {@link libsbmlConstants#SBML_QUAL_TRANSITION SBML_QUAL_TRANSITION}
809   <p>
810   * <p>
811 * @warning <span class='warning'>The specific integer values of the possible
812 * type codes may be reused by different Level&nbsp;3 package plug-ins.
813 * Thus, to identifiy the correct code, <strong>it is necessary to invoke
814 * both getTypeCode() and getPackageName()</strong>.</span>
815   <p>
816   * @see #getElementName()
817   * @see #getPackageName()
818   */ public
819 int getTypeCode() {
820    return libsbmlJNI.Transition_getTypeCode(swigCPtr, this);
821  }
822
823  
824/**
825   * Predicate returning <code>true</code> if all the required attributes
826   * for this {@link Transition} object have been set.
827   <p>
828   * @note The required attributes for a {@link Transition} object are:
829   * <ul>
830   * <li> 'output'
831   *
832   * </ul> <p>
833   * @return a boolean value indicating whether all the required
834   * attributes for this object have been defined.
835   */ public
836 boolean hasRequiredAttributes() {
837    return libsbmlJNI.Transition_hasRequiredAttributes(swigCPtr, this);
838  }
839
840  
841/**
842   * Predicate returning <code>true</code> if all the required attributes
843   * for this {@link Transition} object have been set.
844   <p>
845   * @note The required elements for a {@link Transition} object are:
846   * <ul>
847   * <li> 'output'
848   *
849   * </ul> <p>
850   * @return a boolean value indicating whether all the required
851   * elements for this object have been defined.
852   */ public
853 boolean hasRequiredElements() {
854    return libsbmlJNI.Transition_hasRequiredElements(swigCPtr, this);
855  }
856
857  
858/** * @internal */ public
859 void connectToChild() {
860    libsbmlJNI.Transition_connectToChild(swigCPtr, this);
861  }
862
863  
864/** * @internal */ public
865 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) {
866    libsbmlJNI.Transition_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag);
867  }
868
869}