SequenceVar.java
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2  * This file was automatically generated by SWIG (http://www.swig.org).
3  * Version 3.0.12
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 public class SequenceVar extends PropagationBaseObject {
12  private transient long swigCPtr;
13 
14  protected SequenceVar(long cPtr, boolean cMemoryOwn) {
15  super(mainJNI.SequenceVar_SWIGUpcast(cPtr), cMemoryOwn);
16  swigCPtr = cPtr;
17  }
18 
19  protected static long getCPtr(SequenceVar obj) {
20  return (obj == null) ? 0 : obj.swigCPtr;
21  }
22 
23  protected void finalize() {
24  delete();
25  }
26 
27  public synchronized void delete() {
28  if (swigCPtr != 0) {
29  if (swigCMemOwn) {
30  swigCMemOwn = false;
31  mainJNI.delete_SequenceVar(swigCPtr);
32  }
33  swigCPtr = 0;
34  }
35  super.delete();
36  }
37 
38  public SequenceVar(Solver s, IntervalVar[] intervals, IntVar[] nexts, String name) {
39  this(mainJNI.new_SequenceVar(Solver.getCPtr(s), s, intervals, nexts, name), true);
40  }
41 
42  public String toString() {
43  return mainJNI.SequenceVar_toString(swigCPtr, this);
44  }
45 
46  public void rankFirst(int index) {
47  mainJNI.SequenceVar_rankFirst(swigCPtr, this, index);
48  }
49 
50  public void rankNotFirst(int index) {
51  mainJNI.SequenceVar_rankNotFirst(swigCPtr, this, index);
52  }
53 
54  public void rankLast(int index) {
55  mainJNI.SequenceVar_rankLast(swigCPtr, this, index);
56  }
57 
58  public void rankNotLast(int index) {
59  mainJNI.SequenceVar_rankNotLast(swigCPtr, this, index);
60  }
61 
62  public void rankSequence(int[] rank_first, int[] rank_last, int[] unperformed) {
63  mainJNI.SequenceVar_rankSequence(swigCPtr, this, rank_first, rank_last, unperformed);
64  }
65 
66  public IntervalVar interval(int index) {
67  long cPtr = mainJNI.SequenceVar_interval(swigCPtr, this, index);
68  return (cPtr == 0) ? null : new IntervalVar(cPtr, false);
69  }
70 
71  public IntVar next(int index) {
72  long cPtr = mainJNI.SequenceVar_next(swigCPtr, this, index);
73  return (cPtr == 0) ? null : new IntVar(cPtr, false);
74  }
75 
76  public long size() {
77  return mainJNI.SequenceVar_size(swigCPtr, this);
78  }
79 
80  public void accept(ModelVisitor visitor) {
81  mainJNI.SequenceVar_accept(swigCPtr, this, ModelVisitor.getCPtr(visitor), visitor);
82  }
83 
84 }
SequenceVar(long cPtr, boolean cMemoryOwn)
void rankSequence(int[] rank_first, int[] rank_last, int[] unperformed)
static long getCPtr(Solver obj)
Definition: Solver.java:63
SequenceVar(Solver s, IntervalVar[] intervals, IntVar[] nexts, String name)