Google OR-Tools v9.9
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
IntExpr.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
20public class IntExpr extends PropagationBaseObject {
21 private transient long swigCPtr;
22
23 protected IntExpr(long cPtr, boolean cMemoryOwn) {
24 super(mainJNI.IntExpr_SWIGUpcast(cPtr), cMemoryOwn);
25 swigCPtr = cPtr;
26 }
27
28 protected static long getCPtr(IntExpr obj) {
29 return (obj == null) ? 0 : obj.swigCPtr;
30 }
31
32 protected static long swigRelease(IntExpr obj) {
33 long ptr = 0;
34 if (obj != null) {
35 if (!obj.swigCMemOwn)
36 throw new RuntimeException("Cannot release ownership as memory is not owned");
37 ptr = obj.swigCPtr;
38 obj.swigCMemOwn = false;
39 obj.delete();
40 }
41 return ptr;
42 }
43
44 @SuppressWarnings({"deprecation", "removal"})
45 protected void finalize() {
46 delete();
47 }
48
49 public synchronized void delete() {
50 if (swigCPtr != 0) {
51 if (swigCMemOwn) {
52 swigCMemOwn = false;
53 mainJNI.delete_IntExpr(swigCPtr);
54 }
55 swigCPtr = 0;
56 }
57 super.delete();
58 }
59
60 public long min() {
61 return mainJNI.IntExpr_min(swigCPtr, this);
62 }
63
64 public void setMin(long m) {
65 mainJNI.IntExpr_setMin(swigCPtr, this, m);
66 }
67
68 public long max() {
69 return mainJNI.IntExpr_max(swigCPtr, this);
70 }
71
72 public void setMax(long m) {
73 mainJNI.IntExpr_setMax(swigCPtr, this, m);
74 }
75
80 public void range(long[] l, long[] u) {
81 mainJNI.IntExpr_range(swigCPtr, this, l, u);
82 }
83
87 public void setRange(long l, long u) {
88 mainJNI.IntExpr_setRange(swigCPtr, this, l, u);
89 }
90
94 public void setValue(long v) {
95 mainJNI.IntExpr_setValue(swigCPtr, this, v);
96 }
97
101 public boolean bound() {
102 return mainJNI.IntExpr_bound(swigCPtr, this);
103 }
104
108 public boolean isVar() {
109 return mainJNI.IntExpr_isVar(swigCPtr, this);
110 }
111
115 public IntVar var() {
116 long cPtr = mainJNI.IntExpr_var(swigCPtr, this);
117 return (cPtr == 0) ? null : new IntVar(cPtr, false);
118 }
119
126 public IntVar varWithName(String name) {
127 long cPtr = mainJNI.IntExpr_varWithName(swigCPtr, this, name);
128 return (cPtr == 0) ? null : new IntVar(cPtr, false);
129 }
130
134 public void whenRange(Demon d) {
135 mainJNI.IntExpr_whenRange__SWIG_0(swigCPtr, this, Demon.getCPtr(d), d);
136 }
137
141 public void whenRange(Runnable closure) {
142 mainJNI.IntExpr_whenRange__SWIG_1(swigCPtr, this, closure);
143 }
144
148 public void accept(ModelVisitor visitor) {
149 mainJNI.IntExpr_accept(swigCPtr, this, ModelVisitor.getCPtr(visitor), visitor);
150 }
151
152}
static long swigRelease(IntExpr obj)
Definition IntExpr.java:32
void accept(ModelVisitor visitor)
Definition IntExpr.java:148
IntExpr(long cPtr, boolean cMemoryOwn)
Definition IntExpr.java:23