com.sri.common.util
Class ObjectCombinator

java.lang.Object
  extended by com.sri.common.util.ObjectCombinator

public class ObjectCombinator
extends Object

This class allows the generation of all combinations of Object items available throughout the wizard steps. It is used to generate the decision matrix in the Wizard controller. It works by keeping an array of counters

Author:
Michael Rimov

Constructor Summary
ObjectCombinator(Object[][] allObjectValues, Class arrayClass)
          Constructs a PicklistCombinator object given a two dimensional array representing all choices available during the execution of a wizard.
 
Method Summary
protected  Object[][] getAllValues()
          Protected getter.
 int getRowIndex(Iterator i, int column)
          Retrieves where we are in the current iteration for a particular column.
 Iterator iterator()
          Iterate over the picklists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectCombinator

public ObjectCombinator(Object[][] allObjectValues,
                        Class arrayClass)
Constructs a PicklistCombinator object given a two dimensional array representing all choices available during the execution of a wizard.

Parameters:
allObjectValues - an array of valid value items. The first dimension represents each page. The second dimension represents all the choices present in each page.
arrayClass - the class of the object that is in the array.
Method Detail

iterator

public Iterator iterator()
Iterate over the picklists.

Returns:
Iterator

getRowIndex

public int getRowIndex(Iterator i,
                       int column)
Retrieves where we are in the current iteration for a particular column. For example, when we start, column 0 is at 0, column 1 is at zero, etc. Then if we have a 2x2 grid, after iterator it.next() we have colum 0 at 0, column 1 at 1.

Parameters:
i - Iterator The current PicklistIterator.
column - int the column to query.
Returns:
int the current location in the column index. (zero based)
Throws:
ArrayIndexOutOfBoundsException - if column number is too high for the combination matrix.

getAllValues

protected Object[][] getAllValues()
Protected getter.

Returns:
Object[][]


Copyright © 2004-2006 Codeguild, Inc.. All Rights Reserved.