java.lang.Object
org.klomp.snark.web.Sorters.FAISort
org.klomp.snark.web.Sorters.FAIRemainingComparator
- All Implemented Interfaces:
Serializable, Comparator<Sorters.FileAndIndex>
- Enclosing class:
Sorters
Orders files by bytes left to download.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final longFixed id, the comparator is never serialized across versions.Constructor Summary
ConstructorsConstructorDescriptionFAIRemainingComparator(boolean rev) Creates the file remaining-bytes comparator.Method Summary
All MethodsModifier and TypeMethodDescriptionintCompare two file/index entries.Methods inherited from class Sorters.FAISort
compare, compLongModifier and TypeMethodDescriptionintprotected static intcompLong(long l, long r) Compares two longs without overflow.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:
Constructor Details
FAIRemainingComparator
public FAIRemainingComparator(boolean rev) Creates the file remaining-bytes comparator.- Parameters:
rev- true to reverse the order
Method Details
compareIt
Description copied from class:Sorters.FAISortCompare two file/index entries.- Specified by:
compareItin classSorters.FAISort- Parameters:
l- the first entryr- the second entry- Returns:
- the order of the two entries