choco.integer.search
Class DecreasingDomain

java.lang.Object
  extended by choco.integer.search.DecreasingDomain
All Implemented Interfaces:
IValIterator

public final class DecreasingDomain
extends java.lang.Object
implements IValIterator


Constructor Summary
DecreasingDomain()
           
 
Method Summary
 int getFirstVal(Var x)
          Accessing the index of the first branch for variable x
 int getNextVal(Var x, int i)
          generates the index of the next branch after branch i, on the alternative associated to variable x
 boolean hasNextVal(Var x, int i)
          testing whether more branches can be considered after branch i, on the alternative associated to variable x
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DecreasingDomain

public DecreasingDomain()
Method Detail

hasNextVal

public boolean hasNextVal(Var x,
                          int i)
testing whether more branches can be considered after branch i, on the alternative associated to variable x

Specified by:
hasNextVal in interface IValIterator
Parameters:
x - the variable under scrutiny
i - the index of the last branch explored
Returns:
true if more branches can be expanded after branch i

getFirstVal

public int getFirstVal(Var x)
Accessing the index of the first branch for variable x

Specified by:
getFirstVal in interface IValIterator
Parameters:
x - the variable under scrutiny
Returns:
the index of the first branch (such as the first value to be assigned to the variable)

getNextVal

public int getNextVal(Var x,
                      int i)
generates the index of the next branch after branch i, on the alternative associated to variable x

Specified by:
getNextVal in interface IValIterator
Parameters:
x - the variable under scrutiny
i - the index of the last branch explored
Returns:
the index of the next branch to be expanded after branch i