Java Reference

Java Reference

SequenceVar.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 
14 public class SequenceVar extends PropagationBaseObject {
15  private transient long swigCPtr;
16 
17  protected SequenceVar(long cPtr, boolean cMemoryOwn) {
18  super(mainJNI.SequenceVar_SWIGUpcast(cPtr), cMemoryOwn);
19  swigCPtr = cPtr;
20  }
21 
22  protected static long getCPtr(SequenceVar obj) {
23  return (obj == null) ? 0 : obj.swigCPtr;
24  }
25 
26  @SuppressWarnings("deprecation")
27  protected void finalize() {
28  delete();
29  }
30 
31  public synchronized void delete() {
32  if (swigCPtr != 0) {
33  if (swigCMemOwn) {
34  swigCMemOwn = false;
35  mainJNI.delete_SequenceVar(swigCPtr);
36  }
37  swigCPtr = 0;
38  }
39  super.delete();
40  }
41 
42  public SequenceVar(Solver s, IntervalVar[] intervals, IntVar[] nexts, String name) {
43  this(mainJNI.new_SequenceVar(Solver.getCPtr(s), s, intervals, nexts, name), true);
44  }
45 
46  public String toString() {
47  return mainJNI.SequenceVar_toString(swigCPtr, this);
48  }
49 
53  public void rankFirst(int index) {
54  mainJNI.SequenceVar_rankFirst(swigCPtr, this, index);
55  }
56 
60  public void rankNotFirst(int index) {
61  mainJNI.SequenceVar_rankNotFirst(swigCPtr, this, index);
62  }
63 
67  public void rankLast(int index) {
68  mainJNI.SequenceVar_rankLast(swigCPtr, this, index);
69  }
70 
74  public void rankNotLast(int index) {
75  mainJNI.SequenceVar_rankNotLast(swigCPtr, this, index);
76  }
77 
81  public void rankSequence(int[] rank_first, int[] rank_last, int[] unperformed) {
82  mainJNI.SequenceVar_rankSequence(swigCPtr, this, rank_first, rank_last, unperformed);
83  }
84 
88  public IntervalVar interval(int index) {
89  long cPtr = mainJNI.SequenceVar_interval(swigCPtr, this, index);
90  return (cPtr == 0) ? null : new IntervalVar(cPtr, false);
91  }
92 
96  public IntVar next(int index) {
97  long cPtr = mainJNI.SequenceVar_next(swigCPtr, this, index);
98  return (cPtr == 0) ? null : new IntVar(cPtr, false);
99  }
100 
104  public long size() {
105  return mainJNI.SequenceVar_size(swigCPtr, this);
106  }
107 
111  public void accept(ModelVisitor visitor) {
112  mainJNI.SequenceVar_accept(swigCPtr, this, ModelVisitor.getCPtr(visitor), visitor);
113  }
114 
115 }
Solver Class A solver represents the main computation engine.
Definition: Solver.java:57
long size()
Returns the number of interval vars in the sequence.
void rankLast(int index)
Ranks the index_th interval var first of all unranked interval vars.
SequenceVar(long cPtr, boolean cMemoryOwn)
IntVar next(int index)
Returns the next of the index_th interval of the sequence.
void accept(ModelVisitor visitor)
Accepts the given visitor.
void rankSequence(int[] rank_first, int[] rank_last, int[] unperformed)
Applies the following sequence of ranks, ranks first, then rank last.
SequenceVar(Solver s, IntervalVar[] intervals, IntVar[] nexts, String name)
NOLINT The PropagationBaseObject is a subclass of BaseObject that is also friend to the Solver class.
IntervalVar interval(int index)
Returns the index_th interval of the sequence.
A sequence variable is a variable whose domain is a set of possible orderings of the interval variabl...
void rankFirst(int index)
Ranks the index_th interval var first of all unranked interval vars.
void rankNotLast(int index)
Indicates that the index_th interval var will not be ranked first of all currently unranked interval ...
void rankNotFirst(int index)
Indicates that the index_th interval var will not be ranked first of all currently unranked interval ...