CONOPT
Loading...
Searching...
No Matches
intArray.java
Go to the documentation of this file.
1/* ----------------------------------------------------------------------------
2 * This file was automatically generated by SWIG (https://www.swig.org).
3 * Version 4.3.1
4 *
5 * Do not make changes to this file unless you know what you are doing - modify
6 * the SWIG interface file instead.
7 * ----------------------------------------------------------------------------- */
8
9package jconopt;
10
11public class intArray {
12 private transient long swigCPtr;
13 protected transient boolean swigCMemOwn;
14
15 protected intArray(long cPtr, boolean cMemoryOwn) {
16 swigCMemOwn = cMemoryOwn;
17 swigCPtr = cPtr;
18 }
19
20 protected static long getCPtr(intArray obj) {
21 return (obj == null) ? 0 : obj.swigCPtr;
22 }
23
24 protected static long swigRelease(intArray obj) {
25 long ptr = 0;
26 if (obj != null) {
27 if (!obj.swigCMemOwn)
28 throw new RuntimeException("Cannot release ownership as memory is not owned");
29 ptr = obj.swigCPtr;
30 obj.swigCMemOwn = false;
31 obj.delete();
32 }
33 return ptr;
34 }
35
36 @SuppressWarnings({"deprecation", "removal"})
37 protected void finalize() {
38 delete();
39 }
40
41 public synchronized void delete() {
42 if (swigCPtr != 0) {
43 if (swigCMemOwn) {
44 swigCMemOwn = false;
46 }
47 swigCPtr = 0;
48 }
49 }
50
51 public intArray(long nelements) {
52 this(jconoptJNI.new_intArray(nelements), true);
53 }
54
55 public int getitem(long index) {
56 return jconoptJNI.intArray_getitem(swigCPtr, this, index);
57 }
58
59 public void setitem(long index, int value) {
60 jconoptJNI.intArray_setitem(swigCPtr, this, index, value);
61 }
62
64 long cPtr = jconoptJNI.intArray_cast(swigCPtr, this);
65 return (cPtr == 0) ? null : new SWIGTYPE_p_int(cPtr, false);
66 }
67
70 return (cPtr == 0) ? null : new intArray(cPtr, false);
71 }
72
73}
static long getCPtr(SWIGTYPE_p_int obj)
static long swigRelease(intArray obj)
Definition intArray.java:24
void setitem(long index, int value)
Definition intArray.java:59
static intArray frompointer(SWIGTYPE_p_int t)
Definition intArray.java:68
int getitem(long index)
Definition intArray.java:55
static long getCPtr(intArray obj)
Definition intArray.java:20
intArray(long cPtr, boolean cMemoryOwn)
Definition intArray.java:15
synchronized void delete()
Definition intArray.java:41
transient boolean swigCMemOwn
Definition intArray.java:13
SWIGTYPE_p_int cast()
Definition intArray.java:63
intArray(long nelements)
Definition intArray.java:51
static final native void intArray_setitem(long jarg1, intArray jarg1_, long jarg2, int jarg3)
static final native long intArray_cast(long jarg1, intArray jarg1_)
static final native long new_intArray(long jarg1)
static final native long intArray_frompointer(long jarg1)
static final native void delete_intArray(long jarg1)
static final native int intArray_getitem(long jarg1, intArray jarg1_, long jarg2)