Logo Search packages:      
Sourcecode: visualvm version File versions  Download package

org::netbeans::lib::profiler::utils::LongSorter Class Reference

List of all members.

Detailed Description

An implementation of quick sort for long numbers. The advantage of this class is that it provides a protected swap(idx1, idx2) method, that can be overridden by a subclass. This allows one to easily create a subclass of LongSorter, that would sort, for example, a data structure consisting of several arrays, whose elements at the same index are viewed as a single logical record, and the order of these records is determined by the order of elements in one long[] array. A subclass to sort such records should override swap(). The new implementation of swap() should call super.swap() and then take care of swapping the rest of the "fields" of the two given logical records.

Misha Dmitriev

Definition at line 55 of file LongSorter.java.

Public Member Functions

 LongSorter (long[] x, int off, int len)
void sort (boolean asc)

Protected Member Functions

void swap (int a, int b)

Private Member Functions

int med3 (int a, int b, int c)
void sort1Asc (int off, int len)
void sort1Desc (int off, int len)
void vecswap (int a, int b, int n)

Private Attributes

int len
int off
long[] x

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index