Package net.sf.tweety.commons.util
Class RandomSubsetIterator<T>
- java.lang.Object
-
- net.sf.tweety.commons.util.SubsetIterator<T>
-
- net.sf.tweety.commons.util.RandomSubsetIterator<T>
-
- Type Parameters:
T
- The element class which is iterated.
- All Implemented Interfaces:
java.util.Iterator<java.util.Set<T>>
public class RandomSubsetIterator<T> extends SubsetIterator<T>
Iterates over all subsets of a given sets in a random order.- Author:
- Matthias Thimm
-
-
Constructor Summary
Constructors Constructor Description RandomSubsetIterator(java.util.Set<T> set, boolean avoidDuplicates)
Creates a new subset iterator for the given set.
-
Method Summary
-
Methods inherited from class net.sf.tweety.commons.util.SubsetIterator
remove
-
-
-
-
Constructor Detail
-
RandomSubsetIterator
public RandomSubsetIterator(java.util.Set<T> set, boolean avoidDuplicates)
Creates a new subset iterator for the given set.- Parameters:
set
- some set.avoidDuplicates
- whether to avoid duplicates in the iteration. NOTE: setting this value to true might increase computation time and needed space drastically.
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfacejava.util.Iterator<T>
- Specified by:
hasNext
in classSubsetIterator<T>
-
next
public java.util.Set<T> next()
- Specified by:
next
in interfacejava.util.Iterator<T>
- Specified by:
next
in classSubsetIterator<T>
-
-