Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
IntVarElement.java
Go to the documentation of this file.
1/* ----------------------------------------------------------------------------
2 * This file was automatically generated by SWIG (https://www.swig.org).
3 * Version 4.2.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 com.google.ortools.constraintsolver;
10
11public class IntVarElement extends AssignmentElement {
12 private transient long swigCPtr;
13
14 protected IntVarElement(long cPtr, boolean cMemoryOwn) {
15 super(mainJNI.IntVarElement_SWIGUpcast(cPtr), cMemoryOwn);
16 swigCPtr = cPtr;
17 }
18
19 protected static long getCPtr(IntVarElement obj) {
20 return (obj == null) ? 0 : obj.swigCPtr;
21 }
22
23 protected static long swigRelease(IntVarElement obj) {
24 long ptr = 0;
25 if (obj != null) {
26 if (!obj.swigCMemOwn)
27 throw new RuntimeException("Cannot release ownership as memory is not owned");
28 ptr = obj.swigCPtr;
29 obj.swigCMemOwn = false;
30 obj.delete();
31 }
32 return ptr;
33 }
34
35 @SuppressWarnings({"deprecation", "removal"})
36 protected void finalize() {
37 delete();
38 }
39
40 public synchronized void delete() {
41 if (swigCPtr != 0) {
42 if (swigCMemOwn) {
43 swigCMemOwn = false;
44 mainJNI.delete_IntVarElement(swigCPtr);
45 }
46 swigCPtr = 0;
47 }
48 super.delete();
49 }
50
51 public IntVarElement() {
52 this(mainJNI.new_IntVarElement__SWIG_0(), true);
53 }
54
56 this(mainJNI.new_IntVarElement__SWIG_1(IntVar.getCPtr(var), var), true);
57 }
58
59 public void reset(IntVar var) {
60 mainJNI.IntVarElement_reset(swigCPtr, this, IntVar.getCPtr(var), var);
61 }
62
64 long cPtr = mainJNI.IntVarElement_clone(swigCPtr, this);
65 return (cPtr == 0) ? null : new IntVarElement(cPtr, false);
66 }
67
68 public void copy(IntVarElement element) {
69 mainJNI.IntVarElement_copy(swigCPtr, this, IntVarElement.getCPtr(element), element);
70 }
71
72 public IntVar var() {
73 long cPtr = mainJNI.IntVarElement_var(swigCPtr, this);
74 return (cPtr == 0) ? null : new IntVar(cPtr, false);
75 }
76
77 public void store() {
78 mainJNI.IntVarElement_store(swigCPtr, this);
79 }
80
81 public void restore() {
82 mainJNI.IntVarElement_restore(swigCPtr, this);
83 }
84
85 public long min() {
86 return mainJNI.IntVarElement_min(swigCPtr, this);
87 }
88
89 public void setMin(long m) {
90 mainJNI.IntVarElement_setMin(swigCPtr, this, m);
91 }
92
93 public long max() {
94 return mainJNI.IntVarElement_max(swigCPtr, this);
95 }
96
97 public void setMax(long m) {
98 mainJNI.IntVarElement_setMax(swigCPtr, this, m);
99 }
100
101 public long value() {
102 return mainJNI.IntVarElement_value(swigCPtr, this);
103 }
104
105 public boolean bound() {
106 return mainJNI.IntVarElement_bound(swigCPtr, this);
107 }
108
109 public void setRange(long l, long u) {
110 mainJNI.IntVarElement_setRange(swigCPtr, this, l, u);
111 }
112
113 public void setValue(long v) {
114 mainJNI.IntVarElement_setValue(swigCPtr, this, v);
115 }
116
117 public String toString() {
118 return mainJNI.IntVarElement_toString(swigCPtr, this);
119 }
120
121}