Class ScheduleEntry
java.lang.Object
org.deltava.beans.DatabaseBean
org.deltava.beans.Flight
org.deltava.beans.schedule.ScheduleEntry
- All Implemented Interfaces:
Serializable, Comparable<Object>, FlightNumber, IDBean, FlightTimes, RoutePair, ViewEntry, Cacheable
- Direct Known Subclasses:
RawScheduleEntry, ScheduleSearchEntry
A class to store Schedule Entry information.
- Since:
- 1.0
- Version:
- 11.6
- Author:
- Luke
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface RoutePair
RoutePair.RoutePairImpl -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intAdjusts the arrival date/time forward by a certain number of days.static final StringVariable equipment code. -
Constructor Summary
ConstructorsConstructorDescriptionScheduleEntry(Airline a, int fNumber, int leg) Creates a new Schedule Entry object with a given flight. -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdjusts the arrival time if the DST offsets for either Airport have changed from the effective date of this schedule etnry.booleanReturns if this flight is part of the Flight Academy.intReturns the number of days forward to adjust the arrival time.If a codeshare, the flight code of the operator's flight.final DurationA method to return the exact length of the flight.booleanReturns whether the arrival time has been adjusted for DST changes between the effective date of this Schedule Entry and the current date.booleanReturns the "historic flight" flag value for this flight.final intgetID()Returns the database ID of the schedule entry.final intReturns the length of the flight, in hours multiplied by 10.Returns any operator notes for this flight.Returns the CSS class for this object if rendered in a view table.Returns the original source of this Schedule Entry.getTimeA()Returns the arrival time of the flight, with full timezone information.getTimeD()Returns the departure time of the flight, with full timezone information.inthashCode()static booleanisVariable(Flight f) Helper method to determine if flight is using a variable equipment type.voidsetAcademy(boolean academy) Updates this Schedule entry's "Flight Academy flight" flag.voidsetCodeShare(String flightCode) If this is a codeshare flight, the flight code of the operator's flight.voidsetHistoric(boolean historic) Updates this Schedule entry's "historic flight" flag.final voidsetID(int id) Sets the database ID of this schedule entry.voidsetLength(int len) Sets the length of a flight leg.voidsetRemarks(String remarks) Updates any notes (usually about codehsare operator) for this flight.voidsetSource(ScheduleSource src) Updates the source of this entry.voidSets the arrival time for this flight.voidSets the departure time for this flight.toString()Methods inherited from class Flight
compareTo, equals, getAirline, getAirportA, getAirportD, getCallsign, getDistance, getEquipmentType, getFlightCode, getFlightNumber, getLeg, getLegCode, getShortCode, setAirline, setAirportA, setAirportD, setEquipmentType, setFlightNumber, setLegMethods inherited from class DatabaseBean
cacheKey, getHexID, validateID, validateIDMethods inherited from interface FlightTimes
hasFlightTimesMethods inherited from interface RoutePair
createKey, getAirports, getFlightType, includes, isPopulated, matches, midPoint
-
Field Details
-
EQ_VARIES
-
_arrivalPlusDays
protected int _arrivalPlusDaysAdjusts the arrival date/time forward by a certain number of days.
-
-
Constructor Details
-
ScheduleEntry
Creates a new Schedule Entry object with a given flight.- Parameters:
a- the AirlinefNumber- the Flight Numberleg- the Leg Number- Throws:
NullPointerException- if the Airline Code is nullIllegalArgumentException- if the Flight Report is zero or negativeIllegalArgumentException- if the Leg is less than 1 or greater than 5- See Also:
-
-
Method Details
-
isVariable
Helper method to determine if flight is using a variable equipment type.- Parameters:
f- a Flight- Returns:
- TRUE if equipment varies, otherwise FALSE
- See Also:
-
getLength
public final int getLength()Returns the length of the flight, in hours multiplied by 10.- Specified by:
getLengthin classFlight- Returns:
- the length of the flight
- Throws:
IllegalStateException- if departure or arrival times are not set- See Also:
-
getDuration
Description copied from class:FlightA method to return the exact length of the flight.- Specified by:
getDurationin classFlight- Returns:
- a Duration
-
getTimeD
Description copied from interface:FlightTimesReturns the departure time of the flight, with full timezone information. The date component of this value can be ignored, but may contain significant information like the flight date or the effective date for a schedule entry.- Specified by:
getTimeDin interfaceFlightTimes- Returns:
- the full departure time of the flight
- See Also:
-
getTimeA
Description copied from interface:FlightTimesReturns the arrival time of the flight, with full timezone information. The date component of this value can be ignored, but may contain significant information.- Specified by:
getTimeAin interfaceFlightTimes- Returns:
- the full arrival time of the flight
- See Also:
-
getID
public final int getID()Returns the database ID of the schedule entry. NOT IMPLEMENTED- Specified by:
getIDin interfaceIDBean- Overrides:
getIDin classDatabaseBean- Returns:
- the database ID
- Throws:
UnsupportedOperationException- always
-
getHistoric
public boolean getHistoric()Returns the "historic flight" flag value for this flight.- Returns:
- TRUE if this is a historic flight, FALSE otherwise
- See Also:
-
getAcademy
public boolean getAcademy()Returns if this flight is part of the Flight Academy.- Returns:
- TRUE if the flight is part of the Flight Academy, otherwise FALSE
- See Also:
-
getHasDSTAdjustment
public boolean getHasDSTAdjustment()Returns whether the arrival time has been adjusted for DST changes between the effective date of this Schedule Entry and the current date.- Returns:
- TRUE if the arrival time has been adjusted, otherwise FALSE
- See Also:
-
getSource
Returns the original source of this Schedule Entry.- Returns:
- the ScheduleSource, or null
-
getArrivalPlusDays
public int getArrivalPlusDays()Returns the number of days forward to adjust the arrival time.- Returns:
- the number of days
-
getRemarks
-
setID
public final void setID(int id) Sets the database ID of this schedule entry. NOT IMPLEMENTED- Overrides:
setIDin classDatabaseBean- Parameters:
id- The primary key of the entry in the database that corresponds to this object.- Throws:
UnsupportedOperationException- always- See Also:
-
adjustForDST
Adjusts the arrival time if the DST offsets for either Airport have changed from the effective date of this schedule etnry.- Parameters:
dt- the current date- Returns:
- TRUE if the arrival time has been adjusted, otherwise FALSE
-
setTimeD
Sets the departure time for this flight.- Parameters:
dt- the departure time of the flight- Throws:
NullPointerException- if the departure airport is not set- See Also:
-
setTimeA
Sets the arrival time for this flight.- Parameters:
dt- the arrival time of the flight in local time- Throws:
NullPointerException- if the arrival airport is not set- See Also:
-
setLength
public void setLength(int len) Sets the length of a flight leg.- Parameters:
len- the length of a leg, in hours mulitiplied by ten.- See Also:
-
setHistoric
public void setHistoric(boolean historic) Updates this Schedule entry's "historic flight" flag.- Parameters:
historic- the new "historic flight" flag value- See Also:
-
setAcademy
public void setAcademy(boolean academy) Updates this Schedule entry's "Flight Academy flight" flag.- Parameters:
academy- TRUE if the Flight is part of the Academy, otherwise FALSE- See Also:
-
setRemarks
Updates any notes (usually about codehsare operator) for this flight.- Parameters:
remarks- the remarks
-
setSource
Updates the source of this entry.- Parameters:
src- the ScheduleSource
-
getRowClassName
Description copied from interface:ViewEntryReturns the CSS class for this object if rendered in a view table.- Specified by:
getRowClassNamein interfaceViewEntry- Returns:
- the CSS class name, or NULL if none
-
toString
-
hashCode
-