java.lang.Object
org.klomp.snark.web.Sorters.Sort
org.klomp.snark.web.Sorters.RatioComparator
All Implemented Interfaces:
Serializable, Comparator<Snark>
Enclosing class:
Sorters

private static class Sorters.RatioComparatorextends Sorters.Sort
Orders torrents by upload-to-download ratio.
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Fixed id, the comparator is never serialized across versions.
      See Also:
  • Constructor Details

    • RatioComparator

      public RatioComparator(boolean rev, String lang)
      Creates the ratio comparator.
      Parameters:
      rev - true to reverse the order
      lang - the language whose collation to use
  • Method Details

    • compareIt

      public int compareIt(Snark l, Snark r)
      Description copied from class: Sorters.Sort
      Compare two torrents on the subclass's column, falling back to name order.
      Specified by:
      compareIt in class Sorters.Sort
      Parameters:
      l - the left-hand torrent to compare
      r - the right-hand torrent to compare
      Returns:
      negative, zero or positive as l sorts before, with or after r