org.beanfabrics.model
Interface Sorter


public interface Sorter

The Sorter provides methods for sorting collections of PM objects by a list of SortKeys.

Each sort key defines a Path to the PM's child node that should be used as sort field. The comparison itself is delegated to a Comparable substitute generated by the sort field's HasComparable.getComparable() method.


Method Summary
<T extends PresentationModel>
void
sortBy(java.util.List<T> list, SortKey... sortKeys)
          Sorts the given list by the specified sort keys.
<K,V extends PresentationModel>
void
sortBy(OrderPreservingMap<K,V> map, SortKey... sortKeys)
          Sorts the given map by the specified sort keys.
 

Method Detail

sortBy

<K,V extends PresentationModel> void sortBy(OrderPreservingMap<K,V> map,
                                            SortKey... sortKeys)
Sorts the given map by the specified sort keys.

Type Parameters:
K -
V -
Parameters:
map - the map to be sorted
sortKeys - the sort keys for the sorting

sortBy

<T extends PresentationModel> void sortBy(java.util.List<T> list,
                                          SortKey... sortKeys)
Sorts the given list by the specified sort keys.

Type Parameters:
T -
Parameters:
list - the list to be sorted
sortKeys - the sort keys for the sorting