|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectreservation.system.FlightSystem
The class hold the structure to access in the database. This object allows to modify the database with the different command available. It contains all the method executing all the command written by the user.
Method Summary | |
boolean |
cancel(int bookingNumber)
Method which allows to cancel a group of persons which have the same bookingNumber. |
boolean |
cancel(int bookingNumber,
java.util.Set personNames)
Method which allows to cancel one or more personName that have reserved. |
boolean |
create(Flight flight)
Assert a new flight into the FlightList |
boolean |
create(java.lang.String flightName,
short rows,
short rowLength)
Method which allows to add a new flight in a database. |
java.lang.Integer[] |
getBookingList()
Method which allows to return the list of the atribuated bookingNumber. |
int |
getBookingNumberMax()
Accessor for the bookingNumberMax |
java.lang.String[] |
getFlightList()
Method which allows to return the flights contained in the flights' list. |
static FlightSystem |
getInstance()
Constructor of the class FlightSystem. |
java.util.Vector |
identify(int bookingNumber)
Method which allows to see the personName which have the same bookingNumber. |
java.util.Vector |
list(java.lang.String flightName)
Method which allows to see the personName present in a same flight. |
int |
reserve(Person person)
Method which allows to add one person to a database. |
int |
reserve(java.lang.String flightName,
java.util.Set personNames)
Method which allows to add one or more persons in a database. |
java.util.Vector |
search(Profile profile)
Method which allows to search a person in the person's list. |
Flight |
selectFlight(java.lang.String flightName)
Method which allows to select a flight in the flight's list according to the flightName. |
java.lang.String |
toString()
Returns a string representation of this FlightSystem object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
public static final FlightSystem getInstance()
public final boolean create(java.lang.String flightName, short rows, short rowLength) throws java.lang.Exception
flightName
- The name of the flightrows
- the number of rowsrowLength
- the length of each rows
java.lang.Exception
- if the flight already exists.public final boolean create(Flight flight) throws java.lang.Exception
flight
- The Flight that will be asserted
java.lang.Exception
- if the flight doesn't exist.public final int reserve(java.lang.String flightName, java.util.Set personNames) throws java.lang.Exception
flightName
- The name of the flightpersonNames
- A list of person
java.lang.Exception
- if the flight doen't exist or if the command contains no personName.public final int reserve(Person person) throws java.lang.Exception
person
- assert a Person Object
java.lang.Exception
- if the flight doen't exist or if the command contains no personName.public final boolean cancel(int bookingNumber, java.util.Set personNames) throws java.lang.Exception
bookingNumber
- the booking number with which the person have bookedpersonNames
- The name of the person that wnat to cancel
java.lang.Exception
- if one or more name are invalid.public final boolean cancel(int bookingNumber) throws java.lang.Exception
bookingNumber
- The booking number to be canceled
java.lang.Exception
- if the bookingNumber doesn't exist.public final java.util.Vector identify(int bookingNumber) throws java.lang.Exception
bookingNumber
- the booking number to be identify
java.lang.Exception
- if the bookingNumber doesn't exist.public final java.util.Vector list(java.lang.String flightName) throws java.lang.Exception
flightName
- the name of the flight
java.lang.Exception
- if the flightName doesn't exist.public final java.lang.String toString()
FlightSystem
object. This method
is intended to be used only for debugging purposes, and the content and format
of the returned string may vary between implementations. The returned string may
be empty but may not be null
FlightSystem
object.public final java.util.Vector search(Profile profile) throws java.lang.Exception
profile
- The person that will match this profile will be returned
java.lang.Exception
- if the invariants is violatedpublic final Flight selectFlight(java.lang.String flightName) throws java.lang.Exception
flightName
- the name of the flight
java.lang.Exception
- if the flightName doesn't exist.public final int getBookingNumberMax()
public final java.lang.String[] getFlightList() throws java.lang.Exception
java.lang.Exception
- if the invariants are violated.public final java.lang.Integer[] getBookingList() throws java.lang.Exception
java.lang.Exception
- if the invariants is violated.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |