Java Reference

Java Reference

IntVarElement.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
9package com.google.ortools.constraintsolver;
10
11public class IntVarElement extends AssignmentElement {
12 private transient long swigCPtr;
13
14 protected IntVarElement(long cPtr, boolean cMemoryOwn) {
15 super(mainJNI.IntVarElement_SWIGUpcast(cPtr), cMemoryOwn);
16 swigCPtr = cPtr;
17 }
18
19 protected static long getCPtr(IntVarElement obj) {
20 return (obj == null) ? 0 : obj.swigCPtr;
21 }
22
23 @SuppressWarnings("deprecation")
24 protected void finalize() {
25 delete();
26 }
27
28 public synchronized void delete() {
29 if (swigCPtr != 0) {
30 if (swigCMemOwn) {
31 swigCMemOwn = false;
32 mainJNI.delete_IntVarElement(swigCPtr);
33 }
34 swigCPtr = 0;
35 }
36 super.delete();
37 }
38
39 public IntVarElement() {
40 this(mainJNI.new_IntVarElement__SWIG_0(), true);
41 }
42
44 this(mainJNI.new_IntVarElement__SWIG_1(IntVar.getCPtr(var), var), true);
45 }
46
47 public void reset(IntVar var) {
48 mainJNI.IntVarElement_reset(swigCPtr, this, IntVar.getCPtr(var), var);
49 }
50
52 long cPtr = mainJNI.IntVarElement_clone(swigCPtr, this);
53 return (cPtr == 0) ? null : new IntVarElement(cPtr, false);
54 }
55
56 public void copy(IntVarElement element) {
57 mainJNI.IntVarElement_copy(swigCPtr, this, IntVarElement.getCPtr(element), element);
58 }
59
60 public IntVar var() {
61 long cPtr = mainJNI.IntVarElement_var(swigCPtr, this);
62 return (cPtr == 0) ? null : new IntVar(cPtr, false);
63 }
64
65 public void store() {
66 mainJNI.IntVarElement_store(swigCPtr, this);
67 }
68
69 public void restore() {
70 mainJNI.IntVarElement_restore(swigCPtr, this);
71 }
72
73 public long min() {
74 return mainJNI.IntVarElement_min(swigCPtr, this);
75 }
76
77 public void setMin(long m) {
78 mainJNI.IntVarElement_setMin(swigCPtr, this, m);
79 }
80
81 public long max() {
82 return mainJNI.IntVarElement_max(swigCPtr, this);
83 }
84
85 public void setMax(long m) {
86 mainJNI.IntVarElement_setMax(swigCPtr, this, m);
87 }
88
89 public long value() {
90 return mainJNI.IntVarElement_value(swigCPtr, this);
91 }
92
93 public boolean bound() {
94 return mainJNI.IntVarElement_bound(swigCPtr, this);
95 }
96
97 public void setRange(long l, long u) {
98 mainJNI.IntVarElement_setRange(swigCPtr, this, l, u);
99 }
100
101 public void setValue(long v) {
102 mainJNI.IntVarElement_setValue(swigCPtr, this, v);
103 }
104
105 public String toString() {
106 return mainJNI.IntVarElement_toString(swigCPtr, this);
107 }
108
109}
IntVarElement(long cPtr, boolean cMemoryOwn)