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.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 
27 public class IntVarIterator extends BaseObject {
28  private transient long swigCPtr;
29 
30  protected IntVarIterator(long cPtr, boolean cMemoryOwn) {
31  super(mainJNI.IntVarIterator_SWIGUpcast(cPtr), cMemoryOwn);
32  swigCPtr = cPtr;
33  }
34 
35  protected static long getCPtr(IntVarIterator obj) {
36  return (obj == null) ? 0 : obj.swigCPtr;
37  }
38 
39  @SuppressWarnings("deprecation")
40  protected void finalize() {
41  delete();
42  }
43 
44  public synchronized void delete() {
45  if (swigCPtr != 0) {
46  if (swigCMemOwn) {
47  swigCMemOwn = false;
48  mainJNI.delete_IntVarIterator(swigCPtr);
49  }
50  swigCPtr = 0;
51  }
52  super.delete();
53  }
54 
58  public void init() {
59  mainJNI.IntVarIterator_init(swigCPtr, this);
60  }
61 
65  public boolean ok() {
66  return mainJNI.IntVarIterator_ok(swigCPtr, this);
67  }
68 
72  public long value() {
73  return mainJNI.IntVarIterator_value(swigCPtr, this);
74  }
75 
79  public void next() {
80  mainJNI.IntVarIterator_next(swigCPtr, this);
81  }
82 
86  public String toString() {
87  return mainJNI.IntVarIterator_toString(swigCPtr, this);
88  }
89 
90 }
A BaseObject is the root of all reversibly allocated objects.
Definition: BaseObject.java:16
The class Iterator has two direct subclasses.
void init()
This method must be called before each loop.
void next()
This method moves the iterator to the next value.
boolean ok()
This method indicates if we can call Value() or not.
long value()
This method returns the current value of the iterator.