reservation.system.functions
Class Lists

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

public class Lists
extends Functions

This class hold Lists structure. This object allows to see the person who are registered in one flight by calling the method list 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
Lists()
           
 
Method Summary
(package private)  void _check(java.lang.String[] arg)
          Verify that at least one flight is created and also one reservation has been made.
 java.lang.String execute()
          Display the list of the persons who are registered in one flight if the command list and their arguments are correct.
static java.lang.String usage()
          Display the usage for the command list.
 
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

Lists

public Lists()
Method Detail

execute

public java.lang.String execute()
                         throws java.lang.Exception
Display the list of the persons who are registered in one flight if the command list and their arguments are correct.

Specified by:
execute in class Functions
Returns:
the names of the persons, their positions in the flight, and their bookingNumber.
Throws:
java.lang.Exception - the command is not executed.

_check

void _check(java.lang.String[] arg)
      throws java.lang.Exception
Verify that at least one flight is created and also one reservation has been made. 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 list.

Returns:
the usage.