Class FlightReportComparator
java.lang.Object
org.deltava.comparators.AbstractComparator<FlightReport>
org.deltava.comparators.FlightReportComparator
- All Implemented Interfaces:
Serializable
,Comparator<FlightReport>
A comparator to sort Flight Reports.
- Since:
- 1.0
- Version:
- 10.0
- Author:
- Luke
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static 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
ConstructorsConstructorDescriptionFlightReportComparator
(int comparisonType) Creates a new FlightReport comparator with a particular comparison type code.FlightReportComparator
(String typeName) Creates a new FlightReport comparator with a particular comparison type name. -
Method Summary
Modifier and TypeMethodDescriptionprotected int
compareImpl
(FlightReport f1, FlightReport f2) Compares two Flight Reports by the designated criterial.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:
-
LENGTH
public static final int LENGTH- See Also:
-
DISTANCE
public static final int DISTANCE- See Also:
-
EQUIPMENT
public static final int EQUIPMENT- See Also:
-
ORIGIN
public static final int ORIGIN- See Also:
-
DESTINATION
public static final int DESTINATION- See Also:
-
FLIGHTCODE
public static final int FLIGHTCODE- See Also:
-
SUBMISSION
public static final int SUBMISSION- See Also:
-
-
Constructor Details
-
FlightReportComparator
public FlightReportComparator(int comparisonType) Creates a new FlightReport comparator with a particular comparison type code.- Parameters:
comparisonType
- The criteria by which to compare- Throws:
IllegalArgumentException
- if the type is invalid- See Also:
-
FlightReportComparator
Creates a new FlightReport comparator with a particular comparison type name.- Parameters:
typeName
- The criteria type name by which to compare- Throws:
IllegalArgumentException
- if the type name is invalid- See Also:
-
-
Method Details
-
compareImpl
Compares two Flight Reports by the designated criterial.- Specified by:
compareImpl
in classAbstractComparator<FlightReport>
- Parameters:
f1
- The first object to comparef2
- 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 FlightReport bean- See Also:
-