Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
com.google.ortools.constraintsolver.IntVarIterator Class Reference
Inheritance diagram for com.google.ortools.constraintsolver.IntVarIterator:
com.google.ortools.constraintsolver.BaseObject

Public Member Functions

synchronized void delete ()
 
void init ()
 
boolean ok ()
 
long value ()
 
void next ()
 
String toString ()
 
- Public Member Functions inherited from com.google.ortools.constraintsolver.BaseObject
 BaseObject ()
 

Protected Member Functions

 IntVarIterator (long cPtr, boolean cMemoryOwn)
 
void finalize ()
 
- Protected Member Functions inherited from com.google.ortools.constraintsolver.BaseObject
 BaseObject (long cPtr, boolean cMemoryOwn)
 

Static Protected Member Functions

static long getCPtr (IntVarIterator obj)
 
static long swigRelease (IntVarIterator obj)
 
- Static Protected Member Functions inherited from com.google.ortools.constraintsolver.BaseObject
static long getCPtr (BaseObject obj)
 
static long swigRelease (BaseObject obj)
 

Additional Inherited Members

- Protected Attributes inherited from com.google.ortools.constraintsolver.BaseObject
transient boolean swigCMemOwn
 

Detailed Description

The class Iterator has two direct subclasses. HoleIterators
iterates over all holes, that is value removed between the
current min and max of the variable since the last time the
variable was processed in the queue. DomainIterators iterates
over all elements of the variable domain. Both iterators are not
robust to domain changes. Hole iterators can also report values outside
the current min and max of the variable.
HoleIterators should only be called from a demon attached to the
variable that has created this iterator.
IntVar* current_var;
std::unique_ptr<IntVarIterator> it(current_var->MakeHoleIterator(false));
for (const int64_t hole : InitAndGetValues(it)) {
use the hole
}

Definition at line 27 of file IntVarIterator.java.

Constructor & Destructor Documentation

◆ IntVarIterator()

com.google.ortools.constraintsolver.IntVarIterator.IntVarIterator ( long cPtr,
boolean cMemoryOwn )
protected

Definition at line 30 of file IntVarIterator.java.

Member Function Documentation

◆ delete()

synchronized void com.google.ortools.constraintsolver.IntVarIterator.delete ( )

Reimplemented from com.google.ortools.constraintsolver.BaseObject.

Definition at line 56 of file IntVarIterator.java.

◆ finalize()

void com.google.ortools.constraintsolver.IntVarIterator.finalize ( )
protected

Reimplemented from com.google.ortools.constraintsolver.BaseObject.

Definition at line 52 of file IntVarIterator.java.

◆ getCPtr()

static long com.google.ortools.constraintsolver.IntVarIterator.getCPtr ( IntVarIterator obj)
staticprotected

Definition at line 35 of file IntVarIterator.java.

◆ init()

void com.google.ortools.constraintsolver.IntVarIterator.init ( )

This method must be called before each loop.

Definition at line 70 of file IntVarIterator.java.

◆ next()

void com.google.ortools.constraintsolver.IntVarIterator.next ( )

This method moves the iterator to the next value.

Definition at line 91 of file IntVarIterator.java.

◆ ok()

boolean com.google.ortools.constraintsolver.IntVarIterator.ok ( )

This method indicates if we can call Value() or not.

Definition at line 77 of file IntVarIterator.java.

◆ swigRelease()

static long com.google.ortools.constraintsolver.IntVarIterator.swigRelease ( IntVarIterator obj)
staticprotected

Definition at line 39 of file IntVarIterator.java.

◆ toString()

String com.google.ortools.constraintsolver.IntVarIterator.toString ( )

Pretty Print.

Reimplemented from com.google.ortools.constraintsolver.BaseObject.

Definition at line 98 of file IntVarIterator.java.

◆ value()

long com.google.ortools.constraintsolver.IntVarIterator.value ( )

This method returns the current value of the iterator.

Definition at line 84 of file IntVarIterator.java.


The documentation for this class was generated from the following file: