com.unister.semweb.drums.bucket.hashfunction.util
Class RangeHashSorter

java.lang.Object
  extended by com.unister.semweb.drums.bucket.hashfunction.util.RangeHashSorter

public class RangeHashSorter
extends java.lang.Object

This class is able to perform an associative sort. It takes two arrays with the same number of elements. These arrays correspond to each other, meaning that the value of the ith element of the first array corresponds of the ith element of the second array.

Author:
Nils Thieme, Martin Nettling

Constructor Summary
RangeHashSorter(byte[][] ranges, java.lang.String[] filenames)
          Creates a sorting machine with the three arrays.
 
Method Summary
 void quickSort()
          Makes a quicksort for the ranges.
 void quickSort(int left, int right)
          Quicksort for ranges.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RangeHashSorter

public RangeHashSorter(byte[][] ranges,
                       java.lang.String[] filenames)
Creates a sorting machine with the three arrays.

Parameters:
ranges - the ranges to sort
filenames - the filenames to sort depending on the ranges
Method Detail

quickSort

public void quickSort()
Makes a quicksort for the ranges. If the array is small an insertion sort will be made. Algorithm of O( n*log(n) ) asymptotic upper bound.


quickSort

public void quickSort(int left,
                      int right)
Quicksort for ranges. The bounds specify which part of the array is to be sorted.

Algorithm of O( n*log(n) ) asymptotic upper bound.
This version of quicksort also allows for bounds to be put in to specify what part of the array will be sorted.
The part of the array that lies between left and right is the only part that will be sorted.

Parameters:
left - The left boundary of what will be sorted.
right - The right boundary of what will be sorted.