Google OR-Tools v9.9
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
DisjunctiveConstraint.java
Go to the documentation of this file.
1/* ----------------------------------------------------------------------------
2 * This file was automatically generated by SWIG (https://www.swig.org).
3 * Version 4.2.0
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
11// Used to wrap IndexEvaluator2
12// see https://docs.oracle.com/javase/8/docs/api/java/util/function/LongBinaryOperator.html
13import java.util.function.LongBinaryOperator;
14
15public class DisjunctiveConstraint extends Constraint {
16 private transient long swigCPtr;
17
18 protected DisjunctiveConstraint(long cPtr, boolean cMemoryOwn) {
19 super(mainJNI.DisjunctiveConstraint_SWIGUpcast(cPtr), cMemoryOwn);
20 swigCPtr = cPtr;
21 }
22
23 protected static long getCPtr(DisjunctiveConstraint obj) {
24 return (obj == null) ? 0 : obj.swigCPtr;
25 }
26
27 protected static long swigRelease(DisjunctiveConstraint obj) {
28 long ptr = 0;
29 if (obj != null) {
30 if (!obj.swigCMemOwn)
31 throw new RuntimeException("Cannot release ownership as memory is not owned");
32 ptr = obj.swigCPtr;
33 obj.swigCMemOwn = false;
34 obj.delete();
35 }
36 return ptr;
37 }
38
39 @SuppressWarnings({"deprecation", "removal"})
40 protected void finalize() {
41 delete();
42 }
43
44 public synchronized void delete() {
45 if (swigCPtr != 0) {
46 if (swigCMemOwn) {
47 swigCMemOwn = false;
48 mainJNI.delete_DisjunctiveConstraint(swigCPtr);
49 }
50 swigCPtr = 0;
51 }
52 super.delete();
53 }
54
59 long cPtr = mainJNI.DisjunctiveConstraint_makeSequenceVar(swigCPtr, this);
60 return (cPtr == 0) ? null : new SequenceVar(cPtr, false);
61 }
62
69 public void setTransitionTime(LongBinaryOperator transition_time) {
70 mainJNI.DisjunctiveConstraint_setTransitionTime(swigCPtr, this, transition_time);
71 }
72
73 public long transitionTime(int before_index, int after_index) {
74 return mainJNI.DisjunctiveConstraint_transitionTime(swigCPtr, this, before_index, after_index);
75 }
76
77}