org.deltava.beans.assign
Class AssignmentInfo

java.lang.Object
  extended by org.deltava.beans.DatabaseBean
      extended by org.deltava.beans.assign.AssignmentInfo
All Implemented Interfaces:
Serializable, Comparable<Object>, ViewEntry, Cacheable

public class AssignmentInfo
extends DatabaseBean
implements ViewEntry

A class to store Flight Assignments.

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

Field Summary
static int AVAILABLE
           
static int COMPLETE
           
static int RESERVED
           
static String[] STATUS
          Assignment status names.
 
Constructor Summary
AssignmentInfo(String eqType)
          Creates a new Flight Assignment for a particular Equipment Type.
 
Method Summary
 void addAssignment(AssignmentLeg a)
          Adds an Assigned Flight to this Assignment.
 void addFlight(FlightReport fr)
          Adds a Flight Report to this Assignment.
 Date getAssignDate()
          Returns the date/time this Assignment was assigned to the Pilot.
 Collection<AssignmentLeg> getAssignments()
          Returns the individual Legs for this Assignment.
 Date getCompletionDate()
          Returns the date/time this Assignment was completed by the Pilot.
 String getEquipmentType()
          Returns the equipment type for this assignment.
 int getEventID()
          Returns the ID of the associated Online Event.
 Collection<FlightReport> getFlights()
          Returns the Flight Reports linked to this Assignment.
 int getPilotID()
          Returns the Pilot Database ID for this Flight Assignment.
 String getRowClassName()
          Returns the CSS class name for this assignment when displayed in a view.
 int getStatus()
          Returns the status of this Assignment.
 boolean isComplete()
          Determines if all flights in this assignment are complete.
 boolean isPurgeable()
          Returns if this Assignment should be automatically purged on a Schedule reload.
 boolean isRandom()
          Returns if this Assignment was randomly generated.
 boolean isRepeating()
          Returns if this Assignment should be made available again when complete.
 void setAssignDate(Date dt)
          Updates the Date this Assignment was assigned to a Pilot.
 void setCompletionDate(Date dt)
          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 setPilotID(Person p)
          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(int status)
          Updates the status of this Flight Assignment.
 void setStatus(String status)
          Updates the status of this Flight Assignment.
 
Methods inherited from class org.deltava.beans.DatabaseBean
cacheKey, compareTo, equals, getHexID, getID, hashCode, setID, validateID
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AVAILABLE

public static final int AVAILABLE
See Also:
Constant Field Values

RESERVED

public static final int RESERVED
See Also:
Constant Field Values

COMPLETE

public static final int COMPLETE
See Also:
Constant Field Values

STATUS

public static final String[] STATUS
Assignment status names.

Constructor Detail

AssignmentInfo

public AssignmentInfo(String eqType)
Creates a new Flight Assignment for a particular Equipment Type.

Parameters:
eqType - the equipment type code
Throws:
NullPointerException - if eqType is null
Method Detail

getAssignments

public Collection<AssignmentLeg> getAssignments()
Returns the individual Legs for this Assignment.

Returns:
a List of AssignmentInfo beans
See Also:
addAssignment(AssignmentLeg)

getFlights

public Collection<FlightReport> getFlights()
Returns the Flight Reports linked to this Assignment.

Returns:
a List of FlightReport beans
See Also:
addFlight(FlightReport)

getEquipmentType

public String 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:
setEventID(int)

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:
setPilotID(int), setPilotID(Person)

getStatus

public int getStatus()
Returns the status of this Assignment.

Returns:
the status code
See Also:
setStatus(int), setStatus(String)

getAssignDate

public Date getAssignDate()
Returns the date/time this Assignment was assigned to the Pilot.

Returns:
the date/time assignment was made
See Also:
setAssignDate(Date)

getCompletionDate

public Date getCompletionDate()
Returns the date/time this Assignment was completed by the Pilot.

Returns:
the date/time assignment was completed
See Also:
setCompletionDate(Date)

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

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

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

addAssignment

public void addAssignment(AssignmentLeg a)
Adds an Assigned Flight to this Assignment.

Parameters:
a - the assigned flight

addFlight

public void addFlight(FlightReport fr)
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(Person p)
Updates the associated Pilot for this Assignment.

Parameters:
p - the Pilot bean
See Also:
setPilotID(int), getPilotID()

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:
setPilotID(Person), getPilotID()

setStatus

public void setStatus(int status)
Updates the status of this Flight Assignment.

Parameters:
status - the status code
Throws:
IllegalArgumentException - if an invalid or negative status code
See Also:
setStatus(String), getStatus()

setStatus

public void setStatus(String status)
Updates the status of this Flight Assignment.

Parameters:
status - the status type name
Throws:
IllegalArgumentException - if an invalid type name
See Also:
setStatus(int), getStatus()

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

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

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

setAssignDate

public void setAssignDate(Date dt)
Updates the Date this Assignment was assigned to a Pilot.

Parameters:
dt - the date/time this Assignment was assigned
See Also:
getAssignDate()

setCompletionDate

public void setCompletionDate(Date dt)
Updates the Date this Assignment was completed.

Parameters:
dt - the date/time this Assignment was completed
See Also:
getCompletionDate()

getRowClassName

public String getRowClassName()
Returns the CSS class name for this assignment when displayed in a view.

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


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