org.deltava.beans.schedule
Class ScheduleEntry

java.lang.Object
  extended by org.deltava.beans.DatabaseBean
      extended by org.deltava.beans.Flight
          extended by org.deltava.beans.schedule.ScheduleEntry
All Implemented Interfaces:
Serializable, Comparable<Object>, RoutePair, ViewEntry, Cacheable
Direct Known Subclasses:
DailyScheduleEntry, ScheduleSearchEntry

public class ScheduleEntry
extends Flight
implements ViewEntry

A class to store Schedule Entry information.

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

Constructor Summary
ScheduleEntry(Airline a, int fNumber, int leg)
          Creates a new Schedule Entry object with a given flight.
 
Method Summary
 boolean getAcademy()
          Returns if this flight is part of the Flight Academy.
 boolean getCanPurge()
          Returns if this flight can be purged from the schedule database before an automated import.
 DateTime getDateTimeA()
          Returns the arrival time of the flight, with full timezone information.
 DateTime getDateTimeD()
          Returns the departure time of the flight, with full timezone information.
 boolean getHistoric()
          Returns the "historic flight" flag value for this flight.
 int getID()
          Returns the database ID of the schedule entry.
 int getLength()
          Returns the length of the flight, in hours multiplied by 10.
 String getRowClassName()
          Returns the row CSS class name if displayed in a view table.
 Date getTimeA()
          Returns the arrival time for this flght.
 Date getTimeD()
          Returns the departure time for this flght.
 int hashCode()
          Returns the hash code of the flight code.
 void setAcademy(boolean academy)
          Updates this Schedule entry's "Flight Academy flight" flag.
 void setCanPurge(boolean purge)
          Updates this Schedule entry's "no purge" flag.
 void setHistoric(boolean historic)
          Updates this Schedule entry's "historic flight" flag.
 void setID(int id)
          Sets the database ID of this schedule entry.
 void setLength(int len)
          Sets the length of a flight leg.
 void setTimeA(Date dt)
          Sets the arrival time for this flight.
 void setTimeD(Date dt)
          Sets the departure time for this flight.
 
Methods inherited from class org.deltava.beans.Flight
compareTo, crosses, equals, getAirline, getAirportA, getAirportD, getDistance, getEquipmentType, getFlightCode, getFlightNumber, getLeg, setAirline, setAirportA, setAirportD, setEquipmentType, setFlightNumber, setLeg, toString
 
Methods inherited from class org.deltava.beans.DatabaseBean
cacheKey, getHexID, validateID
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ScheduleEntry

public ScheduleEntry(Airline a,
                     int fNumber,
                     int leg)
Creates a new Schedule Entry object with a given flight.

Parameters:
a - the Airline
fNumber - the Flight Number
leg - the Leg Number
Throws:
NullPointerException - if the Airline Code is null
IllegalArgumentException - if the Flight Report is zero or negative
IllegalArgumentException - if the Leg is less than 1 or greater than 5
See Also:
Flight.setAirline(Airline), Flight.setFlightNumber(int), Flight.setLeg(int)
Method Detail

getLength

public final int getLength()
Returns the length of the flight, in hours multiplied by 10.

Specified by:
getLength in class Flight
Returns:
the length of the flight
Throws:
IllegalStateException - if departure or arrival times are not set
See Also:
DateTime.difference(DateTime)

getDateTimeD

public DateTime getDateTimeD()
Returns the departure time of the flight, with full timezone information. The date component of this value can be ignored.

Returns:
the full departure time of the flight
See Also:
getDateTimeA()

getDateTimeA

public DateTime getDateTimeA()
Returns the arrival time of the flight, with full timezone information. The date component of this value can be ignored.

Returns:
the full arrival time of the flight
See Also:
getDateTimeD()

getTimeD

public Date getTimeD()
Returns the departure time for this flght. This time is in local time. The date and timezone portions of this Date should be ignored.

Returns:
the departure time for this flight.
See Also:
setTimeD(Date), getTimeA(), getDateTimeD()

getTimeA

public Date getTimeA()
Returns the arrival time for this flght. This time is in local time. The date and timezone portions of this Date should be ignored.

Returns:
the arrival time for this flight.
See Also:
setTimeA(Date), getTimeD(), getDateTimeA()

getID

public final int getID()
Returns the database ID of the schedule entry. NOT IMPLEMENTED

Overrides:
getID in class DatabaseBean
Returns:
The primary key of the entry in the table in the database that corresponds to this object
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:
setHistoric(boolean)

getCanPurge

public boolean getCanPurge()
Returns if this flight can be purged from the schedule database before an automated import.

Returns:
TRUE if the flight can be automatically purged from the database, otherwise FALSE
See Also:
setCanPurge(boolean)

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:
setAcademy(boolean)

setID

public final void setID(int id)
Sets the database ID of this schedule entry. NOT IMPLEMENTED

Overrides:
setID in class DatabaseBean
Parameters:
id - The primary key of the entry in the database that corresponds to this object.
Throws:
UnsupportedOperationException - always
See Also:
DatabaseBean.validateID(int, int)

setTimeD

public void setTimeD(Date dt)
Sets the departure time for this flight.

Parameters:
dt - the departure time of the flight in local time . The date and time zone are ignored.
Throws:
NullPointerException - if the departure airport is not set
See Also:
setTimeA(Date), getTimeD(), getDateTimeD()

setTimeA

public void setTimeA(Date dt)
Sets the arrival time for this flight.

Parameters:
dt - the arrival time of the flight in local time . The date and time zone are ignored.
Throws:
NullPointerException - if the arrival airport is not set
See Also:
setTimeD(Date), getTimeA(), getDateTimeA()

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.
Throws:
IllegalArgumentException - if len is negative
See Also:
getLength()

setHistoric

public void setHistoric(boolean historic)
Updates this Schedule entry's "historic flight" flag.

Parameters:
historic - the new "historic flight" flag value
See Also:
getHistoric(), getCanPurge()

setCanPurge

public void setCanPurge(boolean purge)
Updates this Schedule entry's "no purge" flag. This typically is set on historic flights.

Parameters:
purge - the new "no purge" flag value
See Also:
getCanPurge(), getHistoric()

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:
getAcademy()

getRowClassName

public String getRowClassName()
Returns the row CSS class name if displayed in a view table.

Specified by:
getRowClassName in interface ViewEntry
Returns:
the CSS class name

hashCode

public int hashCode()
Returns the hash code of the flight code.

Overrides:
hashCode in class DatabaseBean


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