157 lines
3.5 KiB
Java
157 lines
3.5 KiB
Java
|
/* ----------------------------------------------------------------------------
|
||
|
* 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 com.seantone.sxtwl;
|
||
|
|
||
|
public class JDList extends java.util.AbstractList<Double> implements java.util.RandomAccess {
|
||
|
private transient long swigCPtr;
|
||
|
protected transient boolean swigCMemOwn;
|
||
|
|
||
|
protected JDList(long cPtr, boolean cMemoryOwn) {
|
||
|
swigCMemOwn = cMemoryOwn;
|
||
|
swigCPtr = cPtr;
|
||
|
}
|
||
|
|
||
|
protected static long getCPtr(JDList obj) {
|
||
|
return (obj == null) ? 0 : obj.swigCPtr;
|
||
|
}
|
||
|
|
||
|
protected static long swigRelease(JDList 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;
|
||
|
sxtwlJNI.delete_JDList(swigCPtr);
|
||
|
}
|
||
|
swigCPtr = 0;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public JDList(double[] initialElements) {
|
||
|
this();
|
||
|
reserve(initialElements.length);
|
||
|
|
||
|
for (double element : initialElements) {
|
||
|
add(element);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public JDList(Iterable<Double> initialElements) {
|
||
|
this();
|
||
|
for (double element : initialElements) {
|
||
|
add(element);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public Double get(int index) {
|
||
|
return doGet(index);
|
||
|
}
|
||
|
|
||
|
public Double set(int index, Double e) {
|
||
|
return doSet(index, e);
|
||
|
}
|
||
|
|
||
|
public boolean add(Double e) {
|
||
|
modCount++;
|
||
|
doAdd(e);
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
public void add(int index, Double e) {
|
||
|
modCount++;
|
||
|
doAdd(index, e);
|
||
|
}
|
||
|
|
||
|
public Double remove(int index) {
|
||
|
modCount++;
|
||
|
return doRemove(index);
|
||
|
}
|
||
|
|
||
|
protected void removeRange(int fromIndex, int toIndex) {
|
||
|
modCount++;
|
||
|
doRemoveRange(fromIndex, toIndex);
|
||
|
}
|
||
|
|
||
|
public int size() {
|
||
|
return doSize();
|
||
|
}
|
||
|
|
||
|
public JDList() {
|
||
|
this(sxtwlJNI.new_JDList__SWIG_0(), true);
|
||
|
}
|
||
|
|
||
|
public JDList(JDList other) {
|
||
|
this(sxtwlJNI.new_JDList__SWIG_1(JDList.getCPtr(other), other), true);
|
||
|
}
|
||
|
|
||
|
public long capacity() {
|
||
|
return sxtwlJNI.JDList_capacity(swigCPtr, this);
|
||
|
}
|
||
|
|
||
|
public void reserve(long n) {
|
||
|
sxtwlJNI.JDList_reserve(swigCPtr, this, n);
|
||
|
}
|
||
|
|
||
|
public boolean isEmpty() {
|
||
|
return sxtwlJNI.JDList_isEmpty(swigCPtr, this);
|
||
|
}
|
||
|
|
||
|
public void clear() {
|
||
|
sxtwlJNI.JDList_clear(swigCPtr, this);
|
||
|
}
|
||
|
|
||
|
public JDList(int count, double value) {
|
||
|
this(sxtwlJNI.new_JDList__SWIG_2(count, value), true);
|
||
|
}
|
||
|
|
||
|
private int doSize() {
|
||
|
return sxtwlJNI.JDList_doSize(swigCPtr, this);
|
||
|
}
|
||
|
|
||
|
private void doAdd(double x) {
|
||
|
sxtwlJNI.JDList_doAdd__SWIG_0(swigCPtr, this, x);
|
||
|
}
|
||
|
|
||
|
private void doAdd(int index, double x) {
|
||
|
sxtwlJNI.JDList_doAdd__SWIG_1(swigCPtr, this, index, x);
|
||
|
}
|
||
|
|
||
|
private double doRemove(int index) {
|
||
|
return sxtwlJNI.JDList_doRemove(swigCPtr, this, index);
|
||
|
}
|
||
|
|
||
|
private double doGet(int index) {
|
||
|
return sxtwlJNI.JDList_doGet(swigCPtr, this, index);
|
||
|
}
|
||
|
|
||
|
private double doSet(int index, double val) {
|
||
|
return sxtwlJNI.JDList_doSet(swigCPtr, this, index, val);
|
||
|
}
|
||
|
|
||
|
private void doRemoveRange(int fromIndex, int toIndex) {
|
||
|
sxtwlJNI.JDList_doRemoveRange(swigCPtr, this, fromIndex, toIndex);
|
||
|
}
|
||
|
|
||
|
}
|