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.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 
9 package com.google.ortools.constraintsolver;
10 
19 public class SequenceVar extends PropagationBaseObject {
20  private transient long swigCPtr;
21 
22  protected SequenceVar(long cPtr, boolean cMemoryOwn) {
23  super(mainJNI.SequenceVar_SWIGUpcast(cPtr), cMemoryOwn);
24  swigCPtr = cPtr;
25  }
26 
27  protected static long getCPtr(SequenceVar obj) {
28  return (obj == null) ? 0 : obj.swigCPtr;
29  }
30 
31  @SuppressWarnings("deprecation")
32  protected void finalize() {
33  delete();
34  }
35 
36  public synchronized void delete() {
37  if (swigCPtr != 0) {
38  if (swigCMemOwn) {
39  swigCMemOwn = false;
40  mainJNI.delete_SequenceVar(swigCPtr);
41  }
42  swigCPtr = 0;
43  }
44  super.delete();
45  }
46 
47  public SequenceVar(Solver s, IntervalVar[] intervals, IntVar[] nexts, String name) {
48  this(mainJNI.new_SequenceVar(Solver.getCPtr(s), s, intervals, nexts, name), true);
49  }
50 
51  public String toString() {
52  return mainJNI.SequenceVar_toString(swigCPtr, this);
53  }
54 
59  public void rankFirst(int index) {
60  mainJNI.SequenceVar_rankFirst(swigCPtr, this, index);
61  }
62 
67  public void rankNotFirst(int index) {
68  mainJNI.SequenceVar_rankNotFirst(swigCPtr, this, index);
69  }
70 
75  public void rankLast(int index) {
76  mainJNI.SequenceVar_rankLast(swigCPtr, this, index);
77  }
78 
83  public void rankNotLast(int index) {
84  mainJNI.SequenceVar_rankNotLast(swigCPtr, this, index);
85  }
86 
94  public void rankSequence(int[] rank_first, int[] rank_last, int[] unperformed) {
95  mainJNI.SequenceVar_rankSequence(swigCPtr, this, rank_first, rank_last, unperformed);
96  }
97 
101  public IntervalVar interval(int index) {
102  long cPtr = mainJNI.SequenceVar_interval(swigCPtr, this, index);
103  return (cPtr == 0) ? null : new IntervalVar(cPtr, false);
104  }
105 
109  public IntVar next(int index) {
110  long cPtr = mainJNI.SequenceVar_next(swigCPtr, this, index);
111  return (cPtr == 0) ? null : new IntVar(cPtr, false);
112  }
113 
117  public long size() {
118  return mainJNI.SequenceVar_size(swigCPtr, this);
119  }
120 
124  public void accept(ModelVisitor visitor) {
125  mainJNI.SequenceVar_accept(swigCPtr, this, ModelVisitor.getCPtr(visitor), visitor);
126  }
127 
128 }
NOLINT The PropagationBaseObject is a subclass of BaseObject that is also friend to the Solver clas...
A sequence variable is a variable whose domain is a set of possible orderings of the interval variab...
void rankLast(int index)
Ranks the index_th interval var first of all unranked interval vars.
long size()
Returns the number of interval vars in the sequence.
SequenceVar(long cPtr, boolean cMemoryOwn)
void rankSequence(int[] rank_first, int[] rank_last, int[] unperformed)
Applies the following sequence of ranks, ranks first, then rank last.
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...
SequenceVar(Solver s, IntervalVar[] intervals, IntVar[] nexts, String name)
void rankFirst(int index)
Ranks the index_th interval var first of all unranked interval vars.
IntVar next(int index)
Returns the next of the index_th interval of the sequence.
IntervalVar interval(int index)
Returns the index_th interval of the sequence.
void accept(ModelVisitor visitor)
Accepts the given visitor.
Solver Class A solver represents the main computation engine.
Definition: Solver.java:73