AssignmentIntContainer.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.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 
9 package com.google.ortools.constraintsolver;
10 
11 public class AssignmentIntContainer {
12  private transient long swigCPtr;
13  protected transient boolean swigCMemOwn;
14 
15  protected AssignmentIntContainer(long cPtr, boolean cMemoryOwn) {
16  swigCMemOwn = cMemoryOwn;
17  swigCPtr = cPtr;
18  }
19 
20  protected static long getCPtr(AssignmentIntContainer obj) {
21  return (obj == null) ? 0 : obj.swigCPtr;
22  }
23 
24  @SuppressWarnings("deprecation")
25  protected void finalize() {
26  delete();
27  }
28 
29  public synchronized void delete() {
30  if (swigCPtr != 0) {
31  if (swigCMemOwn) {
32  swigCMemOwn = false;
33  mainJNI.delete_AssignmentIntContainer(swigCPtr);
34  }
35  swigCPtr = 0;
36  }
37  }
38 
40  this(mainJNI.new_AssignmentIntContainer(), true);
41  }
42 
43  public IntVarElement add(IntVar var) {
44  long cPtr = mainJNI.AssignmentIntContainer_add(swigCPtr, this, IntVar.getCPtr(var), var);
45  return (cPtr == 0) ? null : new IntVarElement(cPtr, false);
46  }
47 
52  long cPtr = mainJNI.AssignmentIntContainer_fastAdd(swigCPtr, this, IntVar.getCPtr(var), var);
53  return (cPtr == 0) ? null : new IntVarElement(cPtr, false);
54  }
55 
59  public IntVarElement addAtPosition(IntVar var, int position) {
60  long cPtr = mainJNI.AssignmentIntContainer_addAtPosition(swigCPtr, this, IntVar.getCPtr(var), var, position);
61  return (cPtr == 0) ? null : new IntVarElement(cPtr, false);
62  }
63 
64  public void clear() {
65  mainJNI.AssignmentIntContainer_clear(swigCPtr, this);
66  }
67 
71  public void resize(long size) {
72  mainJNI.AssignmentIntContainer_resize(swigCPtr, this, size);
73  }
74 
75  public boolean empty() {
76  return mainJNI.AssignmentIntContainer_empty(swigCPtr, this);
77  }
78 
82  public void copyIntersection(AssignmentIntContainer container) {
83  mainJNI.AssignmentIntContainer_copyIntersection(swigCPtr, this, AssignmentIntContainer.getCPtr(container), container);
84  }
85 
89  public void copy(AssignmentIntContainer container) {
90  mainJNI.AssignmentIntContainer_copy(swigCPtr, this, AssignmentIntContainer.getCPtr(container), container);
91  }
92 
93  public boolean contains(IntVar var) {
94  return mainJNI.AssignmentIntContainer_contains(swigCPtr, this, IntVar.getCPtr(var), var);
95  }
96 
98  long cPtr = mainJNI.AssignmentIntContainer_mutableElement__SWIG_0(swigCPtr, this, IntVar.getCPtr(var), var);
99  return (cPtr == 0) ? null : new IntVarElement(cPtr, false);
100  }
101 
103  return new IntVarElement(mainJNI.AssignmentIntContainer_element__SWIG_0(swigCPtr, this, IntVar.getCPtr(var), var), false);
104  }
105 
106  public IntVarElement mutableElement(int index) {
107  long cPtr = mainJNI.AssignmentIntContainer_mutableElement__SWIG_1(swigCPtr, this, index);
108  return (cPtr == 0) ? null : new IntVarElement(cPtr, false);
109  }
110 
111  public IntVarElement element(int index) {
112  return new IntVarElement(mainJNI.AssignmentIntContainer_element__SWIG_1(swigCPtr, this, index), false);
113  }
114 
115  public int size() {
116  return mainJNI.AssignmentIntContainer_size(swigCPtr, this);
117  }
118 
119  public void store() {
120  mainJNI.AssignmentIntContainer_store(swigCPtr, this);
121  }
122 
123  public void restore() {
124  mainJNI.AssignmentIntContainer_restore(swigCPtr, this);
125  }
126 
127  public boolean AreAllElementsBound() {
128  return mainJNI.AssignmentIntContainer_AreAllElementsBound(swigCPtr, this);
129  }
130 
131 }
IntVarElement fastAdd(IntVar var)
Adds element without checking its presence in the container.
void resize(long size)
Advanced usage: Resizes the container, potentially adding elements with null variables.
void copyIntersection(AssignmentIntContainer container)
Copies the elements of 'container' which are already in the calling container.
IntVarElement addAtPosition(IntVar var, int position)
Advanced usage: Adds element at a given position; position has to have been allocated with Assignment...
void copy(AssignmentIntContainer container)
Copies all the elements of 'container' to this container, clearing its previous content.