java.lang.Object
org.klomp.snark.web.Sorters.Sort
- All Implemented Interfaces:
Serializable, Comparator<Snark>
- Direct Known Subclasses:
Sorters.DownloadedComparator, Sorters.DownRateComparator, Sorters.ETAComparator, Sorters.FileTypeComparator, Sorters.PeersComparator, Sorters.RatioComparator, Sorters.RemainingComparator, Sorters.SizeComparator, Sorters.StatusComparator, Sorters.StatusPoolComparator, Sorters.UploadedComparator, Sorters.UpRateComparator
- Enclosing class:
Sorters
Forward or reverse sort, but the fallback is always forward.
Field Summary
Constructor Summary
Method Summary
Methods 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:
_rev
private final boolean _revTrue to reverse the order._p
Pattern extracting the name's sort key._c
Collator ordering the names for the language.
Constructor Details
Sort
Creates a sorter for one direction and language.- Parameters:
rev- true to reverse the orderlang- the language whose collation to use
Method Details
compare
- Specified by:
comparein interfaceComparator<Snark>
compareIt
compLong
protected static int compLong(long l, long r) Compares two longs without overflow.- Parameters:
l- the first valuer- the second value- Returns:
- negative, zero or positive as l is less, equal or greater