示例#1
0
文件: Book.java 项目: proegel/fachdom
 public Rental getRented() {
   for (Rental rent : rentals) {
     if (rent.isActive()) {
       return rent;
     }
   }
   return null;
 }
示例#2
0
文件: Book.java 项目: proegel/fachdom
 public boolean clearRented() {
   for (Rental rent : rentals) {
     if (rent.isActive()) {
       rent.clearRented();
       return true;
     }
   }
   return false;
 }
示例#3
0
文件: Book.java 项目: proegel/fachdom
 // Methods
 public boolean isAvailable() throws NullPointerException {
   // if ( rentals != null)
   for (Rental rent : rentals) {
     if (rent.isActive()) {
       return false;
     }
   }
   return true;
 }