Package it.tidalwave.util
Interface Finder.InMemorySortCriterion<U>
- 
- All Superinterfaces:
- Finder.SortCriterion
 - All Known Implementing Classes:
- Finder.InMemorySortCriterion.DefaultInMemorySortCriterion
 
 public static interface Finder.InMemorySortCriterion<U> extends Finder.SortCriterion An interface that should be implemented by specificFinder.SortCriterionobjects 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 ofORDER BY). The facility classHierarchicFinderSupportsupportsFilterSortCriterionobjects out of the box.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Interface Description static classFinder.InMemorySortCriterion.DefaultInMemorySortCriterion<U>
 - 
Field Summary- 
Fields inherited from interface it.tidalwave.util.Finder.SortCriterion_SortCriterion_, DEFAULT, UNSORTED
 
- 
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static <U> Finder.InMemorySortCriterion<U>of(java.util.Comparator<? super U> comparator)Creates a new in-memorySortCriterionbased on aComparator.static <U> Finder.InMemorySortCriterion<U>of(java.util.Comparator<? super U> comparator, java.lang.String name)Creates a new in-memorySortCriterionbased on aComparator.default voidsort(java.util.List<? extends U> results)Performs the sort of results.voidsort(java.util.List<? extends U> results, Finder.SortDirection sortDirection)Performs the sort of results.
 
- 
- 
- 
Method Detail- 
sortdefault void sort(@Nonnull java.util.List<? extends U> results)Performs the sort of results.- Parameters:
- results- the list of objects to be sorted in place
 
 - 
sortvoid sort(@Nonnull java.util.List<? extends U> results, @Nonnull Finder.SortDirection sortDirection)Performs the sort of results.- Parameters:
- results- the list of objects to be sorted in place
- sortDirection- the sort direction
 
 - 
of@Nonnull static <U> Finder.InMemorySortCriterion<U> of(@Nonnull java.util.Comparator<? super U> comparator) Creates 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 java.util.Comparator<? super U> comparator, @Nonnull java.lang.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
 
 
- 
 
-