Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
RevPartialSequence.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.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
9package com.google.ortools.constraintsolver;
10
14public class RevPartialSequence {
15 private transient long swigCPtr;
16 protected transient boolean swigCMemOwn;
17
18 protected RevPartialSequence(long cPtr, boolean cMemoryOwn) {
19 swigCMemOwn = cMemoryOwn;
20 swigCPtr = cPtr;
21 }
22
23 protected static long getCPtr(RevPartialSequence obj) {
24 return (obj == null) ? 0 : obj.swigCPtr;
25 }
26
27 protected static long swigRelease(RevPartialSequence obj) {
28 long ptr = 0;
29 if (obj != null) {
30 if (!obj.swigCMemOwn)
31 throw new RuntimeException("Cannot release ownership as memory is not owned");
32 ptr = obj.swigCPtr;
33 obj.swigCMemOwn = false;
34 obj.delete();
35 }
36 return ptr;
37 }
38
39 @SuppressWarnings({"deprecation", "removal"})
40 protected void finalize() {
41 delete();
42 }
43
44 public synchronized void delete() {
45 if (swigCPtr != 0) {
46 if (swigCMemOwn) {
47 swigCMemOwn = false;
48 mainJNI.delete_RevPartialSequence(swigCPtr);
49 }
50 swigCPtr = 0;
51 }
52 }
53
54 public RevPartialSequence(int[] items) {
55 this(mainJNI.new_RevPartialSequence__SWIG_0(items), true);
56 }
57
59 this(mainJNI.new_RevPartialSequence__SWIG_1(size), true);
60 }
61
62 public int numFirstRanked() {
63 return mainJNI.RevPartialSequence_numFirstRanked(swigCPtr, this);
64 }
65
66 public int numLastRanked() {
67 return mainJNI.RevPartialSequence_numLastRanked(swigCPtr, this);
68 }
69
70 public int size() {
71 return mainJNI.RevPartialSequence_size(swigCPtr, this);
72 }
73
74 public void rankFirst(Solver solver, int elt) {
75 mainJNI.RevPartialSequence_rankFirst(swigCPtr, this, Solver.getCPtr(solver), solver, elt);
76 }
77
78 public void rankLast(Solver solver, int elt) {
79 mainJNI.RevPartialSequence_rankLast(swigCPtr, this, Solver.getCPtr(solver), solver, elt);
80 }
81
82 public boolean isRanked(int elt) {
83 return mainJNI.RevPartialSequence_isRanked(swigCPtr, this, elt);
84 }
85
86 public String toString() {
87 return mainJNI.RevPartialSequence_toString(swigCPtr, this);
88 }
89
90}