Package it.tidalwave.util
Interface Finder.InMemorySortCriterion<U>
- All Superinterfaces:
- Finder.SortCriterion
- All Known Implementing Classes:
- Finder.InMemorySortCriterion.DefaultInMemorySortCriterion
An interface that should be implemented by specific 
Finder.SortCriterion objects which are capable to implement
 by themselves the sorting of objects, by post-processing an existing collection of objects. While this is often
 convenient, it is possible for it to be inefficient in cases in which the original source of objects is capable
 to perform the sort in an optimized way (e.g. an SQL database by means of ORDER BY). The facility class
 HierarchicFinderSupport supports FilterSortCriterion objects out of the box.- 
Nested Class SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic class
- 
Field SummaryFields inherited from interface it.tidalwave.util.Finder.SortCriterion_SortCriterion_, DEFAULT, UNSORTED
- 
Method SummaryModifier and TypeMethodDescriptionstatic <U> Finder.InMemorySortCriterion<U> of(Comparator<? super U> comparator) Creates a new in-memorySortCriterionbased on aComparator.static <U> Finder.InMemorySortCriterion<U> of(Comparator<? super U> comparator, String name) Creates a new in-memorySortCriterionbased on aComparator.default voidPerforms the sort of results.voidsort(List<? extends U> results, Finder.SortDirection sortDirection) Performs the sort of results.
- 
Method Details- 
sortPerforms the sort of results.- Parameters:
- results- the list of objects to be sorted in place
 
- 
sortPerforms the sort of results.- Parameters:
- results- the list of objects to be sorted in place
- sortDirection- the sort direction
 
- 
ofCreates a new in-memorySortCriterionbased on aComparator.- Type Parameters:
- U- the type of the objects to compare
- Parameters:
- comparator- the- Comparator
- Returns:
- the new SortCriterion
 
- 
of@Nonnull static <U> Finder.InMemorySortCriterion<U> of(@Nonnull Comparator<? super U> comparator, @Nonnull String name) Creates a new in-memorySortCriterionbased on aComparator.- Type Parameters:
- U- the type of the objects to compare
- Parameters:
- comparator- the- Comparator
- name- a name
- Returns:
- the new SortCriterion
 
 
-