Class LocatableEntityQueryResult<T extends LocatableEntity>
java.lang.Object
com.epicbot.api.shared.query.result.QueryResult<T>
com.epicbot.api.shared.query.result.LocatableEntityQueryResult<T>
- All Implemented Interfaces:
Iterable<T>,Collection<T>
-
Field Summary
Fields inherited from class com.epicbot.api.shared.query.result.QueryResult
ctx -
Constructor Summary
ConstructorsConstructorDescriptionLocatableEntityQueryResult(List<T> objects, APIContext ctx, DistanceFunction distanceFunction) -
Method Summary
Modifier and TypeMethodDescriptionSets the distance function to Chebyshev, which is the same as tile distance.Sets the distance function to Euclidean, which is the straight-line distance between two points.nearest()nearest(double near, double diff) Get the nearest entity with allowed variation.Gets the nearest entity with allowed variation.Methods inherited from class com.epicbot.api.shared.query.result.QueryResult
add, addAll, clear, contains, containsAll, first, get, isEmpty, iterator, last, limit, limit, random, remove, removeAll, retainAll, reverse, shuffle, size, sort, toArray, toArray, toListMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
-
Constructor Details
-
Method Details
-
chebyshev
Sets the distance function to Chebyshev, which is the same as tile distance.- Returns:
- this
- See Also:
-
euclidean
Sets the distance function to Euclidean, which is the straight-line distance between two points.- Returns:
- this
- See Also:
-
nearest
-
nearest
Get the nearest entity with allowed variation.- Parameters:
near- the minimum distance before variation is considered (e.g. when near is 5 and diff is 1, an object with distance 6 is allowed)diff- the allowed difference between closest and current object being considered- Returns:
-
nearestList
-