Google OR-Tools v9.9
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
SortedDisjointIntervalList.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.util;
10
19 private transient long swigCPtr;
20 protected transient boolean swigCMemOwn;
21
22 public SortedDisjointIntervalList(long cPtr, boolean cMemoryOwn) {
23 swigCMemOwn = cMemoryOwn;
24 swigCPtr = cPtr;
25 }
26
27 public static long getCPtr(SortedDisjointIntervalList obj) {
28 return (obj == null) ? 0 : obj.swigCPtr;
29 }
30
31 public static long swigRelease(SortedDisjointIntervalList 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_SortedDisjointIntervalList(swigCPtr);
53 }
54 swigCPtr = 0;
55 }
56 }
57
59 this(mainJNI.new_SortedDisjointIntervalList__SWIG_0(), true);
60 }
61
67 public SortedDisjointIntervalList(long[] starts, long[] ends) {
68 this(mainJNI.new_SortedDisjointIntervalList__SWIG_1(starts, ends), true);
69 }
70
71 public SortedDisjointIntervalList(int[] starts, int[] ends) {
72 this(mainJNI.new_SortedDisjointIntervalList__SWIG_2(starts, ends), true);
73 }
74
79 return new SortedDisjointIntervalList(mainJNI.SortedDisjointIntervalList_buildComplementOnInterval(swigCPtr, this, start, end), true);
80 }
81
88 public void insertIntervals(long[] starts, long[] ends) {
89 mainJNI.SortedDisjointIntervalList_insertIntervals__SWIG_0(swigCPtr, this, starts, ends);
90 }
91
92 public void insertIntervals(int[] starts, int[] ends) {
93 mainJNI.SortedDisjointIntervalList_insertIntervals__SWIG_1(swigCPtr, this, starts, ends);
94 }
95
99 public int numIntervals() {
100 return mainJNI.SortedDisjointIntervalList_numIntervals(swigCPtr, this);
101 }
102
103 public String toString() {
104 return mainJNI.SortedDisjointIntervalList_toString(swigCPtr, this);
105 }
106
107 public void insertInterval(long start, long end) {
108 mainJNI.SortedDisjointIntervalList_insertInterval(swigCPtr, this, start, end);
109 }
110
111}
static long swigRelease(SortedDisjointIntervalList obj)
static long getCPtr(SortedDisjointIntervalList obj)
SortedDisjointIntervalList buildComplementOnInterval(long start, long end)