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