reservation.system.functions
Class Reserve

java.lang.Object
  extended byreservation.system.functions.Functions
      extended byreservation.system.functions.Reserve
All Implemented Interfaces:
Action

public class Reserve
extends Functions

This class hold Reserve structure. This object allows to reserve to one flight one or many persons by calling the method reserve in FlightSystem.

Author:
Texier Mathieu and Frederic Bidon

Field Summary
 
Fields inherited from class reservation.system.functions.Functions
arg
 
Fields inherited from interface reservation.Action
fs, NUMBER_ARGUMENT_MAX
 
Constructor Summary
Reserve()
           
 
Method Summary
(package private)  void _check(java.lang.String[] arg)
          Verify that at least one flight is created.
 java.lang.String execute()
          Reserve several one or many person in one flight if the command reservation and their arguments are correct.
static java.lang.String usage()
          Display the usage for the command reserve.
 
Methods inherited from class reservation.system.functions.Functions
ArgumentIsValid, CheckBookingListNotEmpty, CheckFlightListNotEmpty, checkInteger, execute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Reserve

public Reserve()
Method Detail

execute

public java.lang.String execute()
                         throws java.lang.Exception
Reserve several one or many person in one flight if the command reservation and their arguments are correct.

Specified by:
execute in class Functions
Returns:
a confimation's message if the person(s) are registered.
Throws:
java.lang.Exception - if a person name is duplicated or if the person are not registered.

_check

void _check(java.lang.String[] arg)
      throws java.lang.Exception
Verify that at least one flight is created. Verify invariants :
 - Arguments not null
 

Specified by:
_check in class Functions
Throws:
java.lang.Exception - if the invariants is violated

usage

public static java.lang.String usage()
Display the usage for the command reserve.

Returns:
the usage.