net.i2p.data.router

## Class SortHelper

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

-     class SortHelper
      extends Object

  Utility class for sorting DataStructure objects by their hash. Provides consistent network-wide sorting of RouterInfo addresses.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SortHelper()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `(package private) static void` | `sortStructureList(List<? extends DataStructure> dataStructures)` See above.
    `static <T extends DataStructure> List<T>` | `sortStructures(Collection<T> dataStructures)` Sort based on the Hash of the DataStructure.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SortHelper

          SortHelper()

  - ### Method Detail

    - #### sortStructureList

          static void sortStructureList(List<? extends DataStructure> dataStructures)

      See above. DEPRECATED - Only used by RouterInfo.

    - #### 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.
      Returns:
        a new list