All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.objectspace.jgl.algorithms.Permuting

java.lang.Object
   |
   +----COM.objectspace.jgl.algorithms.Permuting

public final class Permuting
extends Object
The Permuting class contains generic permuting algorithms.

See Also:
PermutingExamples

Method Index

 o nextPermutation(BidirectionalIterator, BidirectionalIterator, BinaryPredicate)
Arrange a sequence to become its next permutation.
 o nextPermutation(Container, BinaryPredicate)
Arrange a container to become its next permutation.
 o prevPermutation(BidirectionalIterator, BidirectionalIterator, BinaryPredicate)
Arrange a sequence to become its previous permutation.
 o prevPermutation(Container, BinaryPredicate)
Arrange a container to become its previous permutation.

Methods

 o nextPermutation
 public static boolean nextPermutation(BidirectionalIterator first,
                                       BidirectionalIterator last,
                                       BinaryPredicate comparator)
Arrange a sequence to become its next permutation. If it was already the last permutation, become the first permutation. Logically, the entire set of permutations is lexicographically ordered using a comparator.

Parameters:
first - An iterator positioned at the first element of the sequence.
last - An iterator positioned immediately after the last element of the sequence.
comparator - A binary predicate that returns true if its first operand is "less" than its second operand.
Returns:
true unless the sequence was already the last permutation.
Throws: IllegalArgumentException
If the iterators are incompatible or if the containers upon which the iteratore operate is not a COM.objectspace.jgl.Sequence.
 o nextPermutation
 public static boolean nextPermutation(Container container,
                                       BinaryPredicate comparator)
Arrange a container to become its next permutation. If the container is already the last permutation, become the first permutation. Logically, the entire set of permutations is lexicographically ordered using a comparator.

Parameters:
container - The container.
comparator - A binary predicate that returns true if its first operand is "less" than its second operand.
Returns:
true unless the container was already the last permutation.
 o prevPermutation
 public static boolean prevPermutation(BidirectionalIterator first,
                                       BidirectionalIterator last,
                                       BinaryPredicate comparator)
Arrange a sequence to become its previous permutation. If it was already the first permutation, become the last permutation. Logically, the entire set of permutations is lexicographically ordered using a comparator.

Parameters:
first - An iterator positioned at the first element of the sequence.
last - An iterator positioned immediately after the last element of the sequence.
comparator - A binary predicate that returns true if its first operand is "less" than its second operand.
Returns:
true unless the sequence was already the first permutation.
Throws: IllegalArgumentException
If the iterators are incompatible or if the containers upon which the iteratore operate is not a COM.objectspace.jgl.Sequence.
 o prevPermutation
 public static boolean prevPermutation(Container container,
                                       BinaryPredicate comparator)
Arrange a container to become its previous permutation. If it was already the first permutation, become the last permutation. Logically, the entire set of permutations is lexicographically ordered using a comparator.

Parameters:
container - The container.
comparator - A binary predicate that returns true if its first operand is "less" than its second operand.
Returns:
true unless the container was already the first permutation.

All Packages  Class Hierarchy  This Package  Previous  Next  Index