s.fisco-bcos-tars-sdk.3.5.0.source-code.LogEntryVector Maven / Gradle / Ivy
The newest version!
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (https://www.swig.org).
* Version 4.1.1
*
* Do not make changes to this file unless you know what you are doing - modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package org.fisco.bcos.sdk.tars;
public class LogEntryVector extends java.util.AbstractList implements java.util.RandomAccess {
private transient long swigCPtr;
protected transient boolean swigCMemOwn;
protected LogEntryVector(long cPtr, boolean cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = cPtr;
}
protected static long getCPtr(LogEntryVector obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
protected static long swigRelease(LogEntryVector 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")
protected void finalize() {
delete();
}
public synchronized void delete() {
if (swigCPtr != 0) {
if (swigCMemOwn) {
swigCMemOwn = false;
bcosJNI.delete_LogEntryVector(swigCPtr);
}
swigCPtr = 0;
}
}
public LogEntryVector(LogEntry[] initialElements) {
this();
reserve(initialElements.length);
for (LogEntry element : initialElements) {
add(element);
}
}
public LogEntryVector(Iterable initialElements) {
this();
for (LogEntry element : initialElements) {
add(element);
}
}
public LogEntry get(int index) {
return doGet(index);
}
public LogEntry set(int index, LogEntry e) {
return doSet(index, e);
}
public boolean add(LogEntry e) {
modCount++;
doAdd(e);
return true;
}
public void add(int index, LogEntry e) {
modCount++;
doAdd(index, e);
}
public LogEntry remove(int index) {
modCount++;
return doRemove(index);
}
protected void removeRange(int fromIndex, int toIndex) {
modCount++;
doRemoveRange(fromIndex, toIndex);
}
public int size() {
return doSize();
}
public LogEntryVector() {
this(bcosJNI.new_LogEntryVector__SWIG_0(), true);
}
public LogEntryVector(LogEntryVector other) {
this(bcosJNI.new_LogEntryVector__SWIG_1(LogEntryVector.getCPtr(other), other), true);
}
public long capacity() {
return bcosJNI.LogEntryVector_capacity(swigCPtr, this);
}
public void reserve(long n) {
bcosJNI.LogEntryVector_reserve(swigCPtr, this, n);
}
public boolean isEmpty() {
return bcosJNI.LogEntryVector_isEmpty(swigCPtr, this);
}
public void clear() {
bcosJNI.LogEntryVector_clear(swigCPtr, this);
}
public LogEntryVector(int count, LogEntry value) {
this(bcosJNI.new_LogEntryVector__SWIG_2(count, LogEntry.getCPtr(value), value), true);
}
private int doSize() {
return bcosJNI.LogEntryVector_doSize(swigCPtr, this);
}
private void doAdd(LogEntry x) {
bcosJNI.LogEntryVector_doAdd__SWIG_0(swigCPtr, this, LogEntry.getCPtr(x), x);
}
private void doAdd(int index, LogEntry x) {
bcosJNI.LogEntryVector_doAdd__SWIG_1(swigCPtr, this, index, LogEntry.getCPtr(x), x);
}
private LogEntry doRemove(int index) {
return new LogEntry(bcosJNI.LogEntryVector_doRemove(swigCPtr, this, index), true);
}
private LogEntry doGet(int index) {
return new LogEntry(bcosJNI.LogEntryVector_doGet(swigCPtr, this, index), false);
}
private LogEntry doSet(int index, LogEntry val) {
return new LogEntry(bcosJNI.LogEntryVector_doSet(swigCPtr, this, index, LogEntry.getCPtr(val), val), true);
}
private void doRemoveRange(int fromIndex, int toIndex) {
bcosJNI.LogEntryVector_doRemoveRange(swigCPtr, this, fromIndex, toIndex);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy