|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jgrapht.experimental.permutation.CollectionPermutationIter<E>
public class CollectionPermutationIter<E>
Given a container with elements (Collection,Enumeration,array) defines a permutation iterator which returns, on each iteration, a differnt permutation of the source container. You may choose a different container type(Collection/Array/etc) for each next call. It will continue as if they were the same iterator.
Constructor Summary | |
---|---|
CollectionPermutationIter(List<E> objectsArray)
Uses a permArray like [1,1,1,2] where some of the permutations are not relevant. |
|
CollectionPermutationIter(List<E> objectsArray,
ArrayPermutationsIter permuter)
|
|
CollectionPermutationIter(Set<E> objectsSet)
Note: the Set interface does not guarantee iteration order. |
Method Summary | |
---|---|
int[] |
getCurrentPermutationArray()
|
List<E> |
getNextArray()
On first call, returns the source as an array; on any other call thereafter, a new permutation |
Set<E> |
getNextSet()
Wrap result to a Set. |
boolean |
hasNext()
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CollectionPermutationIter(Set<E> objectsSet)
objectsSet
- public CollectionPermutationIter(List<E> objectsArray)
objectsArray
- public CollectionPermutationIter(List<E> objectsArray, ArrayPermutationsIter permuter)
Method Detail |
---|
public boolean hasNext()
public List<E> getNextArray()
public Set<E> getNextSet()
public int[] getCurrentPermutationArray()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |