All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.objectspace.jgl.algorithms.Swapping

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

public final class Swapping
extends Object
The Swapping class contains generic swapping algorithms.

See Also:
SwappingExamples

Method Index

 o iterSwap(ForwardIterator, ForwardIterator)
Swap the objects referenced by two iterators.
 o swapRanges(Container, Container)
Swap the elements in one container with the elements in another container of the same size.
 o swapRanges(ForwardIterator, ForwardIterator, ForwardIterator)
Swap the elements in one sequence with the elements in another sequence of the same size.

Methods

 o iterSwap
 public static void iterSwap(ForwardIterator iterator1,
                             ForwardIterator iterator2)
Swap the objects referenced by two iterators.

Parameters:
iterator1 - The first iterator.
iterator2 - The second iterator.
 o swapRanges
 public static ForwardIterator swapRanges(ForwardIterator first1,
                                          ForwardIterator last1,
                                          ForwardIterator first2)
Swap the elements in one sequence with the elements in another sequence of the same size.

Parameters:
first1 - An iterator positioned at the first element of the first sequence.
last1 - An iterator positioned immediately after the last element of the first sequence.
first2 - An iterator positioned at the first element of the second sequence.
Returns:
An iterator positioned immediately after the last element in the second sequence.
Throws: IllegalArgumentException
If the iterators are incompatible.
 o swapRanges
 public static ForwardIterator swapRanges(Container container1,
                                          Container container2)
Swap the elements in one container with the elements in another container of the same size.

Parameters:
container1 - The first container.
container2 - The second container.
Returns:
An iterator positioned immediately after the last element in the second container.

All Packages  Class Hierarchy  This Package  Previous  Next  Index