IntExpr.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 IntExpr extends PropagationBaseObject {
12  private transient long swigCPtr;
13 
14  protected IntExpr(long cPtr, boolean cMemoryOwn) {
15  super(mainJNI.IntExpr_SWIGUpcast(cPtr), cMemoryOwn);
16  swigCPtr = cPtr;
17  }
18 
19  protected static long getCPtr(IntExpr 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_IntExpr(swigCPtr);
32  }
33  swigCPtr = 0;
34  }
35  super.delete();
36  }
37 
38  public long min() {
39  return mainJNI.IntExpr_min(swigCPtr, this);
40  }
41 
42  public void setMin(long m) {
43  mainJNI.IntExpr_setMin(swigCPtr, this, m);
44  }
45 
46  public long max() {
47  return mainJNI.IntExpr_max(swigCPtr, this);
48  }
49 
50  public void setMax(long m) {
51  mainJNI.IntExpr_setMax(swigCPtr, this, m);
52  }
53 
54  public void range(long[] l, long[] u) {
55  mainJNI.IntExpr_range(swigCPtr, this, l, u);
56  }
57 
58  public void setRange(long l, long u) {
59  mainJNI.IntExpr_setRange(swigCPtr, this, l, u);
60  }
61 
62  public void setValue(long v) {
63  mainJNI.IntExpr_setValue(swigCPtr, this, v);
64  }
65 
66  public boolean bound() {
67  return mainJNI.IntExpr_bound(swigCPtr, this);
68  }
69 
70  public boolean isVar() {
71  return mainJNI.IntExpr_isVar(swigCPtr, this);
72  }
73 
74  public IntVar var() {
75  long cPtr = mainJNI.IntExpr_var(swigCPtr, this);
76  return (cPtr == 0) ? null : new IntVar(cPtr, false);
77  }
78 
79  public IntVar varWithName(String name) {
80  long cPtr = mainJNI.IntExpr_varWithName(swigCPtr, this, name);
81  return (cPtr == 0) ? null : new IntVar(cPtr, false);
82  }
83 
84  public void whenRange(Demon d) {
85  mainJNI.IntExpr_whenRange__SWIG_0(swigCPtr, this, Demon.getCPtr(d), d);
86  }
87 
88  public void whenRange(Runnable closure) {
89  mainJNI.IntExpr_whenRange__SWIG_1(swigCPtr, this, closure);
90  }
91 
92  public void accept(ModelVisitor visitor) {
93  mainJNI.IntExpr_accept(swigCPtr, this, ModelVisitor.getCPtr(visitor), visitor);
94  }
95 
96 }
static long getCPtr(Demon obj)
Definition: Demon.java:19
IntExpr(long cPtr, boolean cMemoryOwn)
Definition: IntExpr.java:14
void accept(ModelVisitor visitor)
Definition: IntExpr.java:92
static long getCPtr(IntExpr obj)
Definition: IntExpr.java:19