/* ----------------------------------------------------------------------------
* 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 XMLNodeVector extends java.util.AbstractList<XMLNode> implements java.util.RandomAccess {
private transient long swigCPtr;
protected transient boolean swigCMemOwn;
protected XMLNodeVector(long cPtr, boolean cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = cPtr;
}
protected static long getCPtr(XMLNodeVector obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
protected static long swigRelease(XMLNodeVector 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_XMLNodeVector(swigCPtr);
}
swigCPtr = 0;
}
}
public XMLNodeVector(XMLNode[] initialElements) {
this();
reserve(initialElements.length);
for (XMLNode element : initialElements) {
add(element);
}
}
public XMLNodeVector(Iterable<XMLNode> initialElements) {
this();
for (XMLNode element : initialElements) {
add(element);
}
}
@Override
public XMLNode get(int index) {
return doGet(index);
}
@Override
public XMLNode set(int index, XMLNode e) {
return doSet(index, e);
}
@Override
public boolean add(XMLNode e) {
modCount++;
doAdd(e);
return true;
}
@Override
public void add(int index, XMLNode e) {
modCount++;
doAdd(index, e);
}
@Override
public XMLNode 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 XMLNodeVector() {
this(InscoperJNI.new_XMLNodeVector__SWIG_0(), true);
}
public XMLNodeVector(XMLNodeVector other) {
this(InscoperJNI.new_XMLNodeVector__SWIG_1(XMLNodeVector.getCPtr(other), other), true);
}
public long capacity() {
return InscoperJNI.XMLNodeVector_capacity(swigCPtr, this);
}
public void reserve(long n) {
InscoperJNI.XMLNodeVector_reserve(swigCPtr, this, n);
}
public boolean empty() {
return InscoperJNI.XMLNodeVector_empty(swigCPtr, this);
}
public void doClear() {
InscoperJNI.XMLNodeVector_doClear(swigCPtr, this);
}
public XMLNodeVector(int count, XMLNode value) {
this(InscoperJNI.new_XMLNodeVector__SWIG_2(count, XMLNode.getCPtr(value), value), true);
}
private int doSize() {
return InscoperJNI.XMLNodeVector_doSize(swigCPtr, this);
}
private void doAdd(XMLNode x) {
InscoperJNI.XMLNodeVector_doAdd__SWIG_0(swigCPtr, this, XMLNode.getCPtr(x), x);
}
private void doAdd(int index, XMLNode x) {
InscoperJNI.XMLNodeVector_doAdd__SWIG_1(swigCPtr, this, index, XMLNode.getCPtr(x), x);
}
private XMLNode doRemove(int index) {
return new XMLNode(InscoperJNI.XMLNodeVector_doRemove(swigCPtr, this, index), true);
}
private XMLNode doGet(int index) {
return new XMLNode(InscoperJNI.XMLNodeVector_doGet(swigCPtr, this, index), false);
}
private XMLNode doSet(int index, XMLNode val) {
return new XMLNode(InscoperJNI.XMLNodeVector_doSet(swigCPtr, this, index, XMLNode.getCPtr(val), val), true);
}
private void doRemoveRange(int fromIndex, int toIndex) {
InscoperJNI.XMLNodeVector_doRemoveRange(swigCPtr, this, fromIndex, toIndex);
}
}