Class Sort


  • public final class Sort
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T extends Locatable>
      java.util.List<T>
      byDistance​(java.util.Collection<T> locatables)  
      static <T extends Locatable>
      java.util.List<T>
      byDistance​(java.util.Collection<T> locatables, Distance.Algorithm algorithm)  
      static <T extends Locatable>
      java.util.List<T>
      byDistanceFrom​(Locatable center, java.util.Collection<T> locatables)
      Sorts the given Collection by the distance from center with the nearest Locatable being first in the list.
      static <T extends Locatable>
      java.util.List<T>
      byDistanceFrom​(Locatable center, java.util.Collection<T> locatables, Distance.Algorithm algorithm)
      Sorts the given Collection by the distance from center using the specified algorithm with the nearest Locatable being first in the list.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • byDistance

        public static <T extends Locatable> java.util.List<T> byDistance​(java.util.Collection<T> locatables)
      • byDistance

        public static <T extends Locatable> java.util.List<T> byDistance​(java.util.Collection<T> locatables,
                                                                         Distance.Algorithm algorithm)
      • byDistanceFrom

        public static <T extends Locatable> java.util.List<T> byDistanceFrom​(Locatable center,
                                                                             java.util.Collection<T> locatables)
        Sorts the given Collection by the distance from center with the nearest Locatable being first in the list. If the center is null, a list will be returned in the same order that it was passed If the distance can't be calculated then the locatable will be placed at the end of the list.
      • byDistanceFrom

        public static <T extends Locatable> java.util.List<T> byDistanceFrom​(Locatable center,
                                                                             java.util.Collection<T> locatables,
                                                                             Distance.Algorithm algorithm)
        Sorts the given Collection by the distance from center using the specified algorithm with the nearest Locatable being first in the list. If the center is null, a list will be returned in the same order that it was passed If the distance can't be calculated then the locatable will be placed at the end of the list.