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 int_array {
012   private long swigCPtr;
013   protected boolean swigCMemOwn;
014
015   protected int_array(long cPtr, boolean cMemoryOwn)
016   {
017     swigCMemOwn = cMemoryOwn;
018     swigCPtr    = cPtr;
019   }
020
021   protected static long getCPtr(int_array obj)
022   {
023     return (obj == null) ? 0 : obj.swigCPtr;
024   }
025
026   protected static long getCPtrAndDisown (int_array obj)
027   {
028     long ptr = 0;
029
030     if (obj != null)
031     {
032       ptr             = obj.swigCPtr;
033       obj.swigCMemOwn = false;
034     }
035
036     return ptr;
037   }
038
039  protected void finalize() {
040    delete();
041  }
042
043  public synchronized void delete() {
044    if (swigCPtr != 0) {
045      if (swigCMemOwn) {
046        swigCMemOwn = false;
047        libsbmlJNI.delete_int_array(swigCPtr);
048      }
049      swigCPtr = 0;
050    }
051  }
052
053  public int_array(int nelements) {
054    this(libsbmlJNI.new_int_array(nelements), true);
055  }
056
057  public int getitem(int index) {
058    return libsbmlJNI.int_array_getitem(swigCPtr, this, index);
059  }
060
061  public void setitem(int index, int value) {
062    libsbmlJNI.int_array_setitem(swigCPtr, this, index, value);
063  }
064
065  public SWIGTYPE_p_int cast() {
066    long cPtr = libsbmlJNI.int_array_cast(swigCPtr, this);
067    return (cPtr == 0) ? null : new SWIGTYPE_p_int(cPtr, false);
068  }
069
070  public static int_array frompointer(SWIGTYPE_p_int t) {
071    long cPtr = libsbmlJNI.int_array_frompointer(SWIGTYPE_p_int.getCPtr(t));
072    return (cPtr == 0) ? null : new int_array(cPtr, false);
073  }
074
075}