AssignmentSequenceContainer.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 
12  private transient long swigCPtr;
13  protected transient boolean swigCMemOwn;
14 
15  protected AssignmentSequenceContainer(long cPtr, boolean cMemoryOwn) {
16  swigCMemOwn = cMemoryOwn;
17  swigCPtr = cPtr;
18  }
19 
20  protected static long getCPtr(AssignmentSequenceContainer 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_AssignmentSequenceContainer(swigCPtr);
34  }
35  swigCPtr = 0;
36  }
37  }
38 
40  this(mainJNI.new_AssignmentSequenceContainer(), true);
41  }
42 
44  long cPtr = mainJNI.AssignmentSequenceContainer_add(swigCPtr, this, SequenceVar.getCPtr(var), var);
45  return (cPtr == 0) ? null : new SequenceVarElement(cPtr, false);
46  }
47 
52  long cPtr = mainJNI.AssignmentSequenceContainer_fastAdd(swigCPtr, this, SequenceVar.getCPtr(var), var);
53  return (cPtr == 0) ? null : new SequenceVarElement(cPtr, false);
54  }
55 
59  public SequenceVarElement addAtPosition(SequenceVar var, int position) {
60  long cPtr = mainJNI.AssignmentSequenceContainer_addAtPosition(swigCPtr, this, SequenceVar.getCPtr(var), var, position);
61  return (cPtr == 0) ? null : new SequenceVarElement(cPtr, false);
62  }
63 
64  public void clear() {
65  mainJNI.AssignmentSequenceContainer_clear(swigCPtr, this);
66  }
67 
71  public void resize(long size) {
72  mainJNI.AssignmentSequenceContainer_resize(swigCPtr, this, size);
73  }
74 
75  public boolean empty() {
76  return mainJNI.AssignmentSequenceContainer_empty(swigCPtr, this);
77  }
78 
83  mainJNI.AssignmentSequenceContainer_copyIntersection(swigCPtr, this, AssignmentSequenceContainer.getCPtr(container), container);
84  }
85 
89  public void copy(AssignmentSequenceContainer container) {
90  mainJNI.AssignmentSequenceContainer_copy(swigCPtr, this, AssignmentSequenceContainer.getCPtr(container), container);
91  }
92 
93  public boolean contains(SequenceVar var) {
94  return mainJNI.AssignmentSequenceContainer_contains(swigCPtr, this, SequenceVar.getCPtr(var), var);
95  }
96 
98  long cPtr = mainJNI.AssignmentSequenceContainer_mutableElement__SWIG_0(swigCPtr, this, SequenceVar.getCPtr(var), var);
99  return (cPtr == 0) ? null : new SequenceVarElement(cPtr, false);
100  }
101 
103  return new SequenceVarElement(mainJNI.AssignmentSequenceContainer_element__SWIG_0(swigCPtr, this, SequenceVar.getCPtr(var), var), false);
104  }
105 
106  public SequenceVarElement mutableElement(int index) {
107  long cPtr = mainJNI.AssignmentSequenceContainer_mutableElement__SWIG_1(swigCPtr, this, index);
108  return (cPtr == 0) ? null : new SequenceVarElement(cPtr, false);
109  }
110 
111  public SequenceVarElement element(int index) {
112  return new SequenceVarElement(mainJNI.AssignmentSequenceContainer_element__SWIG_1(swigCPtr, this, index), false);
113  }
114 
115  public int size() {
116  return mainJNI.AssignmentSequenceContainer_size(swigCPtr, this);
117  }
118 
119  public void store() {
120  mainJNI.AssignmentSequenceContainer_store(swigCPtr, this);
121  }
122 
123  public void restore() {
124  mainJNI.AssignmentSequenceContainer_restore(swigCPtr, this);
125  }
126 
127  public boolean AreAllElementsBound() {
128  return mainJNI.AssignmentSequenceContainer_AreAllElementsBound(swigCPtr, this);
129  }
130 
131 }
The SequenceVarElement stores a partial representation of ranked interval variables in the underlying...
void resize(long size)
Advanced usage: Resizes the container, potentially adding elements with null variables.
SequenceVarElement fastAdd(SequenceVar var)
Adds element without checking its presence in the container.
A sequence variable is a variable whose domain is a set of possible orderings of the interval variabl...
void copyIntersection(AssignmentSequenceContainer container)
Copies the elements of 'container' which are already in the calling container.
SequenceVarElement addAtPosition(SequenceVar var, int position)
Advanced usage: Adds element at a given position; position has to have been allocated with Assignment...
void copy(AssignmentSequenceContainer container)
Copies all the elements of 'container' to this container, clearing its previous content.