/* ----------------------------------------------------------------------------
* 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 RoiCropVector extends java.util.AbstractList<RoiCrop> implements java.util.RandomAccess {
private transient long swigCPtr;
protected transient boolean swigCMemOwn;
protected RoiCropVector(long cPtr, boolean cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = cPtr;
}
protected static long getCPtr(RoiCropVector obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
protected static long swigRelease(RoiCropVector 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_RoiCropVector(swigCPtr);
}
swigCPtr = 0;
}
}
public RoiCropVector(RoiCrop[] initialElements) {
this();
reserve(initialElements.length);
for (RoiCrop element : initialElements) {
add(element);
}
}
public RoiCropVector(Iterable<RoiCrop> initialElements) {
this();
for (RoiCrop element : initialElements) {
add(element);
}
}
@Override
public RoiCrop get(int index) {
return doGet(index);
}
@Override
public RoiCrop set(int index, RoiCrop e) {
return doSet(index, e);
}
@Override
public boolean add(RoiCrop e) {
modCount++;
doAdd(e);
return true;
}
@Override
public void add(int index, RoiCrop e) {
modCount++;
doAdd(index, e);
}
@Override
public RoiCrop 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 RoiCropVector() {
this(InscoperJNI.new_RoiCropVector__SWIG_0(), true);
}
public RoiCropVector(RoiCropVector other) {
this(InscoperJNI.new_RoiCropVector__SWIG_1(RoiCropVector.getCPtr(other), other), true);
}
public long capacity() {
return InscoperJNI.RoiCropVector_capacity(swigCPtr, this);
}
public void reserve(long n) {
InscoperJNI.RoiCropVector_reserve(swigCPtr, this, n);
}
public boolean empty() {
return InscoperJNI.RoiCropVector_empty(swigCPtr, this);
}
public void doClear() {
InscoperJNI.RoiCropVector_doClear(swigCPtr, this);
}
public RoiCropVector(int count, RoiCrop value) {
this(InscoperJNI.new_RoiCropVector__SWIG_2(count, RoiCrop.getCPtr(value), value), true);
}
private int doSize() {
return InscoperJNI.RoiCropVector_doSize(swigCPtr, this);
}
private void doAdd(RoiCrop x) {
InscoperJNI.RoiCropVector_doAdd__SWIG_0(swigCPtr, this, RoiCrop.getCPtr(x), x);
}
private void doAdd(int index, RoiCrop x) {
InscoperJNI.RoiCropVector_doAdd__SWIG_1(swigCPtr, this, index, RoiCrop.getCPtr(x), x);
}
private RoiCrop doRemove(int index) {
return new RoiCrop(InscoperJNI.RoiCropVector_doRemove(swigCPtr, this, index), true);
}
private RoiCrop doGet(int index) {
return new RoiCrop(InscoperJNI.RoiCropVector_doGet(swigCPtr, this, index), false);
}
private RoiCrop doSet(int index, RoiCrop val) {
return new RoiCrop(InscoperJNI.RoiCropVector_doSet(swigCPtr, this, index, RoiCrop.getCPtr(val), val), true);
}
private void doRemoveRange(int fromIndex, int toIndex) {
InscoperJNI.RoiCropVector_doRemoveRange(swigCPtr, this, fromIndex, toIndex);
}
}