Class ScheduleEntryComparator
java.lang.Object
org.deltava.comparators.AbstractComparator<ScheduleEntry>
org.deltava.comparators.ScheduleEntryComparator
- All Implemented Interfaces:
Serializable, Comparator<ScheduleEntry>
A comparator for Schedule entries.
- Since:
- 4.1
- Version:
- 11.0
- Author:
- Luke
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from class AbstractComparator
_comparisonType, _typeNamesModifier and TypeFieldDescriptionprotected intThe criteria by which to compare objects.protected String[]Text descriptions of the different comparison types. -
Constructor Summary
ConstructorsConstructorDescriptionScheduleEntryComparator(int comparisonType) Creates a new comparator with a given comparison type. -
Method Summary
Modifier and TypeMethodDescriptionprotected intcompareImpl(ScheduleEntry se1, ScheduleEntry se2) This method does the actual comparison.Methods inherited from class AbstractComparator
compare, getComparisonType, getTypeNames, setComparisonType, setComparisonTypeModifier and TypeMethodDescriptionfinal intcompare(ScheduleEntry o1, ScheduleEntry o2) Return the result by interrogating the implementation and applying a reverse sort if requred.intReturn the comparison type.String[]Return the list of comparison type names.voidsetComparisonType(int type) Sets the comparison type.voidsetComparisonType(String type) Sets the comparison type.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Comparator
equals, max, min, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
FLIGHT
public static final int FLIGHT- See Also:
-
EQTYPE
public static final int EQTYPE- See Also:
-
ORIGIN
public static final int ORIGIN- See Also:
-
DEST
public static final int DEST- See Also:
-
DTIME
public static final int DTIME- See Also:
-
ATIME
public static final int ATIME- See Also:
-
LENGTH
public static final int LENGTH- See Also:
-
DISTANCE
public static final int DISTANCE- See Also:
-
FLCOUNT
public static final int FLCOUNT- See Also:
-
LASTFLT
public static final int LASTFLT- See Also:
-
FLIGHT_DTIME
public static final int FLIGHT_DTIME- See Also:
-
ROUTE_FLIGHT
public static final int ROUTE_FLIGHT- See Also:
-
-
Constructor Details
-
ScheduleEntryComparator
public ScheduleEntryComparator(int comparisonType) Creates a new comparator with a given comparison type.- Parameters:
comparisonType- The criteria by which to compare- Throws:
IllegalArgumentException- if the type 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<ScheduleEntry>- Parameters:
se1- The first object to comparese2- The second object to compare- Returns:
- -1, 0, 1 as defined by the compareTo(Object, Object) interface
- See Also:
-