IntVarElement.java
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2  * This file was automatically generated by SWIG (http://www.swig.org).
3  * Version 3.0.12
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 
9 package com.google.ortools.constraintsolver;
10 
11 public 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  protected void finalize() {
24  delete();
25  }
26 
27  public synchronized void delete() {
28  if (swigCPtr != 0) {
29  if (swigCMemOwn) {
30  swigCMemOwn = false;
31  mainJNI.delete_IntVarElement(swigCPtr);
32  }
33  swigCPtr = 0;
34  }
35  super.delete();
36  }
37 
38  public IntVarElement() {
39  this(mainJNI.new_IntVarElement__SWIG_0(), true);
40  }
41 
43  this(mainJNI.new_IntVarElement__SWIG_1(IntVar.getCPtr(var), var), true);
44  }
45 
46  public void reset(IntVar var) {
47  mainJNI.IntVarElement_reset(swigCPtr, this, IntVar.getCPtr(var), var);
48  }
49 
50  public IntVarElement clone() {
51  long cPtr = mainJNI.IntVarElement_clone(swigCPtr, this);
52  return (cPtr == 0) ? null : new IntVarElement(cPtr, false);
53  }
54 
55  public void copy(IntVarElement element) {
56  mainJNI.IntVarElement_copy(swigCPtr, this, IntVarElement.getCPtr(element), element);
57  }
58 
59  public IntVar var() {
60  long cPtr = mainJNI.IntVarElement_var(swigCPtr, this);
61  return (cPtr == 0) ? null : new IntVar(cPtr, false);
62  }
63 
64  public void store() {
65  mainJNI.IntVarElement_store(swigCPtr, this);
66  }
67 
68  public void restore() {
69  mainJNI.IntVarElement_restore(swigCPtr, this);
70  }
71 
72  public long min() {
73  return mainJNI.IntVarElement_min(swigCPtr, this);
74  }
75 
76  public void setMin(long m) {
77  mainJNI.IntVarElement_setMin(swigCPtr, this, m);
78  }
79 
80  public long max() {
81  return mainJNI.IntVarElement_max(swigCPtr, this);
82  }
83 
84  public void setMax(long m) {
85  mainJNI.IntVarElement_setMax(swigCPtr, this, m);
86  }
87 
88  public long value() {
89  return mainJNI.IntVarElement_value(swigCPtr, this);
90  }
91 
92  public boolean bound() {
93  return mainJNI.IntVarElement_bound(swigCPtr, this);
94  }
95 
96  public void setRange(long l, long u) {
97  mainJNI.IntVarElement_setRange(swigCPtr, this, l, u);
98  }
99 
100  public void setValue(long v) {
101  mainJNI.IntVarElement_setValue(swigCPtr, this, v);
102  }
103 
104  public String toString() {
105  return mainJNI.IntVarElement_toString(swigCPtr, this);
106  }
107 
108 }
IntVarElement(long cPtr, boolean cMemoryOwn)