Java Reference

Java Reference

IntVarIterator

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 hole : InitAndGetValues(it)) { /// use the hole }

Definition at line 14 of file IntVarIterator.java.

Public Member Functions

synchronized void delete ()
 
void init ()
 This method must be called before each loop. More...
 
boolean ok ()
 This method indicates if we can call Value() or not. More...
 
long value ()
 This method returns the current value of the iterator. More...
 
void next ()
 This method moves the iterator to the next value. More...
 
String toString ()
 Pretty Print. More...
 

Protected Member Functions

 IntVarIterator (long cPtr, boolean cMemoryOwn)
 

Constructor & Destructor Documentation

◆ IntVarIterator()

IntVarIterator ( long  cPtr,
boolean  cMemoryOwn 
)
inlineprotected

Definition at line 17 of file IntVarIterator.java.

Member Function Documentation

◆ delete()

synchronized void delete ( )
inline

Reimplemented from BaseObject.

Definition at line 31 of file IntVarIterator.java.

◆ init()

void init ( )
inline

This method must be called before each loop.

Definition at line 45 of file IntVarIterator.java.

◆ next()

void next ( )
inline

This method moves the iterator to the next value.

Definition at line 66 of file IntVarIterator.java.

◆ ok()

boolean ok ( )
inline

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

Definition at line 52 of file IntVarIterator.java.

◆ toString()

String toString ( )
inline

Pretty Print.

Reimplemented from BaseObject.

Definition at line 73 of file IntVarIterator.java.

◆ value()

long value ( )
inline

This method returns the current value of the iterator.

Definition at line 59 of file IntVarIterator.java.


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