jopt.js.spi.util
Class CPSIntIntervalSet

java.lang.Object
  extended byjopt.csp.util.IntSet
      extended byjopt.csp.util.IntIntervalSet
          extended byjopt.js.spi.util.CPSIntIntervalSet
All Implemented Interfaces:
jopt.csp.spi.solver.ChoicePointDataSource, jopt.csp.spi.solver.ChoicePointEntryListener, jopt.csp.util.IntervalSet, jopt.csp.util.NumSet

public class CPSIntIntervalSet
extends jopt.csp.util.IntIntervalSet
implements jopt.csp.spi.solver.ChoicePointDataSource, jopt.csp.spi.solver.ChoicePointEntryListener

A "choice point-aware" extension of IntIntervalSet allowing "automatic" back-tracking


Constructor Summary
CPSIntIntervalSet()
           
 
Method Summary
 jopt.csp.util.IntIntervalSet addGetDelta(int start, int end)
          Adds specified interval and records all changes that actually occur
 void afterChoicePointPopEvent()
           
 void afterChoicePointPushEvent()
           
 void beforeChoicePointPopEvent()
           
 void beforeChoicePointPushEvent()
           
 boolean choicePointStackSet()
           
 void notifyIntervalAddition(int start, int end)
           
 void notifyIntervalRemoval(int start, int end)
           
 jopt.csp.util.IntIntervalSet removeAllGetDelta(jopt.csp.util.NumSet set)
          Removes the specified set of values and records all changes that actually occur
 jopt.csp.util.IntIntervalSet removeEndingBeforeGetDelta(int val)
          Removes anything ending before the specified val and records all changes that actually occur
 jopt.csp.util.IntIntervalSet removeGetDelta(int start, int end)
          Removes the specified interval and records all changes that actually occur
 jopt.csp.util.IntIntervalSet removeStartingAfterGetDelta(int val)
          Removes anything starting after the specified val and records all changes that actually occur
 void setChoicePointStack(jopt.csp.spi.solver.ChoicePointStack cps)
           
 void setMax(int max)
           
 void setMin(int min)
           
 
Methods inherited from class jopt.csp.util.IntIntervalSet
add, add, add, add, clear, clone, contains, equals, equals, getFirstIntervalIndex, getFreeIntervalsBetween, getIntervalEnd, getIntervalStart, getLastIntervalIndex, getListener, getMax, getMax, getMin, getMin, getNextHigher, getNextIntervalIndex, getNextLower, getPreviousIntervalIndex, indexOfValue, intersect, intervals, isEmpty, isIntervalContained, isIntervalEmpty, remove, remove, remove, removeEndingAt, removeStartingFrom, setListener, size, toString, values
 
Methods inherited from class jopt.csp.util.IntSet
addAll, removeAll, removeEndingBefore, removeStartingAfter, retainAll
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CPSIntIntervalSet

public CPSIntIntervalSet()
Method Detail

notifyIntervalAddition

public void notifyIntervalAddition(int start,
                                   int end)

notifyIntervalRemoval

public void notifyIntervalRemoval(int start,
                                  int end)

choicePointStackSet

public boolean choicePointStackSet()
Specified by:
choicePointStackSet in interface jopt.csp.spi.solver.ChoicePointDataSource

setChoicePointStack

public void setChoicePointStack(jopt.csp.spi.solver.ChoicePointStack cps)
Specified by:
setChoicePointStack in interface jopt.csp.spi.solver.ChoicePointDataSource

beforeChoicePointPopEvent

public void beforeChoicePointPopEvent()
Specified by:
beforeChoicePointPopEvent in interface jopt.csp.spi.solver.ChoicePointEntryListener

afterChoicePointPopEvent

public void afterChoicePointPopEvent()
Specified by:
afterChoicePointPopEvent in interface jopt.csp.spi.solver.ChoicePointEntryListener

beforeChoicePointPushEvent

public void beforeChoicePointPushEvent()
Specified by:
beforeChoicePointPushEvent in interface jopt.csp.spi.solver.ChoicePointEntryListener

afterChoicePointPushEvent

public void afterChoicePointPushEvent()
Specified by:
afterChoicePointPushEvent in interface jopt.csp.spi.solver.ChoicePointEntryListener

setMin

public void setMin(int min)

setMax

public void setMax(int max)

removeGetDelta

public jopt.csp.util.IntIntervalSet removeGetDelta(int start,
                                                   int end)
Removes the specified interval and records all changes that actually occur

Parameters:
start - start of interval
end - end of interval
Returns:
the intervals that have actually been removed

removeAllGetDelta

public jopt.csp.util.IntIntervalSet removeAllGetDelta(jopt.csp.util.NumSet set)
Removes the specified set of values and records all changes that actually occur

Parameters:
set - set to be removed
Returns:
the intervals that have actually been removed

removeEndingBeforeGetDelta

public jopt.csp.util.IntIntervalSet removeEndingBeforeGetDelta(int val)
Removes anything ending before the specified val and records all changes that actually occur

Parameters:
val - new minimum value
Returns:
the intervals that have actually been removed

removeStartingAfterGetDelta

public jopt.csp.util.IntIntervalSet removeStartingAfterGetDelta(int val)
Removes anything starting after the specified val and records all changes that actually occur

Parameters:
val - new maximum value
Returns:
the intervals that have actually been removed

addGetDelta

public jopt.csp.util.IntIntervalSet addGetDelta(int start,
                                                int end)
Adds specified interval and records all changes that actually occur

Parameters:
start - start of interval to be added
end - end of interval to be added
Returns:
a set of values that were actually added