All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.quantlib.QuoteHandleVectorVector Maven / Gradle / Ivy

There is a newer version: 1.36.0
Show newest version
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (https://www.swig.org).
 * Version 4.2.1
 *
 * 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 QuoteHandleVectorVector extends java.util.AbstractList implements org.quantlib.helpers.QuantLibJNIHelpers.AutoCloseable, java.util.RandomAccess {
  private transient long swigCPtr;
  protected transient boolean swigCMemOwn;

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

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

  protected static long swigRelease(QuoteHandleVectorVector obj) {
    long ptr = 0;
    if (obj != null) {
      if (!obj.swigCMemOwn)
        throw new RuntimeException("Cannot release ownership as memory is not owned");
      ptr = obj.swigCPtr;
      obj.swigCMemOwn = false;
      obj.delete();
    }
    return ptr;
  }

  @SuppressWarnings({"deprecation", "removal"})
  protected void finalize() {
    delete();
  }

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

  public QuoteHandleVectorVector(QuoteHandleVector[] initialElements) {
    this();
    reserve(initialElements.length);

    for (QuoteHandleVector element : initialElements) {
      add(element);
    }
  }

  public QuoteHandleVectorVector(Iterable initialElements) {
    this();
    for (QuoteHandleVector element : initialElements) {
      add(element);
    }
  }

  public QuoteHandleVector get(int index) {
    return doGet(index);
  }

  public QuoteHandleVector set(int index, QuoteHandleVector e) {
    return doSet(index, e);
  }

  public boolean add(QuoteHandleVector e) {
    modCount++;
    doAdd(e);
    return true;
  }

  public void add(int index, QuoteHandleVector e) {
    modCount++;
    doAdd(index, e);
  }

  public QuoteHandleVector remove(int index) {
    modCount++;
    return doRemove(index);
  }

  protected void removeRange(int fromIndex, int toIndex) {
    modCount++;
    doRemoveRange(fromIndex, toIndex);
  }

  public int size() {
    return doSize();
  }

  public int capacity() {
    return doCapacity();
  }

  public void reserve(int n) {
    doReserve(n);
  }

  public QuoteHandleVectorVector() {
    this(QuantLibJNI.new_QuoteHandleVectorVector__SWIG_0(), true);
  }

  public QuoteHandleVectorVector(QuoteHandleVectorVector other) {
    this(QuantLibJNI.new_QuoteHandleVectorVector__SWIG_1(QuoteHandleVectorVector.getCPtr(other), other), true);
  }

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

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

  public QuoteHandleVectorVector(int count, QuoteHandleVector value) {
    this(QuantLibJNI.new_QuoteHandleVectorVector__SWIG_2(count, QuoteHandleVector.getCPtr(value), value), true);
  }

  private int doCapacity() {
    return QuantLibJNI.QuoteHandleVectorVector_doCapacity(swigCPtr, this);
  }

  private void doReserve(int n) {
    QuantLibJNI.QuoteHandleVectorVector_doReserve(swigCPtr, this, n);
  }

  private int doSize() {
    return QuantLibJNI.QuoteHandleVectorVector_doSize(swigCPtr, this);
  }

  private void doAdd(QuoteHandleVector x) {
    QuantLibJNI.QuoteHandleVectorVector_doAdd__SWIG_0(swigCPtr, this, QuoteHandleVector.getCPtr(x), x);
  }

  private void doAdd(int index, QuoteHandleVector x) {
    QuantLibJNI.QuoteHandleVectorVector_doAdd__SWIG_1(swigCPtr, this, index, QuoteHandleVector.getCPtr(x), x);
  }

  private QuoteHandleVector doRemove(int index) {
    return new QuoteHandleVector(QuantLibJNI.QuoteHandleVectorVector_doRemove(swigCPtr, this, index), true);
  }

  private QuoteHandleVector doGet(int index) {
    return new QuoteHandleVector(QuantLibJNI.QuoteHandleVectorVector_doGet(swigCPtr, this, index), false);
  }

  private QuoteHandleVector doSet(int index, QuoteHandleVector val) {
    return new QuoteHandleVector(QuantLibJNI.QuoteHandleVectorVector_doSet(swigCPtr, this, index, QuoteHandleVector.getCPtr(val), val), true);
  }

  private void doRemoveRange(int fromIndex, int toIndex) {
    QuantLibJNI.QuoteHandleVectorVector_doRemoveRange(swigCPtr, this, fromIndex, toIndex);
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy