public final class Comparators extends Object
| Modifier and Type | Field and Description |
|---|---|
static Comparator<ListPair<?>> |
areaPairComparator
Compares the sum of the areas of two ListPairs.
|
static Comparator<ListPair<?>> |
overlapListPairComparator |
| Modifier and Type | Method and Description |
|---|---|
static Comparator<HasGeometry> |
areaComparator(Rectangle r) |
static <T extends HasGeometry> |
areaIncreaseComparator(Rectangle r) |
static <T,S extends Geometry> |
ascendingDistance(Rectangle r)
Returns a comparator that can be used to sort entries returned by search
methods.
|
static <T> Comparator<T> |
compose(Comparator<T>... comparators) |
static <T extends HasGeometry> |
overlapAreaComparator(Rectangle r,
List<T> list)
Returns a
Comparator that is a normal Double comparator for the
total of the areas of overlap of the members of the list with the
rectangle r. |
static <R,T extends Comparable<T>> |
toComparator(rx.functions.Func1<R,T> function) |
public static final Comparator<ListPair<?>> overlapListPairComparator
public static final Comparator<ListPair<?>> areaPairComparator
public static <T extends HasGeometry> Comparator<HasGeometry> overlapAreaComparator(Rectangle r, List<T> list)
Comparator that is a normal Double comparator for the
total of the areas of overlap of the members of the list with the
rectangle r.T - type of geometry being comparedr - rectanglelist - geometries to compare with the rectanglepublic static <T extends HasGeometry> Comparator<HasGeometry> areaIncreaseComparator(Rectangle r)
public static Comparator<HasGeometry> areaComparator(Rectangle r)
public static <R,T extends Comparable<T>> Comparator<R> toComparator(rx.functions.Func1<R,T> function)
public static <T> Comparator<T> compose(Comparator<T>... comparators)
public static <T,S extends Geometry> Comparator<Entry<T,S>> ascendingDistance(Rectangle r)
Returns a comparator that can be used to sort entries returned by search methods. For example:
search(100).toSortedList(ascendingDistance(r))
T - the value typeS - the entry typer - rectangle to measure distance toCopyright © 2013–2015. All rights reserved.