/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 3.0.12
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package org.quantlib;

public class InstrumentVector {
  private transient long swigCPtr;
  protected transient boolean swigCMemOwn;

  protected InstrumentVector(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected static long getCPtr(InstrumentVector obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        QuantLibJNI.delete_InstrumentVector(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public InstrumentVector() {
    this(QuantLibJNI.new_InstrumentVector__SWIG_0(), true);
  }

  public InstrumentVector(long n) {
    this(QuantLibJNI.new_InstrumentVector__SWIG_1(n), true);
  }

  public long size() {
    return QuantLibJNI.InstrumentVector_size(swigCPtr, this);
  }

  public long capacity() {
    return QuantLibJNI.InstrumentVector_capacity(swigCPtr, this);
  }

  public void reserve(long n) {
    QuantLibJNI.InstrumentVector_reserve(swigCPtr, this, n);
  }

  public boolean isEmpty() {
    return QuantLibJNI.InstrumentVector_isEmpty(swigCPtr, this);
  }

  public void clear() {
    QuantLibJNI.InstrumentVector_clear(swigCPtr, this);
  }

  public void add(Instrument x) {
    QuantLibJNI.InstrumentVector_add(swigCPtr, this, Instrument.getCPtr(x), x);
  }

  public Instrument get(int i) {
    return new Instrument(QuantLibJNI.InstrumentVector_get(swigCPtr, this, i), false);
  }

  public void set(int i, Instrument val) {
    QuantLibJNI.InstrumentVector_set(swigCPtr, this, i, Instrument.getCPtr(val), val);
  }

}
