Java Reference

Java Reference

LocalSearchOperator.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 LocalSearchOperator extends BaseObject {
15  private transient long swigCPtr;
16 
17  protected LocalSearchOperator(long cPtr, boolean cMemoryOwn) {
18  super(mainJNI.LocalSearchOperator_SWIGUpcast(cPtr), cMemoryOwn);
19  swigCPtr = cPtr;
20  }
21 
22  protected static long getCPtr(LocalSearchOperator 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_LocalSearchOperator(swigCPtr);
36  }
37  swigCPtr = 0;
38  }
39  super.delete();
40  }
41 
42  protected void swigDirectorDisconnect() {
43  swigCMemOwn = false;
44  delete();
45  }
46 
47  public void swigReleaseOwnership() {
48  swigCMemOwn = false;
49  mainJNI.LocalSearchOperator_change_ownership(this, swigCPtr, false);
50  }
51 
52  public void swigTakeOwnership() {
53  swigCMemOwn = true;
54  mainJNI.LocalSearchOperator_change_ownership(this, swigCPtr, true);
55  }
56 
58  this(mainJNI.new_LocalSearchOperator(), true);
59  mainJNI.LocalSearchOperator_director_connect(this, swigCPtr, true, true);
60  }
61 
62  public boolean nextNeighbor(Assignment delta, Assignment deltadelta) {
63  return mainJNI.LocalSearchOperator_nextNeighbor(swigCPtr, this, Assignment.getCPtr(delta), delta, Assignment.getCPtr(deltadelta), deltadelta);
64  }
65 
66  public void start(Assignment assignment) {
67  mainJNI.LocalSearchOperator_start(swigCPtr, this, Assignment.getCPtr(assignment), assignment);
68  }
69 
70  public void reset() {
71  if (getClass() == LocalSearchOperator.class) mainJNI.LocalSearchOperator_reset(swigCPtr, this); else mainJNI.LocalSearchOperator_resetSwigExplicitLocalSearchOperator(swigCPtr, this);
72  }
73 
74  public boolean HasFragments() {
75  return (getClass() == LocalSearchOperator.class) ? mainJNI.LocalSearchOperator_HasFragments(swigCPtr, this) : mainJNI.LocalSearchOperator_HasFragmentsSwigExplicitLocalSearchOperator(swigCPtr, this);
76  }
77 
78  public boolean HoldsDelta() {
79  return (getClass() == LocalSearchOperator.class) ? mainJNI.LocalSearchOperator_HoldsDelta(swigCPtr, this) : mainJNI.LocalSearchOperator_HoldsDeltaSwigExplicitLocalSearchOperator(swigCPtr, this);
80  }
81 
82 }
void swigTakeOwnership()
LocalSearchOperator(long cPtr, boolean cMemoryOwn)
void reset()
This class represent a reversible FIFO structure.
boolean HoldsDelta()
An Assignment is a variable -> domains mapping, used to report solutions to the user.
Definition: Assignment.java:14
boolean nextNeighbor(Assignment delta, Assignment deltadelta)
boolean HasFragments()
void start(Assignment assignment)
A BaseObject is the root of all reversibly allocated objects.
Definition: BaseObject.java:14
void swigDirectorDisconnect()
LocalSearchOperator()
void swigReleaseOwnership()