java.lang.Object
net.i2p.data.router.SortHelper
Utility class for sorting DataStructure objects by their hash. Provides consistent network-wide sorting of RouterInfo addresses.
Nested Class Summary
Nested ClassesConstructor Summary
ConstructorsMethod Summary
Public MethodsModifier and TypeMethodDescription(package private) static voidsortStructureList(List<? extends DataStructure> dataStructures) See above.static <T extends DataStructure>
List<T> sortStructures(Collection<T> dataStructures) Sort based on the Hash of the DataStructure.
Constructor Details
SortHelper
SortHelper()Utility class holding only static methods.
Method Details
sortStructures
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 byRouterInfo.- 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
See above. DEPRECATED - Only used by RouterInfo.- Parameters:
dataStructures- the list to reorder in place by hash