reservation.system.functions
Class Create

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

public class Create
extends Functions

This class hold Create structure. This object allows to create a new flight in the data base by calling the method create 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
Create()
           
 
Method Summary
(package private)  void _check(java.lang.String[] arg)
          Verify invariants : - Arguments not null - rows belongs to [1 Flight.ROWS_MAX] - rowsLength belongs to [1 Flight.ROW_LENGTH_MAX]
 java.lang.String execute()
          Create a new flight in a database if the command create and their arguments are correct.
static java.lang.String usage()
          Display the usage for the command create.
 
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

Create

public Create()
Method Detail

execute

public java.lang.String execute()
                         throws java.lang.Exception
Create a new flight in a database if the command create and their arguments are correct.

Specified by:
execute in class Functions
Returns:
a confimation's message if the flight is created.
Throws:
java.lang.Exception - if the flight is not created.

_check

void _check(java.lang.String[] arg)
      throws java.lang.Exception
Verify invariants :
 - Arguments not null
 - rows belongs to [1 Flight.ROWS_MAX]
 - rowsLength belongs to [1 Flight.ROW_LENGTH_MAX]
 

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 create.

Returns:
the usage.