Java Reference

Java Reference

IntVarIterator.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.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 
9 package com.google.ortools.constraintsolver;
10 
14 public class IntVarIterator extends BaseObject {
15  private transient long swigCPtr;
16 
17  protected IntVarIterator(long cPtr, boolean cMemoryOwn) {
18  super(mainJNI.IntVarIterator_SWIGUpcast(cPtr), cMemoryOwn);
19  swigCPtr = cPtr;
20  }
21 
22  protected static long getCPtr(IntVarIterator obj) {
23  return (obj == null) ? 0 : obj.swigCPtr;
24  }
25 
26  @SuppressWarnings("deprecation")
27  protected void finalize() {
28  delete();
29  }
30 
31  public synchronized void delete() {
32  if (swigCPtr != 0) {
33  if (swigCMemOwn) {
34  swigCMemOwn = false;
35  mainJNI.delete_IntVarIterator(swigCPtr);
36  }
37  swigCPtr = 0;
38  }
39  super.delete();
40  }
41 
45  public void init() {
46  mainJNI.IntVarIterator_init(swigCPtr, this);
47  }
48 
52  public boolean ok() {
53  return mainJNI.IntVarIterator_ok(swigCPtr, this);
54  }
55 
59  public long value() {
60  return mainJNI.IntVarIterator_value(swigCPtr, this);
61  }
62 
66  public void next() {
67  mainJNI.IntVarIterator_next(swigCPtr, this);
68  }
69 
73  public String toString() {
74  return mainJNI.IntVarIterator_toString(swigCPtr, this);
75  }
76 
77 }
boolean ok()
This method indicates if we can call Value() or not.
String toString()
Pretty Print.
IntVarIterator(long cPtr, boolean cMemoryOwn)
long value()
This method returns the current value of the iterator.
The class Iterator has two direct subclasses.
void next()
This method moves the iterator to the next value.
void init()
This method must be called before each loop.
A BaseObject is the root of all reversibly allocated objects.
Definition: BaseObject.java:14