support.Flight
Class FlightSpecs
java.lang.Object
|
+--support.Flight.FlightSpecs
- public class FlightSpecs
- extends java.lang.Object
Data bucket that holds information about a flight.
|
Constructor Summary |
(package private) |
FlightSpecs(java.lang.String line,
Dictionary airports)
Parses a line from a file into a data object representing the
flight info. |
| Methods inherited from class java.lang.Object |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
wait,
wait,
wait |
AIRLINE
private static final int AIRLINE
AIRLINEEND
private static final int AIRLINEEND
FLIGHT
private static final int FLIGHT
FLIGHTEND
private static final int FLIGHTEND
SRC
private static final int SRC
SRCEND
private static final int SRCEND
SRCTIME
private static final int SRCTIME
SRCTIMEEND
private static final int SRCTIMEEND
DEST
private static final int DEST
DESTEND
private static final int DESTEND
DESTTIME
private static final int DESTTIME
DESTTIMEEND
private static final int DESTTIMEEND
PLANE
private static final int PLANE
PLANEEND
private static final int PLANEEND
FARES
private static final int FARES
airline_
private java.lang.String airline_
number_
private int number_
srcCode_
private java.lang.String srcCode_
destCode_
private java.lang.String destCode_
deptime_
private int deptime_
arrtime_
private int arrtime_
localdeptime_
private int localdeptime_
localarrtime_
private int localarrtime_
plane_
private java.lang.String plane_
fares_
private java.lang.String fares_
FlightSpecs
FlightSpecs(java.lang.String line,
Dictionary airports)
- Parses a line from a file into a data object representing the
flight info.
- Parameters:
line - String from a flight database fileairports - Dictionary of (String airportcode, AirportSpecs element)
airline
public java.lang.String airline()
- Returns:
- the airline (PA, UA, AC, etc)
flightNumber
public int flightNumber()
- Returns:
- the flight number (TW 800 yields 800, AC8813 yields 8813, etc)
originCode
public java.lang.String originCode()
- Returns:
- the 3-letter code of the airport the flight left (PVD, LAX, etc)
- See Also:
AirportSpecs.code()
destinationCode
public java.lang.String destinationCode()
- Returns:
- the 3-letter code of the airport the flight goes to (PVD, etc)
- See Also:
AirportSpecs.code()
departureTime
public int departureTime()
- Returns:
- the departure time of the flight, in GMT minutes since midnight
arrivalTime
public int arrivalTime()
- Returns:
- the arrival time of the flight, in GMT minutes since midnight
planeType
public java.lang.String planeType()
- Returns:
- the airliner type (737, DC8, Wright Brothers, etc)
fareCodes
public java.lang.String fareCodes()
- Returns:
- the fares available (Y, Q, H, F, P, etc; dunno what they mean)
toString
public java.lang.String toString()
- Gives a string in a form useful for debugging. (If you have a FlightSpecs f,
you can just
System.err.println(f).)
- Returns:
- String representing the flight
- Overrides:
- toString in class java.lang.Object
ticketString
public java.lang.String ticketString()
- Gives a string in a form useful for printing out itineraries.
Note the times are given in local time of the airport, so
a flight
AC8813 YHZ 1200N BOS 1235P DH8 Y Q H P F
Leaves YHZ at noon Atlantic time and arrives in Boston at 12:35 Eastern
time. So it takes 1:35, not 35 minutes.
- Returns:
- String that should be printed on console to show itinerary