/* ----------------------------------------------------------------------------
* 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 StatusVector extends java.util.AbstractList<Status> implements java.util.RandomAccess {
private transient long swigCPtr;
protected transient boolean swigCMemOwn;
protected StatusVector(long cPtr, boolean cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = cPtr;
}
protected static long getCPtr(StatusVector obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
protected static long swigRelease(StatusVector 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_StatusVector(swigCPtr);
}
swigCPtr = 0;
}
}
public StatusVector(Status[] initialElements) {
this();
reserve(initialElements.length);
for (Status element : initialElements) {
add(element);
}
}
public StatusVector(Iterable<Status> initialElements) {
this();
for (Status element : initialElements) {
add(element);
}
}
@Override
public Status get(int index) {
return doGet(index);
}
@Override
public Status set(int index, Status e) {
return doSet(index, e);
}
@Override
public boolean add(Status e) {
modCount++;
doAdd(e);
return true;
}
@Override
public void add(int index, Status e) {
modCount++;
doAdd(index, e);
}
@Override
public Status 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 StatusVector() {
this(InscoperJNI.new_StatusVector__SWIG_0(), true);
}
public StatusVector(StatusVector other) {
this(InscoperJNI.new_StatusVector__SWIG_1(StatusVector.getCPtr(other), other), true);
}
public long capacity() {
return InscoperJNI.StatusVector_capacity(swigCPtr, this);
}
public void reserve(long n) {
InscoperJNI.StatusVector_reserve(swigCPtr, this, n);
}
public boolean empty() {
return InscoperJNI.StatusVector_empty(swigCPtr, this);
}
public void doClear() {
InscoperJNI.StatusVector_doClear(swigCPtr, this);
}
public StatusVector(int count, Status value) {
this(InscoperJNI.new_StatusVector__SWIG_2(count, Status.getCPtr(value), value), true);
}
private int doSize() {
return InscoperJNI.StatusVector_doSize(swigCPtr, this);
}
private void doAdd(Status x) {
InscoperJNI.StatusVector_doAdd__SWIG_0(swigCPtr, this, Status.getCPtr(x), x);
}
private void doAdd(int index, Status x) {
InscoperJNI.StatusVector_doAdd__SWIG_1(swigCPtr, this, index, Status.getCPtr(x), x);
}
private Status doRemove(int index) {
long cPtr = InscoperJNI.StatusVector_doRemove(swigCPtr, this, index);
return (cPtr == 0) ? null : new Status(cPtr, true);
}
private Status doGet(int index) {
long cPtr = InscoperJNI.StatusVector_doGet(swigCPtr, this, index);
return (cPtr == 0) ? null : new Status(cPtr, true);
}
private Status doSet(int index, Status val) {
long cPtr = InscoperJNI.StatusVector_doSet(swigCPtr, this, index, Status.getCPtr(val), val);
return (cPtr == 0) ? null : new Status(cPtr, true);
}
private void doRemoveRange(int fromIndex, int toIndex) {
InscoperJNI.StatusVector_doRemoveRange(swigCPtr, this, fromIndex, toIndex);
}
}