Class NewReservation

java.lang.Object
  |
  +--NewReservation

public class NewReservation
extends java.lang.Object

This class models a hotel reesrvation system

Version:
1.0.0
Author:
Terence (adopted from Reservation)

Field Summary
static java.lang.String[] occupancy
          occupancy is an array that indicates the occupant of each room.
 
Constructor Summary
NewReservation()
          Creates a list of rooms and make them available (by setting them to null).
 
Method Summary
 boolean cancel(java.lang.String customer)
          checks out a customer and marks the room as empty
 boolean reserve(java.lang.String customer)
          Adds a new customer to the hotel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

occupancy

public static java.lang.String[] occupancy
occupancy is an array that indicates the occupant of each room. If there are no occupants, it is marked null

Constructor Detail

NewReservation

public NewReservation()
Creates a list of rooms and make them available (by setting them to null).

Method Detail

reserve

public boolean reserve(java.lang.String customer)
Adds a new customer to the hotel.

Parameters:
customer - is the name of the customer to be added.
Returns:
true if the hotel is not full and reservatoin was made successfully, false otherwise.

cancel

public boolean cancel(java.lang.String customer)
checks out a customer and marks the room as empty

Parameters:
customer - is the name of the customer checking out
Returns:
true if customer had a prior reservation so cancellation possible, false otherwise.