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.1
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 // Used to wrap IndexEvaluator2
12 // see https://docs.oracle.com/javase/8/docs/api/java/util/function/LongBinaryOperator.html
13 import java.util.function.LongBinaryOperator;
14 
15 public 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 
54  public void setTransitionTime(LongBinaryOperator transition_time) {
55  mainJNI.DisjunctiveConstraint_setTransitionTime(swigCPtr, this, transition_time);
56  }
57 
58  public long transitionTime(int before_index, int after_index) {
59  return mainJNI.DisjunctiveConstraint_transitionTime(swigCPtr, this, before_index, after_index);
60  }
61 
62 }
A constraint is the main modeling object.
long transitionTime(int before_index, int after_index)
SequenceVar makeSequenceVar()
Creates a sequence variable from the constraint.
A sequence variable is a variable whose domain is a set of possible orderings of the interval variabl...
void setTransitionTime(LongBinaryOperator transition_time)
Add a transition time between intervals.
DisjunctiveConstraint(long cPtr, boolean cMemoryOwn)