Class Room

java.lang.Object
  extended by Room

public class Room
extends Object

Describes room objects in a hotel.

Version:
30 August 2008
Author:
Jessica Sugay

Constructor Summary
Room(int rmNo, double dRate)
          Constructor for Room objects.
 
Method Summary
 void changeRate(double newRate)
          Changes the rate of the room.
 String getOccupant()
          Returns the occupant of the room.
 double getRate()
          Returns the daily rate of the room.
 int getRoomNumber()
          Returns the number of the room.
 void occupy(String name, int dayIn)
          Causes a room to be occupied.
 int vacate(int dayCheckedOut)
          Causes a room to be vacated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Room

public Room(int rmNo,
            double dRate)
Constructor for Room objects.

Parameters:
rmNo - room number to identify the room
dRate - daily rate for this room
Method Detail

changeRate

public void changeRate(double newRate)
Changes the rate of the room.

Parameters:
newRate - new room rate

getOccupant

public String getOccupant()
Returns the occupant of the room.

Returns:
occupant name

getRate

public double getRate()
Returns the daily rate of the room.

Returns:
daily rate

getRoomNumber

public int getRoomNumber()
Returns the number of the room.

Returns:
room number

occupy

public void occupy(String name,
                   int dayIn)
Causes a room to be occupied.

Parameters:
name - name of the occupant
dayIn - day the room was occupied

vacate

public int vacate(int dayCheckedOut)
Causes a room to be vacated.

Parameters:
dayChecked - day the room was vacated (should be later than check in date)
Returns:
number of days the room was occupied (return 0 if check out date not later than check date)