Google OR-Tools v9.9
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
BoundCost.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
25public class BoundCost {
26 private transient long swigCPtr;
27 protected transient boolean swigCMemOwn;
28
29 public BoundCost(long cPtr, boolean cMemoryOwn) {
30 swigCMemOwn = cMemoryOwn;
31 swigCPtr = cPtr;
32 }
33
34 public static long getCPtr(BoundCost obj) {
35 return (obj == null) ? 0 : obj.swigCPtr;
36 }
37
38 public static long swigRelease(BoundCost obj) {
39 long ptr = 0;
40 if (obj != null) {
41 if (!obj.swigCMemOwn)
42 throw new RuntimeException("Cannot release ownership as memory is not owned");
43 ptr = obj.swigCPtr;
44 obj.swigCMemOwn = false;
45 obj.delete();
46 }
47 return ptr;
48 }
49
50 @SuppressWarnings({"deprecation", "removal"})
51 protected void finalize() {
52 delete();
53 }
54
55 public synchronized void delete() {
56 if (swigCPtr != 0) {
57 if (swigCMemOwn) {
58 swigCMemOwn = false;
59 mainJNI.delete_BoundCost(swigCPtr);
60 }
61 swigCPtr = 0;
62 }
63 }
64
65 public void setBound(long value) {
66 mainJNI.BoundCost_bound_set(swigCPtr, this, value);
67 }
68
69 public long getBound() {
70 return mainJNI.BoundCost_bound_get(swigCPtr, this);
71 }
72
73 public void setCost(long value) {
74 mainJNI.BoundCost_cost_set(swigCPtr, this, value);
75 }
76
77 public long getCost() {
78 return mainJNI.BoundCost_cost_get(swigCPtr, this);
79 }
80
81 public BoundCost() {
82 this(mainJNI.new_BoundCost__SWIG_0(), true);
83 }
84
85 public BoundCost(long bound, long cost) {
86 this(mainJNI.new_BoundCost__SWIG_1(bound, cost), true);
87 }
88
89}
BoundCost(long cPtr, boolean cMemoryOwn)