Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
BaseObjectiveMonitor.java
Go to the documentation of this file.
1/* ----------------------------------------------------------------------------
2 * This file was automatically generated by SWIG (https://www.swig.org).
3 * Version 4.3.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
11public class BaseObjectiveMonitor extends SearchMonitor {
12 private transient long swigCPtr;
13
14 public BaseObjectiveMonitor(long cPtr, boolean cMemoryOwn) {
15 super(mainJNI.BaseObjectiveMonitor_SWIGUpcast(cPtr), cMemoryOwn);
16 swigCPtr = cPtr;
17 }
18
19 public static long getCPtr(BaseObjectiveMonitor obj) {
20 return (obj == null) ? 0 : obj.swigCPtr;
21 }
22
23 public static long swigRelease(BaseObjectiveMonitor obj) {
24 long ptr = 0;
25 if (obj != null) {
26 if (!obj.swigCMemOwn)
27 throw new RuntimeException("Cannot release ownership as memory is not owned");
28 ptr = obj.swigCPtr;
29 obj.swigCMemOwn = false;
30 obj.delete();
31 }
32 return ptr;
33 }
34
35 @SuppressWarnings({"deprecation", "removal"})
36 protected void finalize() {
37 delete();
38 }
39
40 public synchronized void delete() {
41 if (swigCPtr != 0) {
42 if (swigCMemOwn) {
43 swigCMemOwn = false;
44 mainJNI.delete_BaseObjectiveMonitor(swigCPtr);
45 }
46 swigCPtr = 0;
47 }
48 super.delete();
49 }
50
51 public IntVar ObjectiveVar(int index) {
52 long cPtr = mainJNI.BaseObjectiveMonitor_ObjectiveVar(swigCPtr, this, index);
53 return (cPtr == 0) ? null : new IntVar(cPtr, false);
54 }
55
56 public IntVar MinimizationVar(int index) {
57 long cPtr = mainJNI.BaseObjectiveMonitor_MinimizationVar(swigCPtr, this, index);
58 return (cPtr == 0) ? null : new IntVar(cPtr, false);
59 }
60
61 public long Step(int index) {
62 return mainJNI.BaseObjectiveMonitor_Step(swigCPtr, this, index);
63 }
64
65 public boolean Maximize(int index) {
66 return mainJNI.BaseObjectiveMonitor_Maximize(swigCPtr, this, index);
67 }
68
69 public long BestValue(int index) {
70 return mainJNI.BaseObjectiveMonitor_BestValue(swigCPtr, this, index);
71 }
72
73 public int Size() {
74 return mainJNI.BaseObjectiveMonitor_Size(swigCPtr, this);
75 }
76
77 public boolean is_active() {
78 return mainJNI.BaseObjectiveMonitor_is_active(swigCPtr, this);
79 }
80
81 public void set_active(boolean is_active) {
82 mainJNI.BaseObjectiveMonitor_set_active(swigCPtr, this, is_active);
83 }
84
85}