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 org.deltava.beans.schedule.RoutePair
RoutePair.RoutePairImpl
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
Adjusts the arrival date/time forward by a certain number of days.static final String
Variable 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 TypeMethodDescriptionboolean
Adjusts the arrival time if the DST offsets for either Airport have changed from the effective date of this schedule etnry.boolean
Returns if this flight is part of the Flight Academy.int
Returns the number of days forward to adjust the arrival time.If a codeshare, the flight code of the operator's flight.final Duration
A method to return the exact length of the flight.boolean
Returns whether the arrival time has been adjusted for DST changes between the effective date of this Schedule Entry and the current date.boolean
Returns the "historic flight" flag value for this flight.final int
getID()
Returns the database ID of the schedule entry.final int
Returns 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.int
hashCode()
static boolean
isVariable
(Flight f) Helper method to determine if flight is using a variable equipment type.void
setAcademy
(boolean academy) Updates this Schedule entry's "Flight Academy flight" flag.void
setCodeShare
(String flightCode) If this is a codeshare flight, the flight code of the operator's flight.void
setHistoric
(boolean historic) Updates this Schedule entry's "historic flight" flag.final void
setID
(int id) Sets the database ID of this schedule entry.void
setLength
(int len) Sets the length of a flight leg.void
setRemarks
(String remarks) Updates any notes (usually about codehsare operator) for this flight.void
setSource
(ScheduleSource src) Updates the source of this entry.void
Sets the arrival time for this flight.void
Sets the departure time for this flight.toString()
Methods inherited from class org.deltava.beans.Flight
compareTo, equals, getAirline, getAirportA, getAirportD, getCallsign, getDistance, getEquipmentType, getFlightCode, getFlightNumber, getLeg, getLegCode, getShortCode, setAirline, setAirportA, setAirportD, setEquipmentType, setFlightNumber, setLeg
Methods inherited from class org.deltava.beans.DatabaseBean
cacheKey, getHexID, validateID, validateID
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.deltava.beans.schedule.FlightTimes
hasFlightTimes
Methods inherited from interface org.deltava.beans.schedule.RoutePair
createKey, getAirports, getFlightType, includes, isPopulated, matches
-
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:
getLength
in classFlight
- Returns:
- the length of the flight
- Throws:
IllegalStateException
- if departure or arrival times are not set- See Also:
-
getDuration
Description copied from class:Flight
A method to return the exact length of the flight.- Specified by:
getDuration
in classFlight
- Returns:
- a Duration
-
getTimeD
Description copied from interface:FlightTimes
Returns 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:
getTimeD
in interfaceFlightTimes
- Returns:
- the full departure time of the flight
- See Also:
-
getTimeA
Description copied from interface:FlightTimes
Returns 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:
getTimeA
in 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:
getID
in interfaceIDBean
- Overrides:
getID
in 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:
setID
in 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:ViewEntry
Returns the CSS class for this object if rendered in a view table.- Specified by:
getRowClassName
in interfaceViewEntry
- Returns:
- the CSS class name, or NULL if none
-
toString
-
hashCode
-