001/* ----------------------------------------------------------------------------
002 * This file was automatically generated by SWIG (http://www.swig.org).
003 * Version 2.0.12
004 *
005 * Do not make changes to this file unless you know what you are doing--modify
006 * the SWIG interface file instead.
007 * ----------------------------------------------------------------------------- */
008
009package org.sbml.libsbml;
010
011public class SBaseList {
012  private long swigCPtr;
013  protected boolean swigCMemOwn;
014
015  protected SBaseList(long cPtr, boolean cMemoryOwn) {
016    swigCMemOwn = cMemoryOwn;
017    swigCPtr = cPtr;
018  }
019
020  protected static long getCPtr(SBaseList obj) {
021    return (obj == null) ? 0 : obj.swigCPtr;
022  }
023
024  protected void finalize() {
025    delete();
026  }
027
028  public synchronized void delete() {
029    if (swigCPtr != 0) {
030      if (swigCMemOwn) {
031        swigCMemOwn = false;
032        libsbmlJNI.delete_SBaseList(swigCPtr);
033      }
034      swigCPtr = 0;
035    }
036  }
037
038  public SBaseList() {
039    this(libsbmlJNI.new_SBaseList(), true);
040  }
041
042  public void add(SBase item) {
043    libsbmlJNI.SBaseList_add(swigCPtr, this, SBase.getCPtr(item), item);
044  }
045
046  public SBase get(long n) {
047    long cPtr = libsbmlJNI.SBaseList_get(swigCPtr, this, n);
048    return (cPtr == 0) ? null : new SBase(cPtr, false);
049  }
050
051  public void prepend(SBase item) {
052    libsbmlJNI.SBaseList_prepend(swigCPtr, this, SBase.getCPtr(item), item);
053  }
054
055  public SBase remove(long n) {
056    long cPtr = libsbmlJNI.SBaseList_remove(swigCPtr, this, n);
057    return (cPtr == 0) ? null : new SBase(cPtr, false);
058  }
059
060  public long getSize() {
061    return libsbmlJNI.SBaseList_getSize(swigCPtr, this);
062  }
063
064}