Java Reference

Java Reference

Demon.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.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 
9 package com.google.ortools.constraintsolver;
10 
14 public class Demon extends BaseObject {
15  private transient long swigCPtr;
16 
17  protected Demon(long cPtr, boolean cMemoryOwn) {
18  super(mainJNI.Demon_SWIGUpcast(cPtr), cMemoryOwn);
19  swigCPtr = cPtr;
20  }
21 
22  protected static long getCPtr(Demon obj) {
23  return (obj == null) ? 0 : obj.swigCPtr;
24  }
25 
26  @SuppressWarnings("deprecation")
27  protected void finalize() {
28  delete();
29  }
30 
31  public synchronized void delete() {
32  if (swigCPtr != 0) {
33  if (swigCMemOwn) {
34  swigCMemOwn = false;
35  mainJNI.delete_Demon(swigCPtr);
36  }
37  swigCPtr = 0;
38  }
39  super.delete();
40  }
41 
45  public void run(Solver s) {
46  mainJNI.Demon_run(swigCPtr, this, Solver.getCPtr(s), s);
47  }
48 
52  public int priority() {
53  return mainJNI.Demon_priority(swigCPtr, this);
54  }
55 
56  public String toString() {
57  return mainJNI.Demon_toString(swigCPtr, this);
58  }
59 
63  public void inhibit(Solver s) {
64  mainJNI.Demon_inhibit(swigCPtr, this, Solver.getCPtr(s), s);
65  }
66 
70  public void desinhibit(Solver s) {
71  mainJNI.Demon_desinhibit(swigCPtr, this, Solver.getCPtr(s), s);
72  }
73 
74 }
int priority()
This method returns the priority of the demon.
Definition: Demon.java:52
String toString()
Definition: Demon.java:56
A Demon is the base element of a propagation queue.
Definition: Demon.java:14
void inhibit(Solver s)
This method inhibits the demon in the search tree below the current position.
Definition: Demon.java:63
void run(Solver s)
This is the main callback of the demon.
Definition: Demon.java:45
Demon(long cPtr, boolean cMemoryOwn)
Definition: Demon.java:17
void desinhibit(Solver s)
This method un-inhibits the demon that was previously inhibited.
Definition: Demon.java:70
A BaseObject is the root of all reversibly allocated objects.
Definition: BaseObject.java:14
Solver Class A solver represents the main computation engine.
Definition: Solver.java:57