Java Reference

Java Reference

CastConstraint.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
16public class CastConstraint extends Constraint {
17 private transient long swigCPtr;
18
19 protected CastConstraint(long cPtr, boolean cMemoryOwn) {
20 super(mainJNI.CastConstraint_SWIGUpcast(cPtr), cMemoryOwn);
21 swigCPtr = cPtr;
22 }
23
24 protected static long getCPtr(CastConstraint obj) {
25 return (obj == null) ? 0 : obj.swigCPtr;
26 }
27
28 @SuppressWarnings("deprecation")
29 protected void finalize() {
30 delete();
31 }
32
33 public synchronized void delete() {
34 if (swigCPtr != 0) {
35 if (swigCMemOwn) {
36 swigCMemOwn = false;
37 mainJNI.delete_CastConstraint(swigCPtr);
38 }
39 swigCPtr = 0;
40 }
41 super.delete();
42 }
43
44 public IntVar target_var() {
45 long cPtr = mainJNI.CastConstraint_target_var(swigCPtr, this);
46 return (cPtr == 0) ? null : new IntVar(cPtr, false);
47 }
48
49}
Cast constraints are special channeling constraints designed to keep a variable in sync with an expr...