Package mondrian.util
Class CombiningGenerator<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<java.util.List<E>>
-
- mondrian.util.CombiningGenerator<E>
-
- All Implemented Interfaces:
java.lang.Iterable<java.util.List<E>>
,java.util.Collection<java.util.List<E>>
,java.util.List<java.util.List<E>>
public class CombiningGenerator<E> extends java.util.AbstractList<java.util.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 Summary
Constructors Constructor Description CombiningGenerator(java.util.Collection<E> elements)
Creates a CombiningGenerator.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<E>
get(int index)
static void
main(java.lang.String[] args)
Ad hoc test.static <T> CombiningGenerator<T>
of(java.util.Collection<T> elements)
Creates a CombiningGenerator, inferring the type from the argument.int
size()
-
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
-
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
-
-
-
-
Constructor Detail
-
CombiningGenerator
public CombiningGenerator(java.util.Collection<E> elements)
Creates a CombiningGenerator.- Parameters:
elements
- Elements to iterate over
-
-
Method Detail
-
of
public static <T> CombiningGenerator<T> of(java.util.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
-
get
public java.util.List<E> get(int index)
-
size
public int size()
-
main
public static void main(java.lang.String[] args)
Ad hoc test. See also UtilTest.testCombiningGenerator.- Parameters:
args
- ignored
-
-