Java Reference

Java Reference

DisjunctiveConstraint.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
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 @SuppressWarnings("deprecation")
28 protected void finalize() {
29 delete();
30 }
31
32 public synchronized void delete() {
33 if (swigCPtr != 0) {
34 if (swigCMemOwn) {
35 swigCMemOwn = false;
36 mainJNI.delete_DisjunctiveConstraint(swigCPtr);
37 }
38 swigCPtr = 0;
39 }
40 super.delete();
41 }
42
47 long cPtr = mainJNI.DisjunctiveConstraint_makeSequenceVar(swigCPtr, this);
48 return (cPtr == 0) ? null : new SequenceVar(cPtr, false);
49 }
50
57 public void setTransitionTime(LongBinaryOperator transition_time) {
58 mainJNI.DisjunctiveConstraint_setTransitionTime(swigCPtr, this, transition_time);
59 }
60
61 public long transitionTime(int before_index, int after_index) {
62 return mainJNI.DisjunctiveConstraint_transitionTime(swigCPtr, this, before_index, after_index);
63 }
64
65}
SequenceVar makeSequenceVar()
Creates a sequence variable from the constraint.
void setTransitionTime(LongBinaryOperator transition_time)
Add a transition time between intervals.
A sequence variable is a variable whose domain is a set of possible orderings of the interval variab...