Java Reference

Java Reference

BaseLns.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.2
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 
40 public class BaseLns extends IntVarLocalSearchOperator {
41  private transient long swigCPtr;
42 
43  protected BaseLns(long cPtr, boolean cMemoryOwn) {
44  super(mainJNI.BaseLns_SWIGUpcast(cPtr), cMemoryOwn);
45  swigCPtr = cPtr;
46  }
47 
48  protected static long getCPtr(BaseLns obj) {
49  return (obj == null) ? 0 : obj.swigCPtr;
50  }
51 
52  @SuppressWarnings("deprecation")
53  protected void finalize() {
54  delete();
55  }
56 
57  public synchronized void delete() {
58  if (swigCPtr != 0) {
59  if (swigCMemOwn) {
60  swigCMemOwn = false;
61  mainJNI.delete_BaseLns(swigCPtr);
62  }
63  swigCPtr = 0;
64  }
65  super.delete();
66  }
67 
68  protected void swigDirectorDisconnect() {
69  swigCMemOwn = false;
70  delete();
71  }
72 
73  public void swigReleaseOwnership() {
74  swigCMemOwn = false;
75  mainJNI.BaseLns_change_ownership(this, swigCPtr, false);
76  }
77 
78  public void swigTakeOwnership() {
79  swigCMemOwn = true;
80  mainJNI.BaseLns_change_ownership(this, swigCPtr, true);
81  }
82 
83  public BaseLns(IntVar[] vars) {
84  this(mainJNI.new_BaseLns(vars), true);
85  mainJNI.BaseLns_director_connect(this, swigCPtr, true, true);
86  }
87 
88  public void initFragments() {
89  if (getClass() == BaseLns.class) mainJNI.BaseLns_initFragments(swigCPtr, this); else mainJNI.BaseLns_initFragmentsSwigExplicitBaseLns(swigCPtr, this);
90  }
91 
92  public boolean nextFragment() {
93  return mainJNI.BaseLns_nextFragment(swigCPtr, this);
94  }
95 
96  public void appendToFragment(int index) {
97  mainJNI.BaseLns_appendToFragment(swigCPtr, this, index);
98  }
99 
100  public int fragmentSize() {
101  return mainJNI.BaseLns_fragmentSize(swigCPtr, this);
102  }
103 
104  public boolean HasFragments() {
105  return (getClass() == BaseLns.class) ? mainJNI.BaseLns_HasFragments(swigCPtr, this) : mainJNI.BaseLns_HasFragmentsSwigExplicitBaseLns(swigCPtr, this);
106  }
107 
108 }
This is the base class for building an Lns operator.
Definition: BaseLns.java:40
void swigTakeOwnership()
Definition: BaseLns.java:78
void initFragments()
Definition: BaseLns.java:88
BaseLns(long cPtr, boolean cMemoryOwn)
Definition: BaseLns.java:43
BaseLns(IntVar[] vars)
Definition: BaseLns.java:83
The class IntVar is a subset of IntExpr.
boolean nextFragment()
Definition: BaseLns.java:92
int fragmentSize()
Definition: BaseLns.java:100
void swigDirectorDisconnect()
Definition: BaseLns.java:68
void swigReleaseOwnership()
Definition: BaseLns.java:73
boolean HasFragments()
Definition: BaseLns.java:104
void appendToFragment(int index)
Definition: BaseLns.java:96