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.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 
37 public class LocalSearchOperator extends BaseObject {
38  private transient long swigCPtr;
39 
40  protected LocalSearchOperator(long cPtr, boolean cMemoryOwn) {
41  super(mainJNI.LocalSearchOperator_SWIGUpcast(cPtr), cMemoryOwn);
42  swigCPtr = cPtr;
43  }
44 
45  protected static long getCPtr(LocalSearchOperator obj) {
46  return (obj == null) ? 0 : obj.swigCPtr;
47  }
48 
49  @SuppressWarnings("deprecation")
50  protected void finalize() {
51  delete();
52  }
53 
54  public synchronized void delete() {
55  if (swigCPtr != 0) {
56  if (swigCMemOwn) {
57  swigCMemOwn = false;
58  mainJNI.delete_LocalSearchOperator(swigCPtr);
59  }
60  swigCPtr = 0;
61  }
62  super.delete();
63  }
64 
65  protected void swigDirectorDisconnect() {
66  swigCMemOwn = false;
67  delete();
68  }
69 
70  public void swigReleaseOwnership() {
71  swigCMemOwn = false;
72  mainJNI.LocalSearchOperator_change_ownership(this, swigCPtr, false);
73  }
74 
75  public void swigTakeOwnership() {
76  swigCMemOwn = true;
77  mainJNI.LocalSearchOperator_change_ownership(this, swigCPtr, true);
78  }
79 
81  this(mainJNI.new_LocalSearchOperator(), true);
82  mainJNI.LocalSearchOperator_director_connect(this, swigCPtr, true, true);
83  }
84 
85  public boolean nextNeighbor(Assignment delta, Assignment deltadelta) {
86  return mainJNI.LocalSearchOperator_nextNeighbor(swigCPtr, this, Assignment.getCPtr(delta), delta, Assignment.getCPtr(deltadelta), deltadelta);
87  }
88 
89  public void start(Assignment assignment) {
90  mainJNI.LocalSearchOperator_start(swigCPtr, this, Assignment.getCPtr(assignment), assignment);
91  }
92 
93  public void reset() {
94  if (getClass() == LocalSearchOperator.class) mainJNI.LocalSearchOperator_reset(swigCPtr, this); else mainJNI.LocalSearchOperator_resetSwigExplicitLocalSearchOperator(swigCPtr, this);
95  }
96 
97  public boolean HasFragments() {
98  return (getClass() == LocalSearchOperator.class) ? mainJNI.LocalSearchOperator_HasFragments(swigCPtr, this) : mainJNI.LocalSearchOperator_HasFragmentsSwigExplicitLocalSearchOperator(swigCPtr, this);
99  }
100 
101  public boolean HoldsDelta() {
102  return (getClass() == LocalSearchOperator.class) ? mainJNI.LocalSearchOperator_HoldsDelta(swigCPtr, this) : mainJNI.LocalSearchOperator_HoldsDeltaSwigExplicitLocalSearchOperator(swigCPtr, this);
103  }
104 
105 }
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:15
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:16
void swigDirectorDisconnect()
LocalSearchOperator()
void swigReleaseOwnership()