Skip to content

InscoperAPI/Build/Java/com.inscoper.api/com/inscoper/api/DeviceConfigVector.java

Packages

Name
com.inscoper.api

Classes

Name
class com.inscoper.api.DeviceConfigVector

Source code

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

package com.inscoper.api;
import com.inscoper.api.logging.*;

public class DeviceConfigVector extends java.util.AbstractList<DeviceConfig> implements java.util.RandomAccess {
  private transient long swigCPtr;
  protected transient boolean swigCMemOwn;

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

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

  protected static long swigRelease(DeviceConfigVector 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;
        InscoperJNI.delete_DeviceConfigVector(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public DeviceConfigVector(DeviceConfig[] initialElements) {
    this();
    reserve(initialElements.length);

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

  public DeviceConfigVector(Iterable<DeviceConfig> initialElements) {
    this();
    for (DeviceConfig element : initialElements) {
      add(element);
    }
  }

  @Override
  public DeviceConfig get(int index) {
    return doGet(index);
  }

  @Override
  public DeviceConfig set(int index, DeviceConfig e) {
    return doSet(index, e);
  }

  @Override
  public boolean add(DeviceConfig e) {
    modCount++;
    doAdd(e);
    return true;
  }

  @Override
  public void add(int index, DeviceConfig e) {
    modCount++;
    doAdd(index, e);
  }

  @Override
  public DeviceConfig remove(int index) {
    modCount++;
    return doRemove(index);
  }

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

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

  @Override
  public boolean isEmpty() {
    return empty();
  }

  @Override
  public void clear() {
    doClear();
  }

  public DeviceConfigVector() {
    this(InscoperJNI.new_DeviceConfigVector__SWIG_0(), true);
  }

  public DeviceConfigVector(DeviceConfigVector other) {
    this(InscoperJNI.new_DeviceConfigVector__SWIG_1(DeviceConfigVector.getCPtr(other), other), true);
  }

  public long capacity() {
    return InscoperJNI.DeviceConfigVector_capacity(swigCPtr, this);
  }

  public void reserve(long n) {
    InscoperJNI.DeviceConfigVector_reserve(swigCPtr, this, n);
  }

  public boolean empty() {
    return InscoperJNI.DeviceConfigVector_empty(swigCPtr, this);
  }

  public void doClear() {
    InscoperJNI.DeviceConfigVector_doClear(swigCPtr, this);
  }

  public DeviceConfigVector(int count, DeviceConfig value) {
    this(InscoperJNI.new_DeviceConfigVector__SWIG_2(count, DeviceConfig.getCPtr(value), value), true);
  }

  private int doSize() {
    return InscoperJNI.DeviceConfigVector_doSize(swigCPtr, this);
  }

  private void doAdd(DeviceConfig x) {
    InscoperJNI.DeviceConfigVector_doAdd__SWIG_0(swigCPtr, this, DeviceConfig.getCPtr(x), x);
  }

  private void doAdd(int index, DeviceConfig x) {
    InscoperJNI.DeviceConfigVector_doAdd__SWIG_1(swigCPtr, this, index, DeviceConfig.getCPtr(x), x);
  }

  private DeviceConfig doRemove(int index) {
    long cPtr = InscoperJNI.DeviceConfigVector_doRemove(swigCPtr, this, index);
    return (cPtr == 0) ? null : new DeviceConfig(cPtr, true);
  }

  private DeviceConfig doGet(int index) {
    long cPtr = InscoperJNI.DeviceConfigVector_doGet(swigCPtr, this, index);
    return (cPtr == 0) ? null : new DeviceConfig(cPtr, true);
  }

  private DeviceConfig doSet(int index, DeviceConfig val) {
    long cPtr = InscoperJNI.DeviceConfigVector_doSet(swigCPtr, this, index, DeviceConfig.getCPtr(val), val);
    return (cPtr == 0) ? null : new DeviceConfig(cPtr, true);
  }

  private void doRemoveRange(int fromIndex, int toIndex) {
    InscoperJNI.DeviceConfigVector_doRemoveRange(swigCPtr, this, fromIndex, toIndex);
  }

}

Updated on 2026-09-03 at 12:14:19 +0200