java.lang.Object
net.i2p.data.router.SortHelper

class SortHelperextends Object
Utility class for sorting DataStructure objects by their hash. Provides consistent network-wide sorting of RouterInfo addresses.
  • Constructor Details

    • SortHelper

      SortHelper()
      Utility class holding only static methods.
  • Method Details

    • sortStructures

      public static <T extends DataStructure> List<T> sortStructures(Collection<T> dataStructures)
      Sort based on the Hash of the DataStructure. Warning - relatively slow. WARNING - this sort order must be consistent network-wide, so while the order is arbitrary, it cannot be changed. Why? Just because it has to be consistent so signing will work. DEPRECATED - Only used by RouterInfo.
      Type Parameters:
      T - the DataStructure subtype being ordered
      Parameters:
      dataStructures - the structures to order, or null to get an empty result
      Returns:
      a new list
    • sortStructureList

      static void sortStructureList(List<? extends DataStructure> dataStructures)
      See above. DEPRECATED - Only used by RouterInfo.
      Parameters:
      dataStructures - the list to reorder in place by hash