Google OR-Tools v9.9
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
SequenceVar.java
Go to the documentation of this file.
1/* ----------------------------------------------------------------------------
2 * This file was automatically generated by SWIG (https://www.swig.org).
3 * Version 4.2.0
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
19public 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 protected static long swigRelease(SequenceVar obj) {
32 long ptr = 0;
33 if (obj != null) {
34 if (!obj.swigCMemOwn)
35 throw new RuntimeException("Cannot release ownership as memory is not owned");
36 ptr = obj.swigCPtr;
37 obj.swigCMemOwn = false;
38 obj.delete();
39 }
40 return ptr;
41 }
42
43 @SuppressWarnings({"deprecation", "removal"})
44 protected void finalize() {
45 delete();
46 }
47
48 public synchronized void delete() {
49 if (swigCPtr != 0) {
50 if (swigCMemOwn) {
51 swigCMemOwn = false;
52 mainJNI.delete_SequenceVar(swigCPtr);
53 }
54 swigCPtr = 0;
55 }
56 super.delete();
57 }
58
59 public SequenceVar(Solver s, IntervalVar[] intervals, IntVar[] nexts, String name) {
60 this(mainJNI.new_SequenceVar(Solver.getCPtr(s), s, intervals, nexts, name), true);
61 }
62
63 public String toString() {
64 return mainJNI.SequenceVar_toString(swigCPtr, this);
65 }
66
71 public void rankFirst(int index) {
72 mainJNI.SequenceVar_rankFirst(swigCPtr, this, index);
73 }
74
79 public void rankNotFirst(int index) {
80 mainJNI.SequenceVar_rankNotFirst(swigCPtr, this, index);
81 }
82
87 public void rankLast(int index) {
88 mainJNI.SequenceVar_rankLast(swigCPtr, this, index);
89 }
90
95 public void rankNotLast(int index) {
96 mainJNI.SequenceVar_rankNotLast(swigCPtr, this, index);
97 }
98
106 public void rankSequence(int[] rank_first, int[] rank_last, int[] unperformed) {
107 mainJNI.SequenceVar_rankSequence(swigCPtr, this, rank_first, rank_last, unperformed);
108 }
109
113 public IntervalVar interval(int index) {
114 long cPtr = mainJNI.SequenceVar_interval(swigCPtr, this, index);
115 return (cPtr == 0) ? null : new IntervalVar(cPtr, false);
116 }
117
121 public IntVar next(int index) {
122 long cPtr = mainJNI.SequenceVar_next(swigCPtr, this, index);
123 return (cPtr == 0) ? null : new IntVar(cPtr, false);
124 }
125
129 public long size() {
130 return mainJNI.SequenceVar_size(swigCPtr, this);
131 }
132
136 public void accept(ModelVisitor visitor) {
137 mainJNI.SequenceVar_accept(swigCPtr, this, ModelVisitor.getCPtr(visitor), visitor);
138 }
139
140}
void rankSequence(int[] rank_first, int[] rank_last, int[] unperformed)
SequenceVar(long cPtr, boolean cMemoryOwn)
SequenceVar(Solver s, IntervalVar[] intervals, IntVar[] nexts, String name)