Java Reference

Java Reference

SortedDisjointIntervalList.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.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 
9 package 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  protected static long getCPtr(SortedDisjointIntervalList 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_SortedDisjointIntervalList(swigCPtr);
41  }
42  swigCPtr = 0;
43  }
44  }
45 
47  this(mainJNI.new_SortedDisjointIntervalList__SWIG_0(), true);
48  }
49 
55  public SortedDisjointIntervalList(long[] starts, long[] ends) {
56  this(mainJNI.new_SortedDisjointIntervalList__SWIG_1(starts, ends), true);
57  }
58 
59  public SortedDisjointIntervalList(int[] starts, int[] ends) {
60  this(mainJNI.new_SortedDisjointIntervalList__SWIG_2(starts, ends), true);
61  }
62 
67  return new SortedDisjointIntervalList(mainJNI.SortedDisjointIntervalList_buildComplementOnInterval(swigCPtr, this, start, end), true);
68  }
69 
79  public SWIGTYPE_p_std__setT_operations_research__ClosedInterval_operations_research__SortedDisjointIntervalList__IntervalComparator_t__iterator insertInterval(long start, long end) {
80  return new SWIGTYPE_p_std__setT_operations_research__ClosedInterval_operations_research__SortedDisjointIntervalList__IntervalComparator_t__iterator(mainJNI.SortedDisjointIntervalList_insertInterval(swigCPtr, this, start, end), true);
81  }
82 
89  public void insertIntervals(long[] starts, long[] ends) {
90  mainJNI.SortedDisjointIntervalList_insertIntervals__SWIG_0(swigCPtr, this, starts, ends);
91  }
92 
93  public void insertIntervals(int[] starts, int[] ends) {
94  mainJNI.SortedDisjointIntervalList_insertIntervals__SWIG_1(swigCPtr, this, starts, ends);
95  }
96 
100  public int numIntervals() {
101  return mainJNI.SortedDisjointIntervalList_numIntervals(swigCPtr, this);
102  }
103 
104  public String toString() {
105  return mainJNI.SortedDisjointIntervalList_toString(swigCPtr, this);
106  }
107 
108 }
void insertIntervals(int[] starts, int[] ends)
SortedDisjointIntervalList(long cPtr, boolean cMemoryOwn)
void insertIntervals(long[] starts, long[] ends)
Adds all intervals [starts[i]..ends[i]].
SortedDisjointIntervalList()
SWIGTYPE_p_std__setT_operations_research__ClosedInterval_operations_research__SortedDisjointIntervalList__IntervalComparator_t__iterator insertInterval(long start, long end)
Adds the interval [start..end] to the list, and merges overlapping or immediately adjacent intervals...
String toString()
SortedDisjointIntervalList(int[] starts, int[] ends)
SortedDisjointIntervalList(long[] starts, long[] ends)
Creates a SortedDisjointIntervalList and fills it with intervals [starts[i]..ends[i]].
SortedDisjointIntervalList buildComplementOnInterval(long start, long end)
Builds the complement of the interval list on the interval [start, end].
int numIntervals()
Returns the number of disjoint intervals in the list.
This class represents a sorted list of disjoint, closed intervals.