Java Reference

Java Reference

SearchLimit.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 SearchLimit extends SearchMonitor {
15  private transient long swigCPtr;
16 
17  protected SearchLimit(long cPtr, boolean cMemoryOwn) {
18  super(mainJNI.SearchLimit_SWIGUpcast(cPtr), cMemoryOwn);
19  swigCPtr = cPtr;
20  }
21 
22  protected static long getCPtr(SearchLimit 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_SearchLimit(swigCPtr);
36  }
37  swigCPtr = 0;
38  }
39  super.delete();
40  }
41 
45  public boolean crossed() {
46  return mainJNI.SearchLimit_crossed(swigCPtr, this);
47  }
48 
52  public boolean check() {
53  return mainJNI.SearchLimit_check(swigCPtr, this);
54  }
55 
59  public void init() {
60  mainJNI.SearchLimit_init(swigCPtr, this);
61  }
62 
66  public void copy(SearchLimit limit) {
67  mainJNI.SearchLimit_copy(swigCPtr, this, SearchLimit.getCPtr(limit), limit);
68  }
69 
74  long cPtr = mainJNI.SearchLimit_makeClone(swigCPtr, this);
75  return (cPtr == 0) ? null : new SearchLimit(cPtr, false);
76  }
77 
81  public void enterSearch() {
82  mainJNI.SearchLimit_enterSearch(swigCPtr, this);
83  }
84 
86  mainJNI.SearchLimit_beginNextDecision(swigCPtr, this, DecisionBuilder.getCPtr(b), b);
87  }
88 
89  public void periodicCheck() {
90  mainJNI.SearchLimit_periodicCheck(swigCPtr, this);
91  }
92 
93  public void refuteDecision(Decision d) {
94  mainJNI.SearchLimit_refuteDecision(swigCPtr, this, Decision.getCPtr(d), d);
95  }
96 
97  public String toString() {
98  return mainJNI.SearchLimit_toString(swigCPtr, this);
99  }
100 
101 }
void init()
This method is called when the search limit is initialized.
void periodicCheck()
Periodic call to check limits in long running methods.
SearchLimit(long cPtr, boolean cMemoryOwn)
void copy(SearchLimit limit)
Copy a limit.
A DecisionBuilder is responsible for creating the search tree.
void beginNextDecision(DecisionBuilder b)
Before calling DecisionBuilder::Next.
boolean check()
This method is called to check the status of the limit.
boolean crossed()
Returns true if the limit has been crossed.
A Decision represents a choice point in the search tree.
Definition: Decision.java:14
A search monitor is a simple set of callbacks to monitor all search events.
SearchLimit makeClone()
Allocates a clone of the limit.
void enterSearch()
Internal methods.
void refuteDecision(Decision d)
Before refuting the decision.
String toString()
Base class of all search limits.