Google OR-Tools v9.9
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
ChangeValue.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.0
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
18 private transient long swigCPtr;
19
20 protected ChangeValue(long cPtr, boolean cMemoryOwn) {
21 super(mainJNI.ChangeValue_SWIGUpcast(cPtr), cMemoryOwn);
22 swigCPtr = cPtr;
23 }
24
25 protected static long getCPtr(ChangeValue obj) {
26 return (obj == null) ? 0 : obj.swigCPtr;
27 }
28
29 protected static long swigRelease(ChangeValue obj) {
30 long ptr = 0;
31 if (obj != null) {
32 if (!obj.swigCMemOwn)
33 throw new RuntimeException("Cannot release ownership as memory is not owned");
34 ptr = obj.swigCPtr;
35 obj.swigCMemOwn = false;
36 obj.delete();
37 }
38 return ptr;
39 }
40
41 @SuppressWarnings({"deprecation", "removal"})
42 protected void finalize() {
43 delete();
44 }
45
46 public synchronized void delete() {
47 if (swigCPtr != 0) {
48 if (swigCMemOwn) {
49 swigCMemOwn = false;
50 mainJNI.delete_ChangeValue(swigCPtr);
51 }
52 swigCPtr = 0;
53 }
54 super.delete();
55 }
56
57 protected void swigDirectorDisconnect() {
58 swigCMemOwn = false;
59 delete();
60 }
61
62 public void swigReleaseOwnership() {
63 swigCMemOwn = false;
64 mainJNI.ChangeValue_change_ownership(this, swigCPtr, false);
65 }
66
67 public void swigTakeOwnership() {
68 swigCMemOwn = true;
69 mainJNI.ChangeValue_change_ownership(this, swigCPtr, true);
70 }
71
72 public ChangeValue(IntVar[] vars) {
73 this(mainJNI.new_ChangeValue(vars), true);
74 mainJNI.ChangeValue_director_connect(this, swigCPtr, true, true);
75 }
76
77 public long modifyValue(long index, long value) {
78 return mainJNI.ChangeValue_modifyValue(swigCPtr, this, index, value);
79 }
80
84 protected boolean oneNeighbor() {
85 return (getClass() == ChangeValue.class) ? mainJNI.ChangeValue_oneNeighbor(swigCPtr, this) : mainJNI.ChangeValue_oneNeighborSwigExplicitChangeValue(swigCPtr, this);
86 }
87
88}
ChangeValue(long cPtr, boolean cMemoryOwn)