java.lang.Object
net.i2p.router.web.helpers.UDPSorters

class UDPSortersextends Object
Comparators for various columns.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    (package private) static class 
    Comparator for sorting UDP peers by peer hash in ascending order.
    (package private) static class 
    Comparator for sorting UDP peers by congestion window in ascending order.
    (package private) static class 
    Comparator for sorting UDP peers by duplicate packets received in ascending order.
    (package private) static class 
    Comparator for sorting UDP peers by inbound idle time in ascending order.
    (package private) static class 
    Comparator for sorting UDP peers by outbound idle time in ascending order.
    (package private) static class 
    Comparator for sorting UDP peers by maximum transmission unit in ascending order.
    (package private) static class 
    Base comparator for UDP peers that falls back to peer hash comparison.
    (package private) static class 
    Comparator for sorting UDP peers by inbound rate in ascending order.
    (package private) static class 
    Comparator for sorting UDP peers by outbound rate in ascending order.
    (package private) static class 
    Comparator for sorting UDP peers by received messages count in ascending order.
    (package private) static class 
    Comparator for sorting UDP peers by retransmitted packets in ascending order.
    (package private) static class 
    Comparator for sorting UDP peers by retransmission timeout in ascending order.
    (package private) static class 
    Comparator for sorting UDP peers by round trip time in ascending order.
    (package private) static class 
    Comparator for sorting UDP peers by sent messages count in ascending order.
    (package private) static class 
    Comparator for sorting UDP peers by clock skew in ascending order.
    (package private) static class 
    Comparator for sorting UDP peers by slow start threshold in ascending order.
    (package private) static class 
    Comparator for sorting UDP peers by uptime in ascending order.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) static final int
    Sort by peer hash.
    (package private) static final int
    Sort by congestion window.
    (package private) static final int
    Sort by duplicate packets.
    (package private) static final int
    Sort by inbound idle time.
    (package private) static final int
    Sort by outbound idle time.
    (package private) static final int
    Sort by MTU.
    (package private) static final int
    Sort by inbound rate.
    (package private) static final int
    Sort by outbound rate.
    (package private) static final int
    Sort by received message count.
    (package private) static final int
    Sort by retransmitted packets.
    (package private) static final int
    Sort by RTO.
    (package private) static final int
    Sort by RTT.
    (package private) static final int
    Sort by sent message count.
    (package private) static final int
    Sort by clock skew.
    (package private) static final int
    Sort by slow start threshold.
    (package private) static final int
    Sort by uptime.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Instances are never needed; this is a holder for the flags and comparators.
  • Method Summary

    All Methods
    Modifier and Type
    Method
    Description
    (package private) static void
    appendSortLinks(StringBuilder buf, String urlBase, int sortFlags, String descr, int ascending)
    Append the pair of sort arrows for one column, marking the live direction of a column that is currently sorted on.
    (package private) static Comparator<PeerState>
    getComparator(int sortFlags)
    Select the comparator for a column, reversing it for a descending sort.

    Methods inherited from class Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • UDPSorters

      UDPSorters()
      Instances are never needed; this is a holder for the flags and comparators.
  • Method Details

    • getComparator

      static Comparator<PeerState> getComparator(int sortFlags)
      Select the comparator for a column, reversing it for a descending sort.
      Parameters:
      sortFlags - one of the FLAG_ columns in this class; the magnitude picks the comparator and the sign sets the direction
      Returns:
      comparator ordering PeerState by that column, or descending if sortFlags is negative; FLAG_ALPHA is the fallback
    • appendSortLinks

      static void appendSortLinks(StringBuilder buf, String urlBase, int sortFlags, String descr, int ascending)
      Append the pair of sort arrows for one column, marking the live direction of a column that is currently sorted on.
      Parameters:
      buf - buffer receiving the spans and anchors
      urlBase - page path the links point at, without a query string; this appends the "?transport=ssu&sort=N" part
      sortFlags - column and direction currently in effect, as passed to getComparator(int)
      descr - localized link title, used for both arrows
      ascending - column this control toggles; FLAG_ALPHA (0) emits a single descending link instead of a toggle