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 org.deltava.comparators.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 int
compareImpl
(Airline a1, Airline a2) This method does the actual comparison.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
-
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:AbstractComparator
This method does the actual comparison. It is called and then we modify the result if we are performing a reverse sort.- Specified by:
compareImpl
in 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:
-