Class GCombinations<TItem>

java.lang.Object
com.glitchybyte.glib.combinatorics.GSequencesGenerator<GCodedCombinations,TItem>
com.glitchybyte.glib.combinatorics.GCombinations<TItem>
Type Parameters:
TItem - Type of item.
All Implemented Interfaces:
Iterable<List<TItem>>

public class GCombinations<TItem> extends GSequencesGenerator<GCodedCombinations,TItem>
Generates combinations of the given items. (Order of items do not matter.)
  • Constructor Details

    • GCombinations

      public GCombinations(TItem[] items, boolean allowDuplicateItems, int minSize, int maxSize)
      Creates a sequences generator with the given characteristics.
      Parameters:
      items - Items for the generator.
      allowDuplicateItems - true if a sequence can use the same item more than once.
      minSize - Minimum size of a sequence.
      maxSize - Maximum size of a sequence.
    • GCombinations

      public GCombinations(TItem[] items, boolean allowDuplicateItems)
      Creates a sequences generator with the given characteristics.
      Parameters:
      items - Items for the generator.
      allowDuplicateItems - true if a sequence can use the same item more than once.