예제 #1
0
 /**
  * Puts a guest into a certain room. Checks whether or not the room is available, and if the guest
  * already has a room or not
  *
  * @return a boolean whether or not the checking was successful
  */
 public boolean checkin(Room r) {
   if (room == null && r.getGuest() == null) {
     r.setGuest(this);
     room = r;
     return true;
   } else {
     return false;
   }
 }
예제 #2
0
 /**
  * Puts a <code>Guest</code> out of a room
  *
  * @return a boolean whether the checkout was successful or not
  */
 public boolean checkout() {
   if (room == null) {
     return false;
   } else {
     room.setGuest(null);
     room = null;
     return true;
   }
 }
예제 #3
0
 public boolean checkout() {
   if (this.getRoom() != null) {
     room.setGuest(null);
     room = null;
     return true;
   } else {
     return false;
   }
 }