Java Reference

Java Reference

DecisionBuilder.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 
9 package com.google.ortools.constraintsolver;
10 
15 public 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  @SuppressWarnings("deprecation")
28  protected void finalize() {
29  delete();
30  }
31 
32  public synchronized void delete() {
33  if (swigCPtr != 0) {
34  if (swigCMemOwn) {
35  swigCMemOwn = false;
36  mainJNI.delete_DecisionBuilder(swigCPtr);
37  }
38  swigCPtr = 0;
39  }
40  super.delete();
41  }
42 
43  protected void swigDirectorDisconnect() {
44  swigCMemOwn = false;
45  delete();
46  }
47 
48  public void swigReleaseOwnership() {
49  swigCMemOwn = false;
50  mainJNI.DecisionBuilder_change_ownership(this, swigCPtr, false);
51  }
52 
53  public void swigTakeOwnership() {
54  swigCMemOwn = true;
55  mainJNI.DecisionBuilder_change_ownership(this, swigCPtr, true);
56  }
57 
58  public DecisionBuilder() {
59  this(mainJNI.new_DecisionBuilder(), true);
60  mainJNI.DecisionBuilder_director_connect(this, swigCPtr, true, true);
61  }
62 
69  public Decision nextWrap(Solver s) {
70  long cPtr = mainJNI.DecisionBuilder_nextWrap(swigCPtr, this, Solver.getCPtr(s), s);
71  return (cPtr == 0) ? null : new Decision(cPtr, false);
72  }
73 
74  public String toString() {
75  return (getClass() == DecisionBuilder.class) ? mainJNI.DecisionBuilder_toString(swigCPtr, this) : mainJNI.DecisionBuilder_toStringSwigExplicitDecisionBuilder(swigCPtr, this);
76  }
77 
78 }
A BaseObject is the root of all reversibly allocated objects.
Definition: BaseObject.java:16
A DecisionBuilder is responsible for creating the search tree.
Decision nextWrap(Solver s)
This is the main method of the decision builder class.
A Decision represents a choice point in the search tree.
Definition: Decision.java:15
Solver Class A solver represents the main computation engine.
Definition: Solver.java:73