All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.objectspace.jgl.algorithms.Rotating

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

public final class Rotating
extends Object
The Rotating class contains generic rotating algorithms.

See Also:
RotatingExamples

Method Index

 o rotate(ForwardIterator, ForwardIterator, ForwardIterator)
Rotate a sequence to the left.
 o rotateCopy(ForwardIterator, ForwardIterator, ForwardIterator, OutputIterator)
Perform the same operations as rotate(), except that that the result is placed into a separate sequence.

Methods

 o rotate
 public static void rotate(ForwardIterator first,
                           ForwardIterator middle,
                           ForwardIterator last)
Rotate a sequence to the left. After the operation, the element that used to be located by the first iterator is positioned immediately before the position indicated by the second iterator. The time complexity is linear and the space complexity is constant.

Parameters:
first - An iterator positioned at the first element in the sequence.
middle - An iterator positioned immediately after the target location of the first element in the sequence.
last - An iterator positioned at the last element in the sequence.
Throws: IllegalArgumentException
If the iterators are incompatible or if the containers upon which the iteratore operate is not a COM.objectspace.jgl.Sequence.
 o rotateCopy
 public static OutputIterator rotateCopy(ForwardIterator first,
                                         ForwardIterator middle,
                                         ForwardIterator last,
                                         OutputIterator result)
Perform the same operations as rotate(), except that that the result is placed into a separate sequence. The time complexity is linear and the space complexity is constant.

Parameters:
first - An iterator positioned at the first element in the input sequence.
middle - An iterator positioned immediately after the target location of the first element in the input sequence.
last - An iterator positioned at the last element in the input sequence.
result - An iterator positioned at the first element in the output sequence.
Returns:
An iterator positioned immediately after the last element in the output sequence.
Throws: IllegalArgumentException
If the iterators are incompatible.

All Packages  Class Hierarchy  This Package  Previous  Next  Index