jopt.csp.spi.solver
Class ReversibleNumberArray

java.lang.Object
  extended byjopt.csp.spi.solver.ReversibleNumberArray
All Implemented Interfaces:
ChoicePointEntryListener
Direct Known Subclasses:
ReversibleDoubleArray, ReversibleFloatArray, ReversibleIntArray, ReversibleLongArray

public abstract class ReversibleNumberArray
extends java.lang.Object
implements ChoicePointEntryListener

An array of numbers that is reversible with the choicepoint stack. The stack must be set on the array for this functionality to work properly. Note that classes extending ReversibleNumberArray use primitive arrays to store the actual data (for efficiency purposes).

Author:
Chris Johnson

Constructor Summary
ReversibleNumberArray()
           
 
Method Summary
abstract  void adjValue(int idx, java.lang.Number val)
          Adds the specified val to the value of the reversible array at a particular index
 void afterChoicePointPopEvent()
          Indicates that the current choice point has been rolled back and domain data must be reset
 void afterChoicePointPushEvent()
          Indicates that current choice point has been updated and domain data must be restored
 void beforeChoicePointPopEvent()
          Indicates that the current choice point is about to be rolled back and domain data must be reset
 void beforeChoicePointPushEvent()
          Indicates that current choice point is about to be pushed to allow data to be recorded in stack
abstract  void clear()
           
abstract  java.lang.Number getValue(int idx)
          Returns the value of the reversible array at a particular index
 void setChoicePointStack(ChoicePointStack cps)
          Sets the choicepoint stack associated with this array.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReversibleNumberArray

public ReversibleNumberArray()
Method Detail

adjValue

public abstract void adjValue(int idx,
                              java.lang.Number val)
Adds the specified val to the value of the reversible array at a particular index


getValue

public abstract java.lang.Number getValue(int idx)
Returns the value of the reversible array at a particular index


beforeChoicePointPopEvent

public void beforeChoicePointPopEvent()
Description copied from interface: ChoicePointEntryListener
Indicates that the current choice point is about to be rolled back and domain data must be reset

Specified by:
beforeChoicePointPopEvent in interface ChoicePointEntryListener

afterChoicePointPopEvent

public void afterChoicePointPopEvent()
Description copied from interface: ChoicePointEntryListener
Indicates that the current choice point has been rolled back and domain data must be reset

Specified by:
afterChoicePointPopEvent in interface ChoicePointEntryListener

beforeChoicePointPushEvent

public void beforeChoicePointPushEvent()
Description copied from interface: ChoicePointEntryListener
Indicates that current choice point is about to be pushed to allow data to be recorded in stack

Specified by:
beforeChoicePointPushEvent in interface ChoicePointEntryListener

afterChoicePointPushEvent

public void afterChoicePointPushEvent()
Description copied from interface: ChoicePointEntryListener
Indicates that current choice point has been updated and domain data must be restored

Specified by:
afterChoicePointPushEvent in interface ChoicePointEntryListener

setChoicePointStack

public void setChoicePointStack(ChoicePointStack cps)
Sets the choicepoint stack associated with this array. Can only be set once


clear

public abstract void clear()