fm.liveswitch.Sort Class Reference

Encapsulates useful sorting utilities. More...

Public Member Functions

 Sort ()
 

Static Public Member Functions

static< T > void quickSort (java.util.ArrayList< T > array, fm.liveswitch.IFunction2< T, T, fm.liveswitch.CompareResult > comparer)
 Sorts an array using the in-place quick-sort algorithm. More...
 

Detailed Description

Encapsulates useful sorting utilities.

Constructor & Destructor Documentation

◆ Sort()

fm.liveswitch.Sort.Sort ( )

Member Function Documentation

◆ quickSort()

static <T> void fm.liveswitch.Sort.quickSort ( java.util.ArrayList< T >  array,
fm.liveswitch.IFunction2< T, T, fm.liveswitch.CompareResult comparer 
)
static

Sorts an array using the in-place quick-sort algorithm.

Parameters
arrayThe array of elements.
comparerThe function used to compare elements in the array - should return less than 0 if item 1 is less than item 2 (item 1 should appear before item 2), 0 if the items are equal, or more than 0 is item 1 is greater than item 2 (item 1 should appear after item 2).