Class AirlineComparator
- All Implemented Interfaces:
Serializable, Comparator<Airline>
A comparator for Airline beans.
- Since:
- 9.0
- Version:
- 9.0
- Author:
- Luke
- See Also:
-
Field Summary
FieldsFields inherited from class AbstractComparator
_comparisonType, _typeNames -
Constructor Summary
ConstructorsConstructorDescriptionAirlineComparator(int comparisonType) Creates a new AirlineComparator with a given comparison type.AirlineComparator(String comparisonType) Creates a new AirlineComparator with a given comparison type. -
Method Summary
Modifier and TypeMethodDescriptionprotected intcompareImpl(Airline a1, Airline a2) This method does the actual comparison.Methods inherited from class AbstractComparator
compare, getComparisonType, getTypeNames, setComparisonType, setComparisonTypeMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
CODE
public static final int CODE- See Also:
-
NAME
public static final int NAME- See Also:
-
-
Constructor Details
-
AirlineComparator
public AirlineComparator(int comparisonType) Creates a new AirlineComparator with a given comparison type.- Parameters:
comparisonType- The criteria by which to compare- Throws:
IllegalArgumentException- if the type is invalid- See Also:
-
AirlineComparator
Creates a new AirlineComparator 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
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<Airline>- Parameters:
a1- The first object to comparea2- The second object to compare- Returns:
- -1, 0, 1 as defined by the compareTo(Object, Object) interface
- See Also:
-