Class AirportComparator
- All Implemented Interfaces:
Serializable
,Comparator<Airport>
A comparator for Airport beans.
- Since:
- 1.0
- Version:
- 9.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
ConstructorsConstructorDescriptionAirportComparator
(int comparisonType) Creates a new AirportComparator with a given comparison typeAirportComparator
(String comparisonType) Creates a new AirportComparator with a given comparison type -
Method Summary
Modifier and TypeMethodDescriptionprotected int
compareImpl
(Airport a1, Airport a2) Compares two airports by the designated criteriaMethods 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
-
IATA
public static final int IATA- See Also:
-
ICAO
public static final int ICAO- See Also:
-
NAME
public static final int NAME- See Also:
-
LATITUDE
public static final int LATITUDE- See Also:
-
LONGITUDE
public static final int LONGITUDE- See Also:
-
-
Constructor Details
-
AirportComparator
public AirportComparator(int comparisonType) Creates a new AirportComparator with a given comparison type- Parameters:
comparisonType
- The criteria by which to compare- Throws:
IllegalArgumentException
- if the type is invalid- See Also:
-
AirportComparator
Creates a new AirportComparator 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
Compares two airports by the designated criteria- Specified by:
compareImpl
in classAbstractComparator<Airport>
- Parameters:
a1
- The first object to comparea2
- The second object to compare- Returns:
- -1, 0, 1 as defined by the compareTo(Object, Object) interface
- Throws:
ClassCastException
- if either object is not an Airport- See Also:
-