org.kuali.student.r2.common.permutation
Class PermutationUtils

java.lang.Object
  extended by org.kuali.student.r2.common.permutation.PermutationUtils

public final class PermutationUtils
extends Object

Author:
ocleirig

Method Summary
static void generatePermutations(List<String> keyList, List<String> prefix, Map<String,List<String>> dataMap, List<List<String>> generatedPermutations)
          Generates a list of permutations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

generatePermutations

public static void generatePermutations(List<String> keyList,
                                        List<String> prefix,
                                        Map<String,List<String>> dataMap,
                                        List<List<String>> generatedPermutations)
Generates a list of permutations. A permutation is a combination of one element from each data category. Each category corresponds to an index in the resultant permutation. e.g.

"LEC" -> "A", "B" "LAB" -> "Z" Permutations: "A", "Z" "B", "Z" The index 0 is for type "LEC" and index 1 for type "LAB" This method calls itself recursively to descend the list of available categories and build out each permutation.

Parameters:
keyList - The ordered list of categories available.
prefix - The built up prefix
dataMap - The category to list of elements for that category.
generatedPermutations - The list of generatedPermutations to this point.


Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.