Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
Domain.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.util;
10
21public class Domain {
22 private transient long swigCPtr;
23 protected transient boolean swigCMemOwn;
24
25 public Domain(long cPtr, boolean cMemoryOwn) {
26 swigCMemOwn = cMemoryOwn;
27 swigCPtr = cPtr;
28 }
29
30 public static long getCPtr(Domain obj) {
31 return (obj == null) ? 0 : obj.swigCPtr;
32 }
33
34 public static long swigRelease(Domain obj) {
35 long ptr = 0;
36 if (obj != null) {
37 if (!obj.swigCMemOwn)
38 throw new RuntimeException("Cannot release ownership as memory is not owned");
39 ptr = obj.swigCPtr;
40 obj.swigCMemOwn = false;
41 obj.delete();
42 }
43 return ptr;
44 }
45
46 @SuppressWarnings({"deprecation", "removal"})
47 protected void finalize() {
48 delete();
49 }
50
51 public synchronized void delete() {
52 if (swigCPtr != 0) {
53 if (swigCMemOwn) {
54 swigCMemOwn = false;
55 mainJNI.delete_Domain(swigCPtr);
56 }
57 swigCPtr = 0;
58 }
59 }
60
64 public Domain() {
65 this(mainJNI.new_Domain__SWIG_0(), true);
66 }
67
71 public Domain(long value) {
72 this(mainJNI.new_Domain__SWIG_1(value), true);
73 }
74
79 public Domain(long left, long right) {
80 this(mainJNI.new_Domain__SWIG_2(left, right), true);
81 }
82
86 public static Domain allValues() {
87 return new Domain(mainJNI.Domain_allValues(), true);
88 }
89
94 public static Domain fromValues(long[] values) {
95 return new Domain(mainJNI.Domain_fromValues(values), true);
96 }
97
103 public static Domain fromIntervals(long[][] intervals) {
104 return new Domain(mainJNI.Domain_fromIntervals(intervals), true);
105 }
106
112 public static Domain fromFlatIntervals(long[] flat_intervals) {
113 return new Domain(mainJNI.Domain_fromFlatIntervals(flat_intervals), true);
114 }
115
123 public long[] flattenedIntervals() {
124 return mainJNI.Domain_flattenedIntervals(swigCPtr, this);
125}
126
130 public boolean isEmpty() {
131 return mainJNI.Domain_isEmpty(swigCPtr, this);
132 }
133
137 public long size() {
138 return mainJNI.Domain_size(swigCPtr, this);
139 }
140
145 public long min() {
146 return mainJNI.Domain_min(swigCPtr, this);
147 }
148
153 public long max() {
154 return mainJNI.Domain_max(swigCPtr, this);
155 }
156
160 public boolean contains(long value) {
161 return mainJNI.Domain_contains(swigCPtr, this, value);
162 }
163
168 return new Domain(mainJNI.Domain_complement(swigCPtr, this), true);
169 }
170
177 public Domain negation() {
178 return new Domain(mainJNI.Domain_negation(swigCPtr, this), true);
179 }
180
185 return new Domain(mainJNI.Domain_intersectionWith(swigCPtr, this, Domain.getCPtr(domain), domain), true);
186 }
187
191 public Domain unionWith(Domain domain) {
192 return new Domain(mainJNI.Domain_unionWith(swigCPtr, this, Domain.getCPtr(domain), domain), true);
193 }
194
198 public Domain additionWith(Domain domain) {
199 return new Domain(mainJNI.Domain_additionWith(swigCPtr, this, Domain.getCPtr(domain), domain), true);
200 }
201
205 public String toString() {
206 return mainJNI.Domain_toString(swigCPtr, this);
207 }
208
209}
static Domain fromFlatIntervals(long[] flat_intervals)
Definition Domain.java:112
Domain unionWith(Domain domain)
Definition Domain.java:191
static Domain fromIntervals(long[][] intervals)
Definition Domain.java:103
boolean contains(long value)
Definition Domain.java:160
static Domain fromValues(long[] values)
Definition Domain.java:94
transient boolean swigCMemOwn
Definition Domain.java:23
static long swigRelease(Domain obj)
Definition Domain.java:34
Domain intersectionWith(Domain domain)
Definition Domain.java:184
static long getCPtr(Domain obj)
Definition Domain.java:30
synchronized void delete()
Definition Domain.java:51
Domain(long cPtr, boolean cMemoryOwn)
Definition Domain.java:25
Domain(long left, long right)
Definition Domain.java:79
static Domain allValues()
Definition Domain.java:86
Domain additionWith(Domain domain)
Definition Domain.java:198