us.ihmc.rtps.impl.fastRTPS.octetVector Maven / Gradle / Ivy
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 4.0.1
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package us.ihmc.rtps.impl.fastRTPS;
public class octetVector extends java.util.AbstractList implements java.util.RandomAccess {
private transient long swigCPtr;
protected transient boolean swigCMemOwn;
protected octetVector(long cPtr, boolean cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = cPtr;
}
protected static long getCPtr(octetVector obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
@SuppressWarnings("deprecation")
protected void finalize() {
delete();
}
public synchronized void delete() {
if (swigCPtr != 0) {
if (swigCMemOwn) {
swigCMemOwn = false;
FastRTPSJNI.delete_octetVector(swigCPtr);
}
swigCPtr = 0;
}
}
public octetVector(short[] initialElements) {
this();
reserve(initialElements.length);
for (short element : initialElements) {
add(element);
}
}
public octetVector(Iterable initialElements) {
this();
for (short element : initialElements) {
add(element);
}
}
public Short get(int index) {
return doGet(index);
}
public Short set(int index, Short e) {
return doSet(index, e);
}
public boolean add(Short e) {
modCount++;
doAdd(e);
return true;
}
public void add(int index, Short e) {
modCount++;
doAdd(index, e);
}
public Short remove(int index) {
modCount++;
return doRemove(index);
}
protected void removeRange(int fromIndex, int toIndex) {
modCount++;
doRemoveRange(fromIndex, toIndex);
}
public int size() {
return doSize();
}
public octetVector() {
this(FastRTPSJNI.new_octetVector__SWIG_0(), true);
}
public octetVector(octetVector other) {
this(FastRTPSJNI.new_octetVector__SWIG_1(octetVector.getCPtr(other), other), true);
}
public long capacity() {
return FastRTPSJNI.octetVector_capacity(swigCPtr, this);
}
public void reserve(long n) {
FastRTPSJNI.octetVector_reserve(swigCPtr, this, n);
}
public boolean isEmpty() {
return FastRTPSJNI.octetVector_isEmpty(swigCPtr, this);
}
public void clear() {
FastRTPSJNI.octetVector_clear(swigCPtr, this);
}
public octetVector(int count, short value) {
this(FastRTPSJNI.new_octetVector__SWIG_2(count, value), true);
}
private int doSize() {
return FastRTPSJNI.octetVector_doSize(swigCPtr, this);
}
private void doAdd(short x) {
FastRTPSJNI.octetVector_doAdd__SWIG_0(swigCPtr, this, x);
}
private void doAdd(int index, short x) {
FastRTPSJNI.octetVector_doAdd__SWIG_1(swigCPtr, this, index, x);
}
private short doRemove(int index) {
return FastRTPSJNI.octetVector_doRemove(swigCPtr, this, index);
}
private short doGet(int index) {
return FastRTPSJNI.octetVector_doGet(swigCPtr, this, index);
}
private short doSet(int index, short val) {
return FastRTPSJNI.octetVector_doSet(swigCPtr, this, index, val);
}
private void doRemoveRange(int fromIndex, int toIndex) {
FastRTPSJNI.octetVector_doRemoveRange(swigCPtr, this, fromIndex, toIndex);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy