org.deltava.comparators
Class FlightReportComparator

java.lang.Object
  extended by org.deltava.comparators.AbstractComparator<FlightReport>
      extended by org.deltava.comparators.FlightReportComparator
All Implemented Interfaces:
Serializable, Comparator<FlightReport>

public class FlightReportComparator
extends AbstractComparator<FlightReport>

A comparator to sort Flight Reports.

Since:
1.0
Version:
2.7
Author:
Luke
See Also:
Serialized Form

Field Summary
static int DATE
           
static int DESTINATION
           
static int DISTANCE
           
static int EQUIPMENT
           
static int FLIGHTCODE
           
static int LENGTH
           
static int ORIGIN
           
static int PROCESSING_TIME
           
 
Fields inherited from class org.deltava.comparators.AbstractComparator
_comparisonType, _reverseSort, _typeNames
 
Constructor Summary
FlightReportComparator(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
protected  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, isReverseSort, setComparisonType, setComparisonType, setReverseSort
 
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
 

Field Detail

DATE

public static final int DATE
See Also:
Constant Field Values

LENGTH

public static final int LENGTH
See Also:
Constant Field Values

DISTANCE

public static final int DISTANCE
See Also:
Constant Field Values

EQUIPMENT

public static final int EQUIPMENT
See Also:
Constant Field Values

ORIGIN

public static final int ORIGIN
See Also:
Constant Field Values

DESTINATION

public static final int DESTINATION
See Also:
Constant Field Values

PROCESSING_TIME

public static final int PROCESSING_TIME
See Also:
Constant Field Values

FLIGHTCODE

public static final int FLIGHTCODE
See Also:
Constant Field Values
Constructor Detail

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:
AbstractComparator.setComparisonType(int)

FlightReportComparator

public FlightReportComparator(String typeName)
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:
AbstractComparator.setComparisonType(String)
Method Detail

compareImpl

protected int compareImpl(FlightReport f1,
                          FlightReport f2)
Compares two Flight Reports by the designated criterial.

Specified by:
compareImpl in class AbstractComparator<FlightReport>
Parameters:
f1 - The first object to compare
f2 - 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:
Comparator.compare(Object, Object)


Copyright © 2004-2009 Global Virtual Airlines Group. All Rights Reserved.