/* ----------------------------------------------------------------------------
* 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 UsbInfoVector extends java.util.AbstractList<UsbInfo> implements java.util.RandomAccess {
private transient long swigCPtr;
protected transient boolean swigCMemOwn;
protected UsbInfoVector(long cPtr, boolean cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = cPtr;
}
protected static long getCPtr(UsbInfoVector obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
protected static long swigRelease(UsbInfoVector 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_UsbInfoVector(swigCPtr);
}
swigCPtr = 0;
}
}
public UsbInfoVector(UsbInfo[] initialElements) {
this();
reserve(initialElements.length);
for (UsbInfo element : initialElements) {
add(element);
}
}
public UsbInfoVector(Iterable<UsbInfo> initialElements) {
this();
for (UsbInfo element : initialElements) {
add(element);
}
}
@Override
public UsbInfo get(int index) {
return doGet(index);
}
@Override
public UsbInfo set(int index, UsbInfo e) {
return doSet(index, e);
}
@Override
public boolean add(UsbInfo e) {
modCount++;
doAdd(e);
return true;
}
@Override
public void add(int index, UsbInfo e) {
modCount++;
doAdd(index, e);
}
@Override
public UsbInfo 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 UsbInfoVector() {
this(InscoperJNI.new_UsbInfoVector__SWIG_0(), true);
}
public UsbInfoVector(UsbInfoVector other) {
this(InscoperJNI.new_UsbInfoVector__SWIG_1(UsbInfoVector.getCPtr(other), other), true);
}
public long capacity() {
return InscoperJNI.UsbInfoVector_capacity(swigCPtr, this);
}
public void reserve(long n) {
InscoperJNI.UsbInfoVector_reserve(swigCPtr, this, n);
}
public boolean empty() {
return InscoperJNI.UsbInfoVector_empty(swigCPtr, this);
}
public void doClear() {
InscoperJNI.UsbInfoVector_doClear(swigCPtr, this);
}
public UsbInfoVector(int count, UsbInfo value) {
this(InscoperJNI.new_UsbInfoVector__SWIG_2(count, UsbInfo.getCPtr(value), value), true);
}
private int doSize() {
return InscoperJNI.UsbInfoVector_doSize(swigCPtr, this);
}
private void doAdd(UsbInfo x) {
InscoperJNI.UsbInfoVector_doAdd__SWIG_0(swigCPtr, this, UsbInfo.getCPtr(x), x);
}
private void doAdd(int index, UsbInfo x) {
InscoperJNI.UsbInfoVector_doAdd__SWIG_1(swigCPtr, this, index, UsbInfo.getCPtr(x), x);
}
private UsbInfo doRemove(int index) {
return new UsbInfo(InscoperJNI.UsbInfoVector_doRemove(swigCPtr, this, index), true);
}
private UsbInfo doGet(int index) {
return new UsbInfo(InscoperJNI.UsbInfoVector_doGet(swigCPtr, this, index), false);
}
private UsbInfo doSet(int index, UsbInfo val) {
return new UsbInfo(InscoperJNI.UsbInfoVector_doSet(swigCPtr, this, index, UsbInfo.getCPtr(val), val), true);
}
private void doRemoveRange(int fromIndex, int toIndex) {
InscoperJNI.UsbInfoVector_doRemoveRange(swigCPtr, this, fromIndex, toIndex);
}
}