org.dashj.bls.G2ElementVector Maven / Gradle / Ivy
The newest version!
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 4.0.2
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package org.dashj.bls;
public class G2ElementVector extends java.util.AbstractList implements java.util.RandomAccess {
private transient long swigCPtr;
protected transient boolean swigCMemOwn;
protected G2ElementVector(long cPtr, boolean cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = cPtr;
}
protected static long getCPtr(G2ElementVector obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
@SuppressWarnings("deprecation")
protected void finalize() {
delete();
}
public synchronized void delete() {
if (swigCPtr != 0) {
if (swigCMemOwn) {
swigCMemOwn = false;
DASHJBLSJNI.delete_G2ElementVector(swigCPtr);
}
swigCPtr = 0;
}
}
public G2ElementVector(G2Element[] initialElements) {
this();
reserve(initialElements.length);
for (G2Element element : initialElements) {
add(element);
}
}
public G2ElementVector(Iterable initialElements) {
this();
for (G2Element element : initialElements) {
add(element);
}
}
public G2Element get(int index) {
return doGet(index);
}
public G2Element set(int index, G2Element e) {
return doSet(index, e);
}
public boolean add(G2Element e) {
modCount++;
doAdd(e);
return true;
}
public void add(int index, G2Element e) {
modCount++;
doAdd(index, e);
}
public G2Element remove(int index) {
modCount++;
return doRemove(index);
}
protected void removeRange(int fromIndex, int toIndex) {
modCount++;
doRemoveRange(fromIndex, toIndex);
}
public int size() {
return doSize();
}
public G2ElementVector() {
this(DASHJBLSJNI.new_G2ElementVector__SWIG_0(), true);
}
public G2ElementVector(G2ElementVector other) {
this(DASHJBLSJNI.new_G2ElementVector__SWIG_1(G2ElementVector.getCPtr(other), other), true);
}
public int capacity() {
return DASHJBLSJNI.G2ElementVector_capacity(swigCPtr, this);
}
public void reserve(int n) {
DASHJBLSJNI.G2ElementVector_reserve(swigCPtr, this, n);
}
public boolean isEmpty() {
return DASHJBLSJNI.G2ElementVector_isEmpty(swigCPtr, this);
}
public void clear() {
DASHJBLSJNI.G2ElementVector_clear(swigCPtr, this);
}
public G2ElementVector(int count, G2Element value) {
this(DASHJBLSJNI.new_G2ElementVector__SWIG_2(count, G2Element.getCPtr(value), value), true);
}
private int doSize() {
return DASHJBLSJNI.G2ElementVector_doSize(swigCPtr, this);
}
private void doAdd(G2Element x) {
DASHJBLSJNI.G2ElementVector_doAdd__SWIG_0(swigCPtr, this, G2Element.getCPtr(x), x);
}
private void doAdd(int index, G2Element x) {
DASHJBLSJNI.G2ElementVector_doAdd__SWIG_1(swigCPtr, this, index, G2Element.getCPtr(x), x);
}
private G2Element doRemove(int index) {
return new G2Element(DASHJBLSJNI.G2ElementVector_doRemove(swigCPtr, this, index), true);
}
private G2Element doGet(int index) {
return new G2Element(DASHJBLSJNI.G2ElementVector_doGet(swigCPtr, this, index), false);
}
private G2Element doSet(int index, G2Element val) {
return new G2Element(DASHJBLSJNI.G2ElementVector_doSet(swigCPtr, this, index, G2Element.getCPtr(val), val), true);
}
private void doRemoveRange(int fromIndex, int toIndex) {
DASHJBLSJNI.G2ElementVector_doRemoveRange(swigCPtr, this, fromIndex, toIndex);
}
}