org.callbackparams.combine
Class CombineAllPossible2Combinations

java.lang.Object
  extended by org.callbackparams.combine.AbstractCombineStrategy
      extended by org.callbackparams.combine.CombineAllPossible2Combinations
All Implemented Interfaces:
CombineStrategy

public class CombineAllPossible2Combinations
extends AbstractCombineStrategy

A strategy that creates a collection of callback-records in which all possible combinations of two individual callback-parameters will be represented. The strategy also tries to accomplish this task while keeping the number of callback-records as low as possible. This works alright but there is no guarantee that the lowest number of callback-records is always found but it seems to work flawlessly when the ValuesCollection contains three arrays and OK when there are four or more arrays.
If there is some combinatory expert available out there than feel free to provide some optimized algorithms for this. The current algorithms are pretty hard to understand and to some extent they also rely on chance.

Author:
Henrik Kaipe

Field Summary
 
Fields inherited from class org.callbackparams.combine.AbstractCombineStrategy
maxCount
 
Constructor Summary
CombineAllPossible2Combinations()
           
 
Method Summary
protected  Collection combineInternal(ValuesCollection vc)
          This is the method to implement when implementing CombineStrategy by subclassing AbstractCombineStrategy.
 
Methods inherited from class org.callbackparams.combine.AbstractCombineStrategy
combine, getRandomSeed, setMaxCount, setRandomSeed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CombineAllPossible2Combinations

public CombineAllPossible2Combinations()
Method Detail

combineInternal

protected Collection combineInternal(ValuesCollection vc)
Description copied from class: AbstractCombineStrategy
This is the method to implement when implementing CombineStrategy by subclassing AbstractCombineStrategy. The advantage compared to overriding AbstractCombineStrategy.combine(ValuesCollection) is that maxCount-check and validation of configuration for AbstractCombineStrategy.setMaxCount(int) and AbstractCombineStrategy.setRandomSeed(long) will be taken care of by the super-class - relieving this method to administer combining exclusivly.

Specified by:
combineInternal in class AbstractCombineStrategy


Copyright © 2010-2013 Henrik Kaipe. All Rights Reserved.