Class LocatableEntityQueryResult<T extends LocatableEntity>

  • All Implemented Interfaces:
    java.lang.Iterable<T>, java.util.Collection<T>

    public class LocatableEntityQueryResult<T extends LocatableEntity>
    extends QueryResult<T>
    • Constructor Detail

      • LocatableEntityQueryResult

        public LocatableEntityQueryResult​(java.util.List<T> objects,
                                          APIContext ctx)
    • Method Detail

      • nearest

        public T nearest()
      • nearest

        public T nearest​(double near,
                         double diff)
      • nearestTo

        public T nearestTo​(Locatable locatable)
      • nearestTo

        public T nearestTo​(Locatable locatable,
                           double near,
                           double diff)
        Gets the nearest entity with allowed variation. The entity list is shuffled first.
        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:
        the nearest entity with allowed variation
      • nearestList

        public java.util.List<T> nearestList()