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
011public class double_array {
012   private long swigCPtr;
013   protected boolean swigCMemOwn;
014
015   protected double_array(long cPtr, boolean cMemoryOwn)
016   {
017     swigCMemOwn = cMemoryOwn;
018     swigCPtr    = cPtr;
019   }
020
021   protected static long getCPtr(double_array obj)
022   {
023     return (obj == null) ? 0 : obj.swigCPtr;
024   }
025
026   protected static long getCPtrAndDisown (double_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_double_array(swigCPtr);
048      }
049      swigCPtr = 0;
050    }
051  }
052
053  public double_array(int nelements) {
054    this(libsbmlJNI.new_double_array(nelements), true);
055  }
056
057  public double getitem(int index) {
058    return libsbmlJNI.double_array_getitem(swigCPtr, this, index);
059  }
060
061  public void setitem(int index, double value) {
062    libsbmlJNI.double_array_setitem(swigCPtr, this, index, value);
063  }
064
065  public SWIGTYPE_p_double cast() {
066    long cPtr = libsbmlJNI.double_array_cast(swigCPtr, this);
067    return (cPtr == 0) ? null : new SWIGTYPE_p_double(cPtr, false);
068  }
069
070  public static double_array frompointer(SWIGTYPE_p_double t) {
071    long cPtr = libsbmlJNI.double_array_frompointer(SWIGTYPE_p_double.getCPtr(t));
072    return (cPtr == 0) ? null : new double_array(cPtr, false);
073  }
074
075}