/* ----------------------------------------------------------------------------
* 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 ESubDeviceLabelVector extends java.util.AbstractList<ESubDeviceLabel> implements java.util.RandomAccess {
private transient long swigCPtr;
protected transient boolean swigCMemOwn;
protected ESubDeviceLabelVector(long cPtr, boolean cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = cPtr;
}
protected static long getCPtr(ESubDeviceLabelVector obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
protected static long swigRelease(ESubDeviceLabelVector 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_ESubDeviceLabelVector(swigCPtr);
}
swigCPtr = 0;
}
}
public ESubDeviceLabelVector(ESubDeviceLabel[] initialElements) {
this();
reserve(initialElements.length);
for (ESubDeviceLabel element : initialElements) {
add(element);
}
}
public ESubDeviceLabelVector(Iterable<ESubDeviceLabel> initialElements) {
this();
for (ESubDeviceLabel element : initialElements) {
add(element);
}
}
@Override
public ESubDeviceLabel get(int index) {
return doGet(index);
}
@Override
public ESubDeviceLabel set(int index, ESubDeviceLabel e) {
return doSet(index, e);
}
@Override
public boolean add(ESubDeviceLabel e) {
modCount++;
doAdd(e);
return true;
}
@Override
public void add(int index, ESubDeviceLabel e) {
modCount++;
doAdd(index, e);
}
@Override
public ESubDeviceLabel 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 ESubDeviceLabelVector() {
this(InscoperJNI.new_ESubDeviceLabelVector__SWIG_0(), true);
}
public ESubDeviceLabelVector(ESubDeviceLabelVector other) {
this(InscoperJNI.new_ESubDeviceLabelVector__SWIG_1(ESubDeviceLabelVector.getCPtr(other), other), true);
}
public long capacity() {
return InscoperJNI.ESubDeviceLabelVector_capacity(swigCPtr, this);
}
public void reserve(long n) {
InscoperJNI.ESubDeviceLabelVector_reserve(swigCPtr, this, n);
}
public boolean empty() {
return InscoperJNI.ESubDeviceLabelVector_empty(swigCPtr, this);
}
public void doClear() {
InscoperJNI.ESubDeviceLabelVector_doClear(swigCPtr, this);
}
public ESubDeviceLabelVector(int count, ESubDeviceLabel value) {
this(InscoperJNI.new_ESubDeviceLabelVector__SWIG_2(count, value.swigValue()), true);
}
private int doSize() {
return InscoperJNI.ESubDeviceLabelVector_doSize(swigCPtr, this);
}
private void doAdd(ESubDeviceLabel x) {
InscoperJNI.ESubDeviceLabelVector_doAdd__SWIG_0(swigCPtr, this, x.swigValue());
}
private void doAdd(int index, ESubDeviceLabel x) {
InscoperJNI.ESubDeviceLabelVector_doAdd__SWIG_1(swigCPtr, this, index, x.swigValue());
}
private ESubDeviceLabel doRemove(int index) {
return ESubDeviceLabel.swigToEnum(InscoperJNI.ESubDeviceLabelVector_doRemove(swigCPtr, this, index));
}
private ESubDeviceLabel doGet(int index) {
return ESubDeviceLabel.swigToEnum(InscoperJNI.ESubDeviceLabelVector_doGet(swigCPtr, this, index));
}
private ESubDeviceLabel doSet(int index, ESubDeviceLabel val) {
return ESubDeviceLabel.swigToEnum(InscoperJNI.ESubDeviceLabelVector_doSet(swigCPtr, this, index, val.swigValue()));
}
private void doRemoveRange(int fromIndex, int toIndex) {
InscoperJNI.ESubDeviceLabelVector_doRemoveRange(swigCPtr, this, fromIndex, toIndex);
}
}