Java Reference

Java Reference

ChangeValue.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 
17 public class ChangeValue extends IntVarLocalSearchOperator {
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  @SuppressWarnings("deprecation")
30  protected void finalize() {
31  delete();
32  }
33 
34  public synchronized void delete() {
35  if (swigCPtr != 0) {
36  if (swigCMemOwn) {
37  swigCMemOwn = false;
38  mainJNI.delete_ChangeValue(swigCPtr);
39  }
40  swigCPtr = 0;
41  }
42  super.delete();
43  }
44 
45  protected void swigDirectorDisconnect() {
46  swigCMemOwn = false;
47  delete();
48  }
49 
50  public void swigReleaseOwnership() {
51  swigCMemOwn = false;
52  mainJNI.ChangeValue_change_ownership(this, swigCPtr, false);
53  }
54 
55  public void swigTakeOwnership() {
56  swigCMemOwn = true;
57  mainJNI.ChangeValue_change_ownership(this, swigCPtr, true);
58  }
59 
60  public ChangeValue(IntVar[] vars) {
61  this(mainJNI.new_ChangeValue(vars), true);
62  mainJNI.ChangeValue_director_connect(this, swigCPtr, true, true);
63  }
64 
65  public long modifyValue(long index, long value) {
66  return mainJNI.ChangeValue_modifyValue(swigCPtr, this, index, value);
67  }
68 
72  protected boolean oneNeighbor() {
73  return (getClass() == ChangeValue.class) ? mainJNI.ChangeValue_oneNeighbor(swigCPtr, this) : mainJNI.ChangeValue_oneNeighborSwigExplicitChangeValue(swigCPtr, this);
74  }
75 
76 }
void swigReleaseOwnership()
long modifyValue(long index, long value)
void swigDirectorDisconnect()
boolean oneNeighbor()
This method should not be overridden.
The class IntVar is a subset of IntExpr.
ChangeValue(IntVar[] vars)
Defines operators which change the value of variables; each neighbor corresponds to one modified var...
ChangeValue(long cPtr, boolean cMemoryOwn)
void swigTakeOwnership()
long value(long index)
Returns the value in the current assignment of the variable of given index.