Esempio n. 1
0
 public Rental getRented() {
   for (Rental rent : rentals) {
     if (rent.isActive()) {
       return rent;
     }
   }
   return null;
 }
Esempio n. 2
0
 public boolean clearRented() {
   for (Rental rent : rentals) {
     if (rent.isActive()) {
       rent.clearRented();
       return true;
     }
   }
   return false;
 }
Esempio n. 3
0
 // Methods
 public boolean isAvailable() throws NullPointerException {
   // if ( rentals != null)
   for (Rental rent : rentals) {
     if (rent.isActive()) {
       return false;
     }
   }
   return true;
 }