/** * 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; } }
/** * 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; } }
public boolean checkout() { if (this.getRoom() != null) { room.setGuest(null); room = null; return true; } else { return false; } }