All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Class jgl.Sorting

java.lang.Object
    |
    +----jgl.Sorting

public final class Sorting
extends Object
The Sorting class contains generic sorting algorithms.

Version:
JOS-FileSystem 4 Preview (25-Mar-98)
Author:
ObjectSpace, Inc.
See Also:
jgl.examples.SortingExamples

Method Index

 o sort(ForwardIterator, ForwardIterator)
Sort the elements in a sequence according to their hash code.
 o sort(ForwardIterator, ForwardIterator, BinaryPredicate)
Sort the elements in a sequence using a comparator.
 o sort(Sequence)
Sort the elements in a Sequence container according to their hash code.
 o sort(Sequence, BinaryPredicate)
Sort the elements in a random access container using a comparator.

Methods

 o sort
public static void sort(ForwardIterator first,
                        ForwardIterator last)
Sort the elements in a sequence according to their hash code. The object with the smallest hash code is placed first. The time complexity is O(NlogN) 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
is thrown if the iterators do not have Sequence containers -or- if there containers are different.
 o sort
public static void sort(ForwardIterator first,
                        ForwardIterator last,
                        BinaryPredicate comparator)
Sort the elements in a sequence using a comparator. The time complexity is O(NlogN) 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.
comparator - A binary function that returns true if its first operand should be positioned before its second operand.
Throws: IllegalArgumentException
is thrown if the iterators do not have Sequence containers.
 o sort
public static void sort(Sequence container)
Sort the elements in a Sequence container according to their hash code. The object with the smallest hash code is placed first. The time complexity is O(NlogN) and the space complexity is constant.

Parameters:
container - A Sequence container.
 o sort
public static void sort(Sequence container,
                        BinaryPredicate comparator)
Sort the elements in a random access container using a comparator. The time complexity is O(NlogN) and the space complexity is constant.

Parameters:
container - A random access container.
comparator - A BinaryFunction that returns true if its first operand should be positioned before its second operand.

All Packages  Class Hierarchy  This Package  Previous  Next  Index