Class ChooseK


  • @API(EXPERIMENTAL)
    public class ChooseK
    extends Object
    Utility class to provide helpers related to enumeration of cross products.
    • Method Detail

      • chooseK

        public static <T> EnumeratingIterable<T> chooseK​(@Nonnull
                                                         Collection<T> elements,
                                                         int numberOfElementsToChoose)
        Create a EnumeratingIterable based on a set and a function describing the depends-on relationships between items in the given set.
        Type Parameters:
        T - type
        Parameters:
        elements - the list of collections to create the iterable over
        numberOfElementsToChoose - number k of elements to choose
        Returns:
        a new EnumeratingIterable that obeys the constraints as expressed in dependsOnFn in a sense that the iterators created by this iterator will not return orderings that violate the given depends-on constraints