Java Reference

Java Reference

BaseIntExpr.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 
9 package com.google.ortools.constraintsolver;
10 
38 public class BaseIntExpr extends IntExpr {
39  private transient long swigCPtr;
40 
41  protected BaseIntExpr(long cPtr, boolean cMemoryOwn) {
42  super(mainJNI.BaseIntExpr_SWIGUpcast(cPtr), cMemoryOwn);
43  swigCPtr = cPtr;
44  }
45 
46  protected static long getCPtr(BaseIntExpr obj) {
47  return (obj == null) ? 0 : obj.swigCPtr;
48  }
49 
50  @SuppressWarnings("deprecation")
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_BaseIntExpr(swigCPtr);
60  }
61  swigCPtr = 0;
62  }
63  super.delete();
64  }
65 
66  public IntVar var() {
67  long cPtr = mainJNI.BaseIntExpr_var(swigCPtr, this);
68  return (cPtr == 0) ? null : new IntVar(cPtr, false);
69  }
70 
71  public IntVar castToVar() {
72  long cPtr = mainJNI.BaseIntExpr_castToVar(swigCPtr, this);
73  return (cPtr == 0) ? null : new IntVar(cPtr, false);
74  }
75 
76 }
This is the base class for all expressions that are not variables.
BaseIntExpr(long cPtr, boolean cMemoryOwn)
IntVar var()
Creates a variable from the expression.
The class IntExpr is the base of all integer expressions in constraint programming.
Definition: IntExpr.java:20