Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
DecisionBuilder.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 DecisionBuilder extends BaseObject {
16 private transient long swigCPtr;
17
18 protected DecisionBuilder(long cPtr, boolean cMemoryOwn) {
19 super(mainJNI.DecisionBuilder_SWIGUpcast(cPtr), cMemoryOwn);
20 swigCPtr = cPtr;
21 }
22
23 protected static long getCPtr(DecisionBuilder obj) {
24 return (obj == null) ? 0 : obj.swigCPtr;
25 }
26
27 protected static long swigRelease(DecisionBuilder 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_DecisionBuilder(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.DecisionBuilder_change_ownership(this, swigCPtr, false);
63 }
64
65 public void swigTakeOwnership() {
66 swigCMemOwn = true;
67 mainJNI.DecisionBuilder_change_ownership(this, swigCPtr, true);
68 }
69
70 public DecisionBuilder() {
71 this(mainJNI.new_DecisionBuilder(), true);
72 mainJNI.DecisionBuilder_director_connect(this, swigCPtr, true, true);
73 }
74
82 long cPtr = mainJNI.DecisionBuilder_nextWrap(swigCPtr, this, Solver.getCPtr(s), s);
83 return (cPtr == 0) ? null : new Decision(cPtr, false);
84 }
85
86 public String toString() {
87 return (getClass() == DecisionBuilder.class) ? mainJNI.DecisionBuilder_toString(swigCPtr, this) : mainJNI.DecisionBuilder_toStringSwigExplicitDecisionBuilder(swigCPtr, this);
88 }
89
90 public void set_name(String name) {
91 mainJNI.DecisionBuilder_set_name(swigCPtr, this, name);
92 }
93
94 public String GetName() {
95 return mainJNI.DecisionBuilder_GetName(swigCPtr, this);
96 }
97
98}