public interface CorrespondenceComparatorDeducer<E extends Element<E>>
This is important in situations where the choice of the API comparison "partner" element cannot be determined without knowing its "neighborhood" in both element forests. A concrete example of this is comparison of overloaded methods.
|Modifier and Type||Method and Description|
This correspondence deducer is a good match for situations where the ordering of the children of some element is not semantic but rather positional, e.g.
Deduces the correspondence comparator and sorts the provided lists so that the comparator, when used to compare the elements for the two lists mutually is consistent.
static <E extends Element<E>> CorrespondenceComparatorDeducer<E> naturalOrder()
static <E extends Element<E>> CorrespondenceComparatorDeducer<E> editDistance(java.util.function.BiPredicate<? super E,? super E> equality)
E- the base type of the elements
equality- a function to determine the element equality
The collections will contain elements of different types (which is consistent with how
stores the children) and it is assumed that the sorter is able to pick and choose which types of elements it is
able to sort. The collections will be sorted according the natural order of the elements when entering this
first- the first collection of elements
second- the second collection of elements
Copyright © 2014-2021 Lukas Krejci. All Rights Reserved.