Class RequestCounterComparator
java.lang.Object
org.deltava.comparators.AbstractComparator<RequestCounter>
org.deltava.comparators.RequestCounterComparator
- All Implemented Interfaces:
Serializable,Comparator<RequestCounter>
A comparator for request counters.
- Since:
- 11.6
- Version:
- 11.6
- Author:
- Luke
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intFields inherited from class org.deltava.comparators.AbstractComparator
_comparisonType, _typeNames -
Constructor Summary
ConstructorsConstructorDescriptionRequestCounterComparator(int comparisonType) Creates a new comparator with a given comparison type.RequestCounterComparator(String comparisonType) Creates a new comparator with a given comparison type. -
Method Summary
Modifier and TypeMethodDescriptionprotected intcompareImpl(RequestCounter rc1, RequestCounter rc2) This method does the actual comparison.Methods inherited from class org.deltava.comparators.AbstractComparator
compare, getComparisonType, getTypeNames, setComparisonType, setComparisonTypeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
ADDR
public static final int ADDR- See Also:
-
REQUESTS
public static final int REQUESTS- See Also:
-
OLDEST
public static final int OLDEST- See Also:
-
NEWEST
public static final int NEWEST- See Also:
-
-
Constructor Details
-
RequestCounterComparator
public RequestCounterComparator(int comparisonType) Creates a new comparator with a given comparison type.- Parameters:
comparisonType- The criteria by which to compare- Throws:
IllegalArgumentException- if the type is invalid- See Also:
-
RequestCounterComparator
Creates a new comparator with a given comparison type.- Parameters:
comparisonType- The criteria name by which to compare- Throws:
IllegalArgumentException- if the type name is invalid- See Also:
-
-
Method Details
-
compareImpl
Description copied from class:AbstractComparatorThis method does the actual comparison. It is called and then we modify the result if we are performing a reverse sort.- Specified by:
compareImplin classAbstractComparator<RequestCounter>- Parameters:
rc1- The first object to comparerc2- The second object to compare- Returns:
- -1, 0, 1 as defined by the compareTo(Object, Object) interface
- See Also:
-