Google OR-Tools v9.9
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
BaseLns.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
40public class BaseLns extends IntVarLocalSearchOperator {
41 private transient long swigCPtr;
42
43 protected BaseLns(long cPtr, boolean cMemoryOwn) {
44 super(mainJNI.BaseLns_SWIGUpcast(cPtr), cMemoryOwn);
45 swigCPtr = cPtr;
46 }
47
48 protected static long getCPtr(BaseLns obj) {
49 return (obj == null) ? 0 : obj.swigCPtr;
50 }
51
52 protected static long swigRelease(BaseLns obj) {
53 long ptr = 0;
54 if (obj != null) {
55 if (!obj.swigCMemOwn)
56 throw new RuntimeException("Cannot release ownership as memory is not owned");
57 ptr = obj.swigCPtr;
58 obj.swigCMemOwn = false;
59 obj.delete();
60 }
61 return ptr;
62 }
63
64 @SuppressWarnings({"deprecation", "removal"})
65 protected void finalize() {
66 delete();
67 }
68
69 public synchronized void delete() {
70 if (swigCPtr != 0) {
71 if (swigCMemOwn) {
72 swigCMemOwn = false;
73 mainJNI.delete_BaseLns(swigCPtr);
74 }
75 swigCPtr = 0;
76 }
77 super.delete();
78 }
79
80 protected void swigDirectorDisconnect() {
81 swigCMemOwn = false;
82 delete();
83 }
84
85 public void swigReleaseOwnership() {
86 swigCMemOwn = false;
87 mainJNI.BaseLns_change_ownership(this, swigCPtr, false);
88 }
89
90 public void swigTakeOwnership() {
91 swigCMemOwn = true;
92 mainJNI.BaseLns_change_ownership(this, swigCPtr, true);
93 }
94
95 public BaseLns(IntVar[] vars) {
96 this(mainJNI.new_BaseLns(vars), true);
97 mainJNI.BaseLns_director_connect(this, swigCPtr, true, true);
98 }
99
100 public void initFragments() {
101 if (getClass() == BaseLns.class) mainJNI.BaseLns_initFragments(swigCPtr, this); else mainJNI.BaseLns_initFragmentsSwigExplicitBaseLns(swigCPtr, this);
102 }
103
104 public boolean nextFragment() {
105 return mainJNI.BaseLns_nextFragment(swigCPtr, this);
106 }
107
108 public void appendToFragment(int index) {
109 mainJNI.BaseLns_appendToFragment(swigCPtr, this, index);
110 }
111
112 public int fragmentSize() {
113 return mainJNI.BaseLns_fragmentSize(swigCPtr, this);
114 }
115
116 public boolean HasFragments() {
117 return (getClass() == BaseLns.class) ? mainJNI.BaseLns_HasFragments(swigCPtr, this) : mainJNI.BaseLns_HasFragmentsSwigExplicitBaseLns(swigCPtr, this);
118 }
119
120}
BaseLns(long cPtr, boolean cMemoryOwn)
Definition BaseLns.java:43
static long swigRelease(BaseLns obj)
Definition BaseLns.java:52