Google OR-Tools v9.9
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
IntVar.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.0
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
16public class IntVar extends IntExpr {
17 private transient long swigCPtr;
18
19 protected IntVar(long cPtr, boolean cMemoryOwn) {
20 super(mainJNI.IntVar_SWIGUpcast(cPtr), cMemoryOwn);
21 swigCPtr = cPtr;
22 }
23
24 protected static long getCPtr(IntVar obj) {
25 return (obj == null) ? 0 : obj.swigCPtr;
26 }
27
28 protected static long swigRelease(IntVar obj) {
29 long ptr = 0;
30 if (obj != null) {
31 if (!obj.swigCMemOwn)
32 throw new RuntimeException("Cannot release ownership as memory is not owned");
33 ptr = obj.swigCPtr;
34 obj.swigCMemOwn = false;
35 obj.delete();
36 }
37 return ptr;
38 }
39
40 @SuppressWarnings({"deprecation", "removal"})
41 protected void finalize() {
42 delete();
43 }
44
45 public synchronized void delete() {
46 if (swigCPtr != 0) {
47 if (swigCMemOwn) {
48 swigCMemOwn = false;
49 mainJNI.delete_IntVar(swigCPtr);
50 }
51 swigCPtr = 0;
52 }
53 super.delete();
54 }
55
56 public boolean isVar() {
57 return mainJNI.IntVar_isVar(swigCPtr, this);
58 }
59
60 public IntVar var() {
61 long cPtr = mainJNI.IntVar_var(swigCPtr, this);
62 return (cPtr == 0) ? null : new IntVar(cPtr, false);
63 }
64
69 public long value() {
70 return mainJNI.IntVar_value(swigCPtr, this);
71 }
72
76 public void removeValue(long v) {
77 mainJNI.IntVar_removeValue(swigCPtr, this, v);
78 }
79
84 public void removeInterval(long l, long u) {
85 mainJNI.IntVar_removeInterval(swigCPtr, this, l, u);
86 }
87
91 public void removeValues(long[] values) {
92 mainJNI.IntVar_removeValues(swigCPtr, this, values);
93 }
94
98 public void setValue(long[] values) {
99 mainJNI.IntVar_setValue(swigCPtr, this, values);
100 }
101
106 public void whenBound(Demon d) {
107 mainJNI.IntVar_whenBound__SWIG_0(swigCPtr, this, Demon.getCPtr(d), d);
108 }
109
114 public void whenBound(Runnable closure) {
115 mainJNI.IntVar_whenBound__SWIG_1(swigCPtr, this, closure);
116 }
117
122 public void whenDomain(Demon d) {
123 mainJNI.IntVar_whenDomain__SWIG_0(swigCPtr, this, Demon.getCPtr(d), d);
124 }
125
130 public void whenDomain(Runnable closure) {
131 mainJNI.IntVar_whenDomain__SWIG_1(swigCPtr, this, closure);
132 }
133
137 public long size() {
138 return mainJNI.IntVar_size(swigCPtr, this);
139 }
140
145 public boolean contains(long v) {
146 return mainJNI.IntVar_contains(swigCPtr, this, v);
147 }
148
154 public IntVarIterator makeHoleIterator(boolean reversible) {
155 long cPtr = mainJNI.IntVar_makeHoleIterator(swigCPtr, this, reversible);
156 return (cPtr == 0) ? null : new IntVarIterator(cPtr, false);
157 }
158
164 public IntVarIterator makeDomainIterator(boolean reversible) {
165 long cPtr = mainJNI.IntVar_makeDomainIterator(swigCPtr, this, reversible);
166 return (cPtr == 0) ? null : new IntVarIterator(cPtr, false);
167 }
168
172 public long oldMin() {
173 return mainJNI.IntVar_oldMin(swigCPtr, this);
174 }
175
179 public long oldMax() {
180 return mainJNI.IntVar_oldMax(swigCPtr, this);
181 }
182
183 public int varType() {
184 return mainJNI.IntVar_varType(swigCPtr, this);
185 }
186
190 public void accept(ModelVisitor visitor) {
191 mainJNI.IntVar_accept(swigCPtr, this, ModelVisitor.getCPtr(visitor), visitor);
192 }
193
197 public IntVar isEqual(long constant) {
198 long cPtr = mainJNI.IntVar_isEqual(swigCPtr, this, constant);
199 return (cPtr == 0) ? null : new IntVar(cPtr, false);
200 }
201
202 public IntVar isDifferent(long constant) {
203 long cPtr = mainJNI.IntVar_isDifferent(swigCPtr, this, constant);
204 return (cPtr == 0) ? null : new IntVar(cPtr, false);
205 }
206
207 public IntVar isGreaterOrEqual(long constant) {
208 long cPtr = mainJNI.IntVar_isGreaterOrEqual(swigCPtr, this, constant);
209 return (cPtr == 0) ? null : new IntVar(cPtr, false);
210 }
211
212 public IntVar isLessOrEqual(long constant) {
213 long cPtr = mainJNI.IntVar_isLessOrEqual(swigCPtr, this, constant);
214 return (cPtr == 0) ? null : new IntVar(cPtr, false);
215 }
216
220 public int index() {
221 return mainJNI.IntVar_index(swigCPtr, this);
222 }
223
224}
IntVarIterator makeDomainIterator(boolean reversible)
Definition IntVar.java:164
void accept(ModelVisitor visitor)
Definition IntVar.java:190
static long swigRelease(IntVar obj)
Definition IntVar.java:28
IntVar(long cPtr, boolean cMemoryOwn)
Definition IntVar.java:19
IntVarIterator makeHoleIterator(boolean reversible)
Definition IntVar.java:154