Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
IntVarLocalSearchFilter.java
Go to the documentation of this file.
1/* ----------------------------------------------------------------------------
2 * This file was automatically generated by SWIG (https://www.swig.org).
3 * Version 4.2.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
9package com.google.ortools.constraintsolver;
10
11// Used to wrap ObjectiveWatcher
12// see https://docs.oracle.com/javase/8/docs/api/java/util/function/LongConsumer.html
13import java.util.function.LongConsumer;
14
16 private transient long swigCPtr;
17
18 protected IntVarLocalSearchFilter(long cPtr, boolean cMemoryOwn) {
19 super(mainJNI.IntVarLocalSearchFilter_SWIGUpcast(cPtr), cMemoryOwn);
20 swigCPtr = cPtr;
21 }
22
23 protected static long getCPtr(IntVarLocalSearchFilter obj) {
24 return (obj == null) ? 0 : obj.swigCPtr;
25 }
26
27 protected static long swigRelease(IntVarLocalSearchFilter obj) {
28 long ptr = 0;
29 if (obj != null) {
30 if (!obj.swigCMemOwn)
31 throw new RuntimeException("Cannot release ownership as memory is not owned");
32 ptr = obj.swigCPtr;
33 obj.swigCMemOwn = false;
34 obj.delete();
35 }
36 return ptr;
37 }
38
39 @SuppressWarnings({"deprecation", "removal"})
40 protected void finalize() {
41 delete();
42 }
43
44 public synchronized void delete() {
45 if (swigCPtr != 0) {
46 if (swigCMemOwn) {
47 swigCMemOwn = false;
48 mainJNI.delete_IntVarLocalSearchFilter(swigCPtr);
49 }
50 swigCPtr = 0;
51 }
52 super.delete();
53 }
54
55 protected void swigDirectorDisconnect() {
56 swigCMemOwn = false;
57 delete();
58 }
59
60 public void swigReleaseOwnership() {
61 swigCMemOwn = false;
62 mainJNI.IntVarLocalSearchFilter_change_ownership(this, swigCPtr, false);
63 }
64
65 public void swigTakeOwnership() {
66 swigCMemOwn = true;
67 mainJNI.IntVarLocalSearchFilter_change_ownership(this, swigCPtr, true);
68 }
69
71 this(mainJNI.new_IntVarLocalSearchFilter(vars), true);
72 mainJNI.IntVarLocalSearchFilter_director_connect(this, swigCPtr, true, true);
73 }
74
79 public void synchronize(Assignment assignment, Assignment delta) {
80 mainJNI.IntVarLocalSearchFilter_synchronize(swigCPtr, this, Assignment.getCPtr(assignment), assignment, Assignment.getCPtr(delta), delta);
81 }
82
86 public void addVars(IntVar[] vars) {
87 mainJNI.IntVarLocalSearchFilter_addVars(swigCPtr, this, vars);
88 }
89
90 public int size() {
91 return mainJNI.IntVarLocalSearchFilter_size(swigCPtr, this);
92 }
93
94 public IntVar var(int index) {
95 long cPtr = mainJNI.IntVarLocalSearchFilter_var(swigCPtr, this, index);
96 return (cPtr == 0) ? null : new IntVar(cPtr, false);
97 }
98
99 public long value(int index) {
100 return mainJNI.IntVarLocalSearchFilter_value(swigCPtr, this, index);
101 }
102
103 protected void onSynchronize(Assignment delta) {
104 if (getClass() == IntVarLocalSearchFilter.class) mainJNI.IntVarLocalSearchFilter_onSynchronize(swigCPtr, this, Assignment.getCPtr(delta), delta); else mainJNI.IntVarLocalSearchFilter_onSynchronizeSwigExplicitIntVarLocalSearchFilter(swigCPtr, this, Assignment.getCPtr(delta), delta);
105 }
106
107 public int index(IntVar var) {
108 return mainJNI.IntVarLocalSearchFilter_index(swigCPtr, this, IntVar.getCPtr(var), var);
109 }
110
111}
void synchronize(Assignment assignment, Assignment delta)