Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
Decision.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
15public class Decision extends BaseObject {
16 private transient long swigCPtr;
17
18 protected Decision(long cPtr, boolean cMemoryOwn) {
19 super(mainJNI.Decision_SWIGUpcast(cPtr), cMemoryOwn);
20 swigCPtr = cPtr;
21 }
22
23 protected static long getCPtr(Decision obj) {
24 return (obj == null) ? 0 : obj.swigCPtr;
25 }
26
27 protected static long swigRelease(Decision obj) {
28 long ptr = 0;
29 if (obj != null) {
30 if (!obj.swigCMemOwn)
31 throw new RuntimeException("Cannot release ownership as memory is not owned");
32 ptr = obj.swigCPtr;
33 obj.swigCMemOwn = false;
34 obj.delete();
35 }
36 return ptr;
37 }
38
39 @SuppressWarnings({"deprecation", "removal"})
40 protected void finalize() {
41 delete();
42 }
43
44 public synchronized void delete() {
45 if (swigCPtr != 0) {
46 if (swigCMemOwn) {
47 swigCMemOwn = false;
48 mainJNI.delete_Decision(swigCPtr);
49 }
50 swigCPtr = 0;
51 }
52 super.delete();
53 }
54
55 protected void swigDirectorDisconnect() {
56 swigCMemOwn = false;
57 delete();
58 }
59
60 public void swigReleaseOwnership() {
61 swigCMemOwn = false;
62 mainJNI.Decision_change_ownership(this, swigCPtr, false);
63 }
64
65 public void swigTakeOwnership() {
66 swigCMemOwn = true;
67 mainJNI.Decision_change_ownership(this, swigCPtr, true);
68 }
69
70 public Decision() {
71 this(mainJNI.new_Decision(), true);
72 mainJNI.Decision_director_connect(this, swigCPtr, true, true);
73 }
74
78 public void apply(Solver s) {
79 mainJNI.Decision_apply(swigCPtr, this, Solver.getCPtr(s), s);
80 }
81
85 public void refute(Solver s) {
86 mainJNI.Decision_refute(swigCPtr, this, Solver.getCPtr(s), s);
87 }
88
89 public String toString() {
90 return (getClass() == Decision.class) ? mainJNI.Decision_toString(swigCPtr, this) : mainJNI.Decision_toStringSwigExplicitDecision(swigCPtr, this);
91 }
92
96 public void accept(DecisionVisitor visitor) {
97 if (getClass() == Decision.class) mainJNI.Decision_accept(swigCPtr, this, DecisionVisitor.getCPtr(visitor), visitor); else mainJNI.Decision_acceptSwigExplicitDecision(swigCPtr, this, DecisionVisitor.getCPtr(visitor), visitor);
98 }
99
100}
static long swigRelease(Decision obj)
Definition Decision.java:27
Decision(long cPtr, boolean cMemoryOwn)
Definition Decision.java:18
void accept(DecisionVisitor visitor)
Definition Decision.java:96