/* ----------------------------------------------------------------------------
* 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 FunctionDescriptionVector extends java.util.AbstractList<FunctionDescription> implements java.util.RandomAccess {
private transient long swigCPtr;
protected transient boolean swigCMemOwn;
protected FunctionDescriptionVector(long cPtr, boolean cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = cPtr;
}
protected static long getCPtr(FunctionDescriptionVector obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
protected static long swigRelease(FunctionDescriptionVector 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_FunctionDescriptionVector(swigCPtr);
}
swigCPtr = 0;
}
}
public FunctionDescriptionVector(FunctionDescription[] initialElements) {
this();
reserve(initialElements.length);
for (FunctionDescription element : initialElements) {
add(element);
}
}
public FunctionDescriptionVector(Iterable<FunctionDescription> initialElements) {
this();
for (FunctionDescription element : initialElements) {
add(element);
}
}
@Override
public FunctionDescription get(int index) {
return doGet(index);
}
@Override
public FunctionDescription set(int index, FunctionDescription e) {
return doSet(index, e);
}
@Override
public boolean add(FunctionDescription e) {
modCount++;
doAdd(e);
return true;
}
@Override
public void add(int index, FunctionDescription e) {
modCount++;
doAdd(index, e);
}
@Override
public FunctionDescription 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 FunctionDescriptionVector() {
this(InscoperJNI.new_FunctionDescriptionVector__SWIG_0(), true);
}
public FunctionDescriptionVector(FunctionDescriptionVector other) {
this(InscoperJNI.new_FunctionDescriptionVector__SWIG_1(FunctionDescriptionVector.getCPtr(other), other), true);
}
public long capacity() {
return InscoperJNI.FunctionDescriptionVector_capacity(swigCPtr, this);
}
public void reserve(long n) {
InscoperJNI.FunctionDescriptionVector_reserve(swigCPtr, this, n);
}
public boolean empty() {
return InscoperJNI.FunctionDescriptionVector_empty(swigCPtr, this);
}
public void doClear() {
InscoperJNI.FunctionDescriptionVector_doClear(swigCPtr, this);
}
public FunctionDescriptionVector(int count, FunctionDescription value) {
this(InscoperJNI.new_FunctionDescriptionVector__SWIG_2(count, FunctionDescription.getCPtr(value), value), true);
}
private int doSize() {
return InscoperJNI.FunctionDescriptionVector_doSize(swigCPtr, this);
}
private void doAdd(FunctionDescription x) {
InscoperJNI.FunctionDescriptionVector_doAdd__SWIG_0(swigCPtr, this, FunctionDescription.getCPtr(x), x);
}
private void doAdd(int index, FunctionDescription x) {
InscoperJNI.FunctionDescriptionVector_doAdd__SWIG_1(swigCPtr, this, index, FunctionDescription.getCPtr(x), x);
}
private FunctionDescription doRemove(int index) {
long cPtr = InscoperJNI.FunctionDescriptionVector_doRemove(swigCPtr, this, index);
return (cPtr == 0) ? null : new FunctionDescription(cPtr, true);
}
private FunctionDescription doGet(int index) {
long cPtr = InscoperJNI.FunctionDescriptionVector_doGet(swigCPtr, this, index);
return (cPtr == 0) ? null : new FunctionDescription(cPtr, true);
}
private FunctionDescription doSet(int index, FunctionDescription val) {
long cPtr = InscoperJNI.FunctionDescriptionVector_doSet(swigCPtr, this, index, FunctionDescription.getCPtr(val), val);
return (cPtr == 0) ? null : new FunctionDescription(cPtr, true);
}
private void doRemoveRange(int fromIndex, int toIndex) {
InscoperJNI.FunctionDescriptionVector_doRemoveRange(swigCPtr, this, fromIndex, toIndex);
}
}