public class EntityComparator extends Object implements Comparator<Entity>
Comparator for entities.
Supports sorting by entity confidence and entity text.| Constructor and Description |
|---|
EntityComparator(EntityOrder sortingBy)
Creates a new
EntityComparator with the given
sorting method. |
| Modifier and Type | Method and Description |
|---|---|
int |
compare(Entity entity1,
Entity entity2) |
EntityOrder |
getSortingBy()
Gets the sorting order.
|
static Set<Entity> |
sort(Set<Entity> entities,
EntityOrder sortingBy)
Sort the entities.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcomparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongpublic EntityComparator(EntityOrder sortingBy)
EntityComparator with the given
sorting method.sortingBy - The EntityOrder to sort the entities.public int compare(Entity entity1, Entity entity2)
compare in interface Comparator<Entity>public EntityOrder getSortingBy()
EntityOrder.Copyright © 2018. All rights reserved.