Google OR-Tools v9.9
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
Constraint.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
19public class Constraint extends PropagationBaseObject {
20 private transient long swigCPtr;
21
22 protected Constraint(long cPtr, boolean cMemoryOwn) {
23 super(mainJNI.Constraint_SWIGUpcast(cPtr), cMemoryOwn);
24 swigCPtr = cPtr;
25 }
26
27 protected static long getCPtr(Constraint obj) {
28 return (obj == null) ? 0 : obj.swigCPtr;
29 }
30
31 protected static long swigRelease(Constraint obj) {
32 long ptr = 0;
33 if (obj != null) {
34 if (!obj.swigCMemOwn)
35 throw new RuntimeException("Cannot release ownership as memory is not owned");
36 ptr = obj.swigCPtr;
37 obj.swigCMemOwn = false;
38 obj.delete();
39 }
40 return ptr;
41 }
42
43 @SuppressWarnings({"deprecation", "removal"})
44 protected void finalize() {
45 delete();
46 }
47
48 public synchronized void delete() {
49 if (swigCPtr != 0) {
50 if (swigCMemOwn) {
51 swigCMemOwn = false;
52 mainJNI.delete_Constraint(swigCPtr);
53 }
54 swigCPtr = 0;
55 }
56 super.delete();
57 }
58
63 public void post() {
64 mainJNI.Constraint_post(swigCPtr, this);
65 }
66
71 public void initialPropagate() {
72 mainJNI.Constraint_initialPropagate(swigCPtr, this);
73 }
74
75 public String toString() {
76 return mainJNI.Constraint_toString(swigCPtr, this);
77 }
78
83 public void postAndPropagate() {
84 mainJNI.Constraint_postAndPropagate(swigCPtr, this);
85 }
86
90 public void accept(ModelVisitor visitor) {
91 mainJNI.Constraint_accept(swigCPtr, this, ModelVisitor.getCPtr(visitor), visitor);
92 }
93
97 public boolean isCastConstraint() {
98 return mainJNI.Constraint_isCastConstraint(swigCPtr, this);
99 }
100
106 public IntVar var() {
107 long cPtr = mainJNI.Constraint_var(swigCPtr, this);
108 return (cPtr == 0) ? null : new IntVar(cPtr, false);
109 }
110
111}
Constraint(long cPtr, boolean cMemoryOwn)