jopt.csp.spi.util
Class GenericIndexManager

java.lang.Object
  extended byjopt.csp.spi.util.GenericIndexManager
Direct Known Subclasses:
GenericNodeIndexManager

public class GenericIndexManager
extends java.lang.Object

Utility for creating iterators that can be used by arcs when processing generic nodes


Constructor Summary
GenericIndexManager(jopt.csp.variable.CspGenericIndex[] xIndices, jopt.csp.variable.CspGenericIndex[] yIndices, jopt.csp.variable.CspGenericIndex[] zIndices, jopt.csp.variable.CspGenericIndex[] restrictedIndices, boolean restrictZ)
          Creates a new index manager that manages indices for source and target nodes where X and Y are source nodes and Z is a target such as X + Y = Z and X and Y indices have restricted ranges.
 
Method Summary
 IndexIterator allIterator()
          Creates an iterator designed to loop over all indices in all nodes
 boolean getDisableCombinedIndices()
          Returns flag that indicating if useCombined methods are allowed to return true
 IndexIterator iterator()
          Creates an iterator designed to loop over all indices in the target and source nodes
 IndexIterator restrictedIterator()
          Creates an iterator designed to loop over indices that were restricted from normal control
 void setDisableCombinedIndices(boolean disable)
          Sets flag that that will cause all the useCombined methods to return false if set to true
 boolean useCombinedX()
          True if the entire generic X node should be used, False is specific node should be used for each index
 boolean useCombinedY()
          True if the entire generic Y node should be used, False is specific node should be used for each index
 boolean useCombinedZ()
          True if the entire generic Z node should be used, False is specific node should be used for each index
 IndexIterator xControlledIterator()
          Creates an iterator designed to loop over all indices not a part of the X node
 boolean xIndexIsRestricted()
          True if an X index is excluded from the common iterators
 IndexIterator yControlledIterator()
          Creates an iterator designed to loop over all indices not a part of the Y node
 boolean yIndexIsRestricted()
          True if an Y index is excluded from the common iterators
 boolean zIndexIsRestricted()
          True if an Z index is excluded from the common iterators
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericIndexManager

public GenericIndexManager(jopt.csp.variable.CspGenericIndex[] xIndices,
                           jopt.csp.variable.CspGenericIndex[] yIndices,
                           jopt.csp.variable.CspGenericIndex[] zIndices,
                           jopt.csp.variable.CspGenericIndex[] restrictedIndices,
                           boolean restrictZ)
Creates a new index manager that manages indices for source and target nodes where X and Y are source nodes and Z is a target such as X + Y = Z and X and Y indices have restricted ranges.

Parameters:
xIndices - X source indices for the equation
yIndices - Y source indices for the equation
zIndices - Z source indices for the equation
restrictedIndices - array if indices that have restricted ranges
restrictZ - True if Z node should be restricted
Method Detail

useCombinedX

public boolean useCombinedX()
True if the entire generic X node should be used, False is specific node should be used for each index


useCombinedY

public boolean useCombinedY()
True if the entire generic Y node should be used, False is specific node should be used for each index


useCombinedZ

public boolean useCombinedZ()
True if the entire generic Z node should be used, False is specific node should be used for each index


xIndexIsRestricted

public boolean xIndexIsRestricted()
True if an X index is excluded from the common iterators


yIndexIsRestricted

public boolean yIndexIsRestricted()
True if an Y index is excluded from the common iterators


zIndexIsRestricted

public boolean zIndexIsRestricted()
True if an Z index is excluded from the common iterators


iterator

public IndexIterator iterator()
Creates an iterator designed to loop over all indices in the target and source nodes


xControlledIterator

public IndexIterator xControlledIterator()
Creates an iterator designed to loop over all indices not a part of the X node


yControlledIterator

public IndexIterator yControlledIterator()
Creates an iterator designed to loop over all indices not a part of the Y node


allIterator

public IndexIterator allIterator()
Creates an iterator designed to loop over all indices in all nodes


restrictedIterator

public IndexIterator restrictedIterator()
Creates an iterator designed to loop over indices that were restricted from normal control


setDisableCombinedIndices

public void setDisableCombinedIndices(boolean disable)
Sets flag that that will cause all the useCombined methods to return false if set to true


getDisableCombinedIndices

public boolean getDisableCombinedIndices()
Returns flag that indicating if useCombined methods are allowed to return true