Class TestComparator
- All Implemented Interfaces:
Serializable
,Comparator<Test>
A comparator for sorting Examination and Check Ride objects.
- 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 String[]
Fields inherited from class org.deltava.comparators.AbstractComparator
_comparisonType, _typeNames
-
Constructor Summary
ConstructorsConstructorDescriptionTestComparator
(int comparisonType) Creates a new TestComparator with a given comparison type.TestComparator
(String comparisonType) Creates a new TestComparator with a given comparison type. -
Method Summary
Modifier and TypeMethodDescriptionprotected int
compareImpl
(Test t1, Test t2) Compares two examinations/checkrides 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
-
DATE
public static final int DATE- See Also:
-
SCORE
public static final int SCORE- See Also:
-
PERCENT
public static final int PERCENT- See Also:
-
TYPE
public static final int TYPE- See Also:
-
TYPES
-
-
Constructor Details
-
TestComparator
public TestComparator(int comparisonType) Creates a new TestComparator with a given comparison type.- Parameters:
comparisonType
- The criteria by which to compare- Throws:
IllegalArgumentException
- if the type is invalid- See Also:
-
TestComparator
Creates a new TestComparator with a given comparison type.- Parameters:
comparisonType
- The criteria type name by which to compare- Throws:
IllegalArgumentException
- if the type name is invalid- See Also:
-
-
Method Details
-
compareImpl
Compares two examinations/checkrides by the designated criteria.- Specified by:
compareImpl
in classAbstractComparator<Test>
- Parameters:
t1
- The first object to comparet2
- The second object to compare- Returns:
- -1, 0, 1 as defined by the compareTo(Object, Object) interface
- See Also:
-