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 
49  long cPtr = mainJNI.AssignmentSequenceContainer_fastAdd(swigCPtr, this, SequenceVar.getCPtr(var), var);
50  return (cPtr == 0) ? null : new SequenceVarElement(cPtr, false);
51  }
52 
53  public SequenceVarElement addAtPosition(SequenceVar var, int position) {
54  long cPtr = mainJNI.AssignmentSequenceContainer_addAtPosition(swigCPtr, this, SequenceVar.getCPtr(var), var, position);
55  return (cPtr == 0) ? null : new SequenceVarElement(cPtr, false);
56  }
57 
58  public void clear() {
59  mainJNI.AssignmentSequenceContainer_clear(swigCPtr, this);
60  }
61 
62  public void resize(long size) {
63  mainJNI.AssignmentSequenceContainer_resize(swigCPtr, this, size);
64  }
65 
66  public boolean empty() {
67  return mainJNI.AssignmentSequenceContainer_empty(swigCPtr, this);
68  }
69 
71  mainJNI.AssignmentSequenceContainer_copyIntersection(swigCPtr, this, AssignmentSequenceContainer.getCPtr(container), container);
72  }
73 
74  public void copy(AssignmentSequenceContainer container) {
75  mainJNI.AssignmentSequenceContainer_copy(swigCPtr, this, AssignmentSequenceContainer.getCPtr(container), container);
76  }
77 
78  public boolean contains(SequenceVar var) {
79  return mainJNI.AssignmentSequenceContainer_contains(swigCPtr, this, SequenceVar.getCPtr(var), var);
80  }
81 
83  long cPtr = mainJNI.AssignmentSequenceContainer_mutableElement__SWIG_0(swigCPtr, this, SequenceVar.getCPtr(var), var);
84  return (cPtr == 0) ? null : new SequenceVarElement(cPtr, false);
85  }
86 
88  return new SequenceVarElement(mainJNI.AssignmentSequenceContainer_element__SWIG_0(swigCPtr, this, SequenceVar.getCPtr(var), var), false);
89  }
90 
91  public SequenceVarElement mutableElement(int index) {
92  long cPtr = mainJNI.AssignmentSequenceContainer_mutableElement__SWIG_1(swigCPtr, this, index);
93  return (cPtr == 0) ? null : new SequenceVarElement(cPtr, false);
94  }
95 
96  public SequenceVarElement element(int index) {
97  return new SequenceVarElement(mainJNI.AssignmentSequenceContainer_element__SWIG_1(swigCPtr, this, index), false);
98  }
99 
100  public int size() {
101  return mainJNI.AssignmentSequenceContainer_size(swigCPtr, this);
102  }
103 
104  public void store() {
105  mainJNI.AssignmentSequenceContainer_store(swigCPtr, this);
106  }
107 
108  public void restore() {
109  mainJNI.AssignmentSequenceContainer_restore(swigCPtr, this);
110  }
111 
112  public boolean AreAllElementsBound() {
113  return mainJNI.AssignmentSequenceContainer_AreAllElementsBound(swigCPtr, this);
114  }
115 
116 }
SequenceVarElement addAtPosition(SequenceVar var, int position)