org.apache.hadoop.util
Class HeapSort

java.lang.Object
  extended by org.apache.hadoop.util.HeapSort
All Implemented Interfaces:
IndexedSorter

public final class HeapSort
extends Object
implements IndexedSorter

An implementation of the core algorithm of HeapSort.


Constructor Summary
HeapSort()
           
 
Method Summary
 void sort(IndexedSortable s, int p, int r)
          Sort the given range of items using heap sort.
 void sort(IndexedSortable s, int p, int r, Progressable rep)
          Same as IndexedSorter.sort(IndexedSortable,int,int), but indicate progress periodically.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HeapSort

public HeapSort()
Method Detail

sort

public void sort(IndexedSortable s,
                 int p,
                 int r)
Sort the given range of items using heap sort. Sort the items accessed through the given IndexedSortable over the given range of logical indices. From the perspective of the sort algorithm, each index between l (inclusive) and r (exclusive) is an addressable entry.

Specified by:
sort in interface IndexedSorter
See Also:
IndexedSortable.compare(int, int), IndexedSortable.swap(int, int)

sort

public void sort(IndexedSortable s,
                 int p,
                 int r,
                 Progressable rep)
Same as IndexedSorter.sort(IndexedSortable,int,int), but indicate progress periodically.

Specified by:
sort in interface IndexedSorter
See Also:
IndexedSorter.sort(IndexedSortable,int,int)


Copyright © 2009 The Apache Software Foundation