/* ----------------------------------------------------------------------------
* 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 MetadataList extends java.util.AbstractList<Metadata> implements java.util.RandomAccess {
private transient long swigCPtr;
protected transient boolean swigCMemOwn;
protected MetadataList(long cPtr, boolean cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = cPtr;
}
protected static long getCPtr(MetadataList obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
protected static long swigRelease(MetadataList 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_MetadataList(swigCPtr);
}
swigCPtr = 0;
}
}
public MetadataList(Metadata[] initialElements) {
this();
reserve(initialElements.length);
for (Metadata element : initialElements) {
add(element);
}
}
public MetadataList(Iterable<Metadata> initialElements) {
this();
for (Metadata element : initialElements) {
add(element);
}
}
@Override
public Metadata get(int index) {
return doGet(index);
}
@Override
public Metadata set(int index, Metadata e) {
return doSet(index, e);
}
@Override
public boolean add(Metadata e) {
modCount++;
doAdd(e);
return true;
}
@Override
public void add(int index, Metadata e) {
modCount++;
doAdd(index, e);
}
@Override
public Metadata 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 MetadataList() {
this(InscoperJNI.new_MetadataList__SWIG_0(), true);
}
public MetadataList(MetadataList other) {
this(InscoperJNI.new_MetadataList__SWIG_1(MetadataList.getCPtr(other), other), true);
}
public long capacity() {
return InscoperJNI.MetadataList_capacity(swigCPtr, this);
}
public void reserve(long n) {
InscoperJNI.MetadataList_reserve(swigCPtr, this, n);
}
public boolean empty() {
return InscoperJNI.MetadataList_empty(swigCPtr, this);
}
public void doClear() {
InscoperJNI.MetadataList_doClear(swigCPtr, this);
}
public MetadataList(int count, Metadata value) {
this(InscoperJNI.new_MetadataList__SWIG_2(count, Metadata.getCPtr(value), value), true);
}
private int doSize() {
return InscoperJNI.MetadataList_doSize(swigCPtr, this);
}
private void doAdd(Metadata x) {
InscoperJNI.MetadataList_doAdd__SWIG_0(swigCPtr, this, Metadata.getCPtr(x), x);
}
private void doAdd(int index, Metadata x) {
InscoperJNI.MetadataList_doAdd__SWIG_1(swigCPtr, this, index, Metadata.getCPtr(x), x);
}
private Metadata doRemove(int index) {
return new Metadata(InscoperJNI.MetadataList_doRemove(swigCPtr, this, index), true);
}
private Metadata doGet(int index) {
return new Metadata(InscoperJNI.MetadataList_doGet(swigCPtr, this, index), true);
}
private Metadata doSet(int index, Metadata val) {
return new Metadata(InscoperJNI.MetadataList_doSet(swigCPtr, this, index, Metadata.getCPtr(val), val), true);
}
private void doRemoveRange(int fromIndex, int toIndex) {
InscoperJNI.MetadataList_doRemoveRange(swigCPtr, this, fromIndex, toIndex);
}
public void addBoolean(boolean value) {
InscoperJNI.MetadataList_addBoolean(swigCPtr, this, value);
}
public void addShort(short value) {
InscoperJNI.MetadataList_addShort(swigCPtr, this, value);
}
public void addInt(int value) {
InscoperJNI.MetadataList_addInt(swigCPtr, this, value);
}
public void addLong(long value) {
InscoperJNI.MetadataList_addLong(swigCPtr, this, value);
}
public void addFloat(float value) {
InscoperJNI.MetadataList_addFloat(swigCPtr, this, value);
}
public void addDouble(double value) {
InscoperJNI.MetadataList_addDouble(swigCPtr, this, value);
}
public void addString(String value) {
InscoperJNI.MetadataList_addString(swigCPtr, this, value);
}
public void addList(MetadataList value) {
InscoperJNI.MetadataList_addList(swigCPtr, this, MetadataList.getCPtr(value), value);
}
public void addMap(MetadataMap value) {
InscoperJNI.MetadataList_addMap(swigCPtr, this, MetadataMap.getCPtr(value), value);
}
public void addInstance(Metadata value) {
InscoperJNI.MetadataList_addInstance(swigCPtr, this, Metadata.getCPtr(value), value);
}
}