java.lang.Object
org.klomp.snark.web.Sorters.Sort
org.klomp.snark.web.Sorters.StatusPoolComparator
- All Implemented Interfaces:
Serializable, Comparator<Snark>
- Enclosing class:
Sorters
Sort strictly by pool number, then by status; ties fall back to the status tie-breaks. Torrents without a destination (stopped, or multi-dest off) share pool -1 and sort after pool entries in ascending order, first in descending.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final longFixed id, the comparator is never serialized across versions.Constructor Summary
ConstructorsModifierConstructorDescriptionprivateStatusPoolComparator(boolean rev, String lang) Creates the state-and-pool comparator.Method Summary
Methods inherited from class Sorters.Sort
compare, compLongMethods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Comparator
equals, max, min, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
Field Details
serialVersionUID
private static final long serialVersionUIDFixed id, the comparator is never serialized across versions.- See Also:
Constructor Details
StatusPoolComparator
Creates the state-and-pool comparator.- Parameters:
rev- true to reverse the orderlang- the language whose collation to use
Method Details
compareIt
Description copied from class:Sorters.SortCompare two torrents on the subclass's column, falling back to name order.- Specified by:
compareItin classSorters.Sort- Parameters:
l- the left-hand torrent to comparer- the right-hand torrent to compare- Returns:
- negative, zero or positive as l sorts before, with or after r
pool
The pool number of a torrent's shared destination, Long.MAX_VALUE when the torrent has no destination.- Parameters:
snark- the torrent whose shared destination is looked up- Returns:
- the pool number, or Long.MAX_VALUE when there is none