Java Reference

Java Reference

BooleanVar.java
Go to the documentation of this file.
1/* ----------------------------------------------------------------------------
2 * This file was automatically generated by SWIG (http://www.swig.org).
3 * Version 4.0.2
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 BooleanVar extends IntVar {
12 private transient long swigCPtr;
13
14 protected BooleanVar(long cPtr, boolean cMemoryOwn) {
15 super(mainJNI.BooleanVar_SWIGUpcast(cPtr), cMemoryOwn);
16 swigCPtr = cPtr;
17 }
18
19 protected static long getCPtr(BooleanVar obj) {
20 return (obj == null) ? 0 : obj.swigCPtr;
21 }
22
23 @SuppressWarnings("deprecation")
24 protected void finalize() {
25 delete();
26 }
27
28 public synchronized void delete() {
29 if (swigCPtr != 0) {
30 if (swigCMemOwn) {
31 swigCMemOwn = false;
32 mainJNI.delete_BooleanVar(swigCPtr);
33 }
34 swigCPtr = 0;
35 }
36 super.delete();
37 }
38
39 public static int getKUnboundBooleanVarValue() {
40 return mainJNI.BooleanVar_kUnboundBooleanVarValue_get();
41 }
42
43 public long min() {
44 return mainJNI.BooleanVar_min(swigCPtr, this);
45 }
46
47 public void setMin(long m) {
48 mainJNI.BooleanVar_setMin(swigCPtr, this, m);
49 }
50
51 public long max() {
52 return mainJNI.BooleanVar_max(swigCPtr, this);
53 }
54
55 public void setMax(long m) {
56 mainJNI.BooleanVar_setMax(swigCPtr, this, m);
57 }
58
59 public void setRange(long mi, long ma) {
60 mainJNI.BooleanVar_setRange(swigCPtr, this, mi, ma);
61 }
62
63 public boolean bound() {
64 return mainJNI.BooleanVar_bound(swigCPtr, this);
65 }
66
67 public long value() {
68 return mainJNI.BooleanVar_value(swigCPtr, this);
69 }
70
71 public void removeValue(long v) {
72 mainJNI.BooleanVar_removeValue(swigCPtr, this, v);
73 }
74
75 public void removeInterval(long l, long u) {
76 mainJNI.BooleanVar_removeInterval(swigCPtr, this, l, u);
77 }
78
79 public void whenBound(Demon d) {
80 mainJNI.BooleanVar_whenBound(swigCPtr, this, Demon.getCPtr(d), d);
81 }
82
83 public void whenRange(Demon d) {
84 mainJNI.BooleanVar_whenRange(swigCPtr, this, Demon.getCPtr(d), d);
85 }
86
87 public void whenDomain(Demon d) {
88 mainJNI.BooleanVar_whenDomain(swigCPtr, this, Demon.getCPtr(d), d);
89 }
90
91 public long size() {
92 return mainJNI.BooleanVar_size(swigCPtr, this);
93 }
94
95 public boolean contains(long v) {
96 return mainJNI.BooleanVar_contains(swigCPtr, this, v);
97 }
98
99 public IntVarIterator makeHoleIterator(boolean reversible) {
100 long cPtr = mainJNI.BooleanVar_makeHoleIterator(swigCPtr, this, reversible);
101 return (cPtr == 0) ? null : new IntVarIterator(cPtr, false);
102 }
103
104 public IntVarIterator makeDomainIterator(boolean reversible) {
105 long cPtr = mainJNI.BooleanVar_makeDomainIterator(swigCPtr, this, reversible);
106 return (cPtr == 0) ? null : new IntVarIterator(cPtr, false);
107 }
108
109 public String toString() {
110 return mainJNI.BooleanVar_toString(swigCPtr, this);
111 }
112
113 public int varType() {
114 return mainJNI.BooleanVar_varType(swigCPtr, this);
115 }
116
117 public IntVar isEqual(long constant) {
118 long cPtr = mainJNI.BooleanVar_isEqual(swigCPtr, this, constant);
119 return (cPtr == 0) ? null : new IntVar(cPtr, false);
120 }
121
122 public IntVar isDifferent(long constant) {
123 long cPtr = mainJNI.BooleanVar_isDifferent(swigCPtr, this, constant);
124 return (cPtr == 0) ? null : new IntVar(cPtr, false);
125 }
126
127 public IntVar isGreaterOrEqual(long constant) {
128 long cPtr = mainJNI.BooleanVar_isGreaterOrEqual(swigCPtr, this, constant);
129 return (cPtr == 0) ? null : new IntVar(cPtr, false);
130 }
131
132 public IntVar isLessOrEqual(long constant) {
133 long cPtr = mainJNI.BooleanVar_isLessOrEqual(swigCPtr, this, constant);
134 return (cPtr == 0) ? null : new IntVar(cPtr, false);
135 }
136
137 public void restoreValue() {
138 mainJNI.BooleanVar_restoreValue(swigCPtr, this);
139 }
140
141 public String baseName() {
142 return mainJNI.BooleanVar_baseName(swigCPtr, this);
143 }
144
145 public int rawValue() {
146 return mainJNI.BooleanVar_rawValue(swigCPtr, this);
147 }
148
149}
long size()
This method returns the number of values in the domain of the variable.
Definition: BooleanVar.java:91
String baseName()
Returns a base name for automatic naming.
void removeValue(long v)
This method removes the value 'v' from the domain of the variable.
Definition: BooleanVar.java:71
IntVar isEqual(long constant)
IsEqual.
boolean contains(long v)
This method returns whether the value 'v' is in the domain of the variable.
Definition: BooleanVar.java:95
IntVarIterator makeHoleIterator(boolean reversible)
Creates a hole iterator.
Definition: BooleanVar.java:99
void whenDomain(Demon d)
This method attaches a demon that will watch any domain modification of the domain of the variable.
Definition: BooleanVar.java:87
void whenBound(Demon d)
This method attaches a demon that will be awakened when the variable is bound.
Definition: BooleanVar.java:79
boolean bound()
Returns true if the min and the max of the expression are equal.
Definition: BooleanVar.java:63
IntVarIterator makeDomainIterator(boolean reversible)
Creates a domain iterator.
void removeInterval(long l, long u)
This method removes the interval 'l' .
Definition: BooleanVar.java:75
void setRange(long mi, long ma)
This method sets both the min and the max of the expression.
Definition: BooleanVar.java:59
void whenRange(Demon d)
Attach a demon that will watch the min or the max of the expression.
Definition: BooleanVar.java:83
long value()
This method returns the value of the variable.
Definition: BooleanVar.java:67
BooleanVar(long cPtr, boolean cMemoryOwn)
Definition: BooleanVar.java:14
A Demon is the base element of a propagation queue.
Definition: Demon.java:22
The class Iterator has two direct subclasses.