Package adams.data.binning.operation
Class Sort
- java.lang.Object
-
- adams.data.binning.operation.Sort
-
public class Sort extends Object
For sorting binnable data.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
-
-
Constructor Summary
Constructors Constructor Description Sort()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> List<Binnable<T>>
group(List<Binnable<T>> data)
Groups the binnable data in-place using its values.static <T> List<Binnable<T>>
sort(List<Binnable<T>> data)
Sorts the binnable data in-place using its values.protected static <T> void
swap(List<Binnable<T>> list, int first, int second)
Swaps two elements in the list.
-
-
-
Method Detail
-
swap
protected static <T> void swap(List<Binnable<T>> list, int first, int second)
Swaps two elements in the list.- Parameters:
first
- the first list itemsecond
- the second list item
-
group
public static <T> List<Binnable<T>> group(List<Binnable<T>> data)
Groups the binnable data in-place using its values. Based on Weka's sorting method in Instances#stratify(int), assuming that the values are discrete.- Type Parameters:
T
- the payload type- Parameters:
data
- the data to sort- Returns:
- the grouped input list
-
-