ariba.util.core
Class PermutationIterator

java.lang.Object
  extended by ariba.util.core.PermutationIterator
All Implemented Interfaces:
java.util.Iterator

public class PermutationIterator
extends java.lang.Object
implements java.util.Iterator

A PermutationIterator produces a series of permutations of the requested size from a source array of objects.


Constructor Summary
PermutationIterator(java.lang.Object[] source)
          Creates a new PermutationIterator for the given source array using all elements of the array.
PermutationIterator(java.lang.Object[] source, int permSize)
          Creates a new PermutationIterator for the given source array where each permutation will be of the given permSize.
 
Method Summary
 boolean hasNext()
          Returns true if the PermutationIterator has more elements.
static void main(java.lang.String[] args)
           
 java.lang.Object next()
          Returns the next element of this PermutationIterator as an array of Objects.
 void remove()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PermutationIterator

public PermutationIterator(java.lang.Object[] source)
Creates a new PermutationIterator for the given source array using all elements of the array.


PermutationIterator

public PermutationIterator(java.lang.Object[] source,
                           int permSize)
Creates a new PermutationIterator for the given source array where each permutation will be of the given permSize.

Method Detail

hasNext

public boolean hasNext()
Returns true if the PermutationIterator has more elements.

Specified by:
hasNext in interface java.util.Iterator

next

public java.lang.Object next()
Returns the next element of this PermutationIterator as an array of Objects. Throws a NoSuchElementException if there is no next elemement, i.e. if hasNext() returned false.

Specified by:
next in interface java.util.Iterator

remove

public void remove()
Specified by:
remove in interface java.util.Iterator

main

public static void main(java.lang.String[] args)


AribaWeb User Interface Development Framework
Copyright © 2000-2014 Ariba, Inc. All Rights Reserved.