All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.objectspace.jgl.algorithms.Reversing

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

public final class Reversing
extends Object
The Reversing class contains generic reversing algorithms.

See Also:
ReversingExamples

Method Index

 o reverse(BidirectionalIterator, BidirectionalIterator)
Reverse a sequence.
 o reverse(Container)
Reverse a container.
 o reverseCopy(BidirectionalIterator, BidirectionalIterator, OutputIterator)
Copy the reverse of a sequence into another sequence of the same size.
 o reverseCopy(Container, Container)
Copy the reverse of a container into another container.
 o reverseCopy(Container, OutputIterator)
Copy the reverse of a container into a sequence.

Methods

 o reverse
 public static void reverse(BidirectionalIterator first,
                            BidirectionalIterator last)
Reverse a sequence. The time complexity is linear and the space complexity is constant.

Parameters:
first - An iterator positioned at the first element of the sequence.
last - An iterator positioned immediately after the last element of the sequence.
Throws: IllegalArgumentException
If the iterators are incompatible.
 o reverse
 public static void reverse(Container container)
Reverse a container. The time complexity is linear and the space complexity is constant.

Parameters:
container - The container to reverse.
 o reverseCopy
 public static OutputIterator reverseCopy(BidirectionalIterator first,
                                          BidirectionalIterator last,
                                          OutputIterator result)
Copy the reverse of a sequence into another sequence of the same size. The time complexity is linear and the space complexity is constant.

Parameters:
first - An iterator positioned at the first element of the input sequence.
last - An iterator positioned immediately after the last element of the input sequence.
result - An iterator positioned at the first element of the output sequence.
Returns:
An iterator positioned immediately after the last element of the output sequence.
Throws: IllegalArgumentException
If the iterators are incompatible.
 o reverseCopy
 public static OutputIterator reverseCopy(Container input,
                                          OutputIterator result)
Copy the reverse of a container into a sequence. The time complexity is linear and the space complexity is constant.

Parameters:
input - The input container.
result - An iterator positioned at the first element of the output sequence.
Returns:
An iterator positioned immediately after the last element of the output sequence.
 o reverseCopy
 public static void reverseCopy(Container source,
                                Container destination)
Copy the reverse of a container into another container. The time complexity is linear and the space complexity is constant.

Parameters:
source - The source container.
destination - The destination container.
Returns:
An iterator positioned immediately after the last element of the output sequence.

All Packages  Class Hierarchy  This Package  Previous  Next  Index