Class PerformanceComparator
java.lang.Object
org.deltava.comparators.AbstractComparator<PerformanceMetrics>
org.deltava.comparators.PerformanceComparator
- All Implemented Interfaces:
Serializable
,Comparator<PerformanceMetrics>
A Comparator to sort Performance Metrics beans.
- Since:
- 1.0
- Version:
- 8.0
- Author:
- Luke
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
Fields inherited from class org.deltava.comparators.AbstractComparator
_comparisonType, _typeNames
-
Constructor Summary
ConstructorsConstructorDescriptionPerformanceComparator
(int comparisonType) Creates a new comparator with a particular comparison type code.PerformanceComparator
(String comparisonType) Creates a new comparator with a particular comparison type name. -
Method Summary
Modifier and TypeMethodDescriptionprotected int
Compares two PerformanceMetrics beans by the designated criteria.Methods inherited from class org.deltava.comparators.AbstractComparator
compare, getComparisonType, getTypeNames, setComparisonType, setComparisonType
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
NAME
public static final int NAME- See Also:
-
AVERAGE
public static final int AVERAGE- See Also:
-
MAX
public static final int MAX- See Also:
-
MIN
public static final int MIN- See Also:
-
COUNT
public static final int COUNT- See Also:
-
-
Constructor Details
-
PerformanceComparator
public PerformanceComparator(int comparisonType) Creates a new comparator with a particular comparison type code.- Parameters:
comparisonType
- the comparison type code- Throws:
IllegalArgumentException
- if the type is invalid- See Also:
-
PerformanceComparator
Creates a new comparator with a particular comparison type name.- Parameters:
comparisonType
- the comparison type name- Throws:
IllegalArgumentException
- if the type is invalid- See Also:
-
-
Method Details
-
compareImpl
Compares two PerformanceMetrics beans by the designated criteria.- Specified by:
compareImpl
in classAbstractComparator<PerformanceMetrics>
- Parameters:
m1
- The first object to comparem2
- The second object to compare- Returns:
- -1, 0, 1 as defined by the compareTo(Object, Object) interface
- Throws:
ClassCastException
- if either object is not a PerformanceMetrics bean- See Also:
-