DATATYPE - Element type@Immutable public final class CombinationGeneratorFlexible<DATATYPE> extends Object
| Constructor and Description |
|---|
CombinationGeneratorFlexible(int nSlotCount,
boolean bAllowEmpty)
Ctor
|
| Modifier and Type | Method and Description |
|---|---|
Set<List<DATATYPE>> |
getCombinations(List<DATATYPE> aElements)
Generate all combinations without duplicates.
|
static <DATATYPE> Set<List<DATATYPE>> |
getCombinations(List<DATATYPE> aElements,
boolean bAllowEmpty) |
static <DATATYPE> void |
iterateAllCombinations(List<DATATYPE> aElements,
boolean bAllowEmpty,
INonThrowingRunnableWithParameter<List<DATATYPE>> aCallback) |
void |
iterateAllCombinations(List<DATATYPE> aElements,
INonThrowingRunnableWithParameter<List<DATATYPE>> aCallback)
Iterate all combination, no matter they are unique or not.
|
public CombinationGeneratorFlexible(@Nonnegative int nSlotCount, boolean bAllowEmpty)
nSlotCount - the number of slots to usebAllowEmpty - whether or not to include an empty result set (no slot filled)public void iterateAllCombinations(@Nonnull List<DATATYPE> aElements, @Nonnull INonThrowingRunnableWithParameter<List<DATATYPE>> aCallback)
aElements - List of elements.aCallback - Callback to invoke@Nonnull @ReturnsMutableCopy public Set<List<DATATYPE>> getCombinations(@Nonnull List<DATATYPE> aElements)
aElements - the elements to distribute to the specified slots (may be empty!)public static <DATATYPE> void iterateAllCombinations(@Nonnull List<DATATYPE> aElements, boolean bAllowEmpty, @Nonnull INonThrowingRunnableWithParameter<List<DATATYPE>> aCallback)
Copyright © 2006–2014 phloc systems. All rights reserved.