org.jboss.dtf.testframework.utils
Class Permutator

java.lang.Object
  extended by org.jboss.dtf.testframework.utils.Permutator

public class Permutator
extends java.lang.Object

Generates all possible permutations of an array of objects.


Field Summary
protected  java.lang.Object[] data
           
protected  int size
           
protected  int[] value
           
 
Constructor Summary
Permutator(java.lang.Object[] objectList)
          Constructs a permutator.
 
Method Summary
 java.lang.Object[] get()
          Retrieves the current permutation.
 boolean getNext()
          Generates the next permutation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

size

protected int size

data

protected java.lang.Object[] data

value

protected int[] value
Constructor Detail

Permutator

public Permutator(java.lang.Object[] objectList)
Constructs a permutator. Generates the first permutation which can be retrieved using get().

Parameters:
objectList - The array of objects to create the permutations of
Method Detail

getNext

public boolean getNext()
Generates the next permutation. If there are no more permutations this method returns false.


get

public java.lang.Object[] get()
Retrieves the current permutation.