Class AssignmentInfo
java.lang.Object
org.deltava.beans.DatabaseBean
org.deltava.beans.assign.AssignmentInfo
- All Implemented Interfaces:
Serializable
,Comparable<Object>
,IDBean
,ViewEntry
,Cacheable
A class to store Flight Assignments.
- Since:
- 1.0
- Version:
- 11.0
- Author:
- Luke
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAssignmentInfo
(String eqType) Creates a new Flight Assignment for a particular Equipment Type. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds an Assigned Flight to this Assignment.void
Adds a Flight Report to this Assignment.Returns the date/time this Assignment was assigned to the Pilot.Returns the individual Legs for this Assignment.Returns the date/time this Assignment was completed by the Pilot.Returns the equipment type for this assignment.int
Returns the ID of the associated Online Event.Returns the Flight Reports linked to this Assignment.int
Returns the Pilot Database ID for this Flight Assignment.Returns the CSS class for this object if rendered in a view table.Returns the status of this Assignment.boolean
Determines if all flights in this assignment are complete.boolean
Returns if this Assignment should be automatically purged on a Schedule reload.boolean
isRandom()
Returns if this Assignment was randomly generated.boolean
Returns if this Assignment should be made available again when complete.void
Removes an unflown leg from this assignment.void
setAssignDate
(Instant dt) Updates the Date this Assignment was assigned to a Pilot.void
Updates the Date this Assignment was completed.void
setEventID
(int id) Sets the associated Online Event for this Assignment.void
setPilotID
(int id) Updates the associated Pilot for this Assignment.void
setPurgeable
(boolean canPurge) Marks this Assignment as purgeable when the Schedule database is updated.void
setRandom
(boolean random) Marks this Assignment as randomly generated.void
setRepeating
(boolean repeating) Marks this Assignment as repeating (automatically regenerated when completed).void
setStatus
(AssignmentStatus status) Updates the status of this Flight Assignment.int
size()
Returns the number of flight legs in this Assignment.Methods inherited from class org.deltava.beans.DatabaseBean
cacheKey, compareTo, equals, getHexID, getID, hashCode, setID, validateID, validateID
-
Constructor Details
-
AssignmentInfo
Creates a new Flight Assignment for a particular Equipment Type.- Parameters:
eqType
- the equipment type code- Throws:
NullPointerException
- if eqType is null
-
-
Method Details
-
getAssignments
Returns the individual Legs for this Assignment.- Returns:
- a List of AssignmentInfo beans
- See Also:
-
getFlights
Returns the Flight Reports linked to this Assignment.- Returns:
- a List of FlightReport beans
- See Also:
-
getEquipmentType
Returns the equipment type for this assignment.- Returns:
- the equipment type
-
getEventID
public int getEventID()Returns the ID of the associated Online Event.- Returns:
- the Database ID of the associated Event, or zero if not linked to an event
- See Also:
-
getPilotID
public int getPilotID()Returns the Pilot Database ID for this Flight Assignment.- Returns:
- the Database ID of the Assigned Pilot, or zero if unassigned
- See Also:
-
getStatus
Returns the status of this Assignment.- Returns:
- the AssignmentStatus
- See Also:
-
getAssignDate
Returns the date/time this Assignment was assigned to the Pilot.- Returns:
- the date/time assignment was made
- See Also:
-
getCompletionDate
Returns the date/time this Assignment was completed by the Pilot.- Returns:
- the date/time assignment was completed
- See Also:
-
isComplete
public boolean isComplete()Determines if all flights in this assignment are complete.- Returns:
- TRUE if all assignment flights are complete, otherwise FALS
-
isRandom
public boolean isRandom()Returns if this Assignment was randomly generated.- Returns:
- TRUE if the assignment was randomly created, otherwise FALSE
- See Also:
-
isRepeating
public boolean isRepeating()Returns if this Assignment should be made available again when complete.- Returns:
- TRUE if the assignment is auto-repeating, otherwise FALSE
- See Also:
-
isPurgeable
public boolean isPurgeable()Returns if this Assignment should be automatically purged on a Schedule reload.- Returns:
- TRUE if the assignment should be purged, otherwise FALSE
- See Also:
-
size
public int size()Returns the number of flight legs in this Assignment.- Returns:
- the number of legs
-
addAssignment
Adds an Assigned Flight to this Assignment.- Parameters:
a
- the assigned flight
-
addFlight
Adds a Flight Report to this Assignment. This will update the Pilot ID for this Assignment if not set.- Parameters:
fr
- the flight report
-
setEventID
public void setEventID(int id) Sets the associated Online Event for this Assignment.- Parameters:
id
- the Event Database ID- Throws:
IllegalArgumentException
- if id is negative
-
setPilotID
public void setPilotID(int id) Updates the associated Pilot for this Assignment.- Parameters:
id
- the Pilot Database ID- Throws:
IllegalArgumentException
- if id is negative- See Also:
-
setStatus
Updates the status of this Flight Assignment.- Parameters:
status
- the AssignmentStatus- See Also:
-
setRandom
public void setRandom(boolean random) Marks this Assignment as randomly generated.- Parameters:
random
- TRUE if generated from Find a Flight, otherwise FALSE- See Also:
-
setRepeating
public void setRepeating(boolean repeating) Marks this Assignment as repeating (automatically regenerated when completed).- Parameters:
repeating
- TRUE if automatically repeating, otherwise FALSE- See Also:
-
setPurgeable
public void setPurgeable(boolean canPurge) Marks this Assignment as purgeable when the Schedule database is updated.- Parameters:
canPurge
- TRUE if the Assignment should be purged on a Schedule update.- See Also:
-
setAssignDate
Updates the Date this Assignment was assigned to a Pilot.- Parameters:
dt
- the date/time this Assignment was assigned- See Also:
-
setCompletionDate
Updates the Date this Assignment was completed.- Parameters:
dt
- the date/time this Assignment was completed- See Also:
-
remove
Removes an unflown leg from this assignment.- Parameters:
rp
- the RoutePair to remove
-
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
-