jopt.csp.spi.solver
Class ChoicePointMultiDoubleArray

java.lang.Object
  extended byjopt.csp.spi.solver.ChoicePointMultiDoubleArray
All Implemented Interfaces:
ChoicePointNumArraySet.StackList

public class ChoicePointMultiDoubleArray
extends java.lang.Object
implements ChoicePointNumArraySet.StackList

Contains multiple double arrays that store data for an object that needs to record changes in a ChoicePointStack so the changes can be pushed onto the stack and later rolled back when the stack is popped.

This class is not thread safe.

Version:
$Revision: 1.3 $
Author:
Nick Coleman

Constructor Summary
ChoicePointMultiDoubleArray(int listCnt)
          Creates a new ChoicePointMultiDoubleArray
 
Method Summary
 int add(int listIdx, double val)
          Adds a value to the end of the list
 double get(int listIdx, int offset)
          Retrieves a value in list
 void pop()
          Performs actions necessary to pop data
 java.lang.Object popDelta()
           
 void push()
          Performs actions necessary to push data
 void pushDelta(java.lang.Object delta)
           
 double remove(int listIdx, int offset)
          Retrieves a value from list
 void set(int listIdx, int offset, double val)
          Stores a value in list
 int size()
          Returns current size of list
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChoicePointMultiDoubleArray

public ChoicePointMultiDoubleArray(int listCnt)
Creates a new ChoicePointMultiDoubleArray

Parameters:
listCnt - Number of lists to maintain
Method Detail

push

public void push()
Performs actions necessary to push data

Specified by:
push in interface ChoicePointNumArraySet.StackList

pushDelta

public void pushDelta(java.lang.Object delta)
Specified by:
pushDelta in interface ChoicePointNumArraySet.StackList

pop

public void pop()
Performs actions necessary to pop data

Specified by:
pop in interface ChoicePointNumArraySet.StackList

popDelta

public java.lang.Object popDelta()
Specified by:
popDelta in interface ChoicePointNumArraySet.StackList

size

public int size()
Returns current size of list


add

public int add(int listIdx,
               double val)
Adds a value to the end of the list

Parameters:
listIdx - Index of list to add value
val - Value to add to list
Returns:
offset of new value in list

set

public void set(int listIdx,
                int offset,
                double val)
Stores a value in list

Parameters:
listIdx - Index of list to add value
offset - Offset of value in list
val - Value to append to the list

get

public double get(int listIdx,
                  int offset)
Retrieves a value in list

Parameters:
listIdx - Index of list to add value
offset - Offset of value in list

remove

public double remove(int listIdx,
                     int offset)
Retrieves a value from list

Parameters:
listIdx - Index of list to add value
offset - Offset of value in list