Package mondrian.util

Class CombiningGenerator<E>

  • All Implemented Interfaces:
    Iterable<List<E>>, Collection<List<E>>, List<List<E>>

    public class CombiningGenerator<E>
    extends AbstractList<List<E>>
    A list that, given a collection of elements, contains every possible combination of those objects (also known as the power set of those objects).
    Author:
    LBoudreau, jhyde
    • Constructor Detail

      • CombiningGenerator

        public CombiningGenerator​(Collection<E> elements)
        Creates a CombiningGenerator.
        Parameters:
        elements - Elements to iterate over
    • Method Detail

      • of

        public static <T> CombiningGenerator<T> of​(Collection<T> elements)
        Creates a CombiningGenerator, inferring the type from the argument.
        Type Parameters:
        T - Element type
        Parameters:
        elements - Elements to iterate over
        Returns:
        Combing generator containing the power set
      • main

        public static void main​(String[] args)
        Ad hoc test. See also UtilTest.testCombiningGenerator.
        Parameters:
        args - ignored