Google OR-Tools v9.9
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
RevLong.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
18public class RevLong {
19 private transient long swigCPtr;
20 protected transient boolean swigCMemOwn;
21
22 protected RevLong(long cPtr, boolean cMemoryOwn) {
23 swigCMemOwn = cMemoryOwn;
24 swigCPtr = cPtr;
25 }
26
27 protected static long getCPtr(RevLong obj) {
28 return (obj == null) ? 0 : obj.swigCPtr;
29 }
30
31 protected static long swigRelease(RevLong obj) {
32 long ptr = 0;
33 if (obj != null) {
34 if (!obj.swigCMemOwn)
35 throw new RuntimeException("Cannot release ownership as memory is not owned");
36 ptr = obj.swigCPtr;
37 obj.swigCMemOwn = false;
38 obj.delete();
39 }
40 return ptr;
41 }
42
43 @SuppressWarnings({"deprecation", "removal"})
44 protected void finalize() {
45 delete();
46 }
47
48 public synchronized void delete() {
49 if (swigCPtr != 0) {
50 if (swigCMemOwn) {
51 swigCMemOwn = false;
52 mainJNI.delete_RevLong(swigCPtr);
53 }
54 swigCPtr = 0;
55 }
56 }
57
58 public RevLong(long val) {
59 this(mainJNI.new_RevLong(val), true);
60 }
61
62 public long value() {
63 return mainJNI.RevLong_value(swigCPtr, this);
64 }
65
66 public void setValue(Solver s, long val) {
67 mainJNI.RevLong_setValue(swigCPtr, this, Solver.getCPtr(s), s, val);
68 }
69
70}
static long swigRelease(RevLong obj)
Definition RevLong.java:31
RevLong(long cPtr, boolean cMemoryOwn)
Definition RevLong.java:22