Ejemplo n.º 1
0
 public Renting queryMember(String memberNum) {
   for (Renting renting : rentings) {
     if (renting.getMemberNum().equals(memberNum)) {
       return renting;
     }
   }
   return null;
 }
Ejemplo n.º 2
0
 public void collectMovie(String title, String format, String memberNum) {
   for (int i = 0; i < rentings.size(); i++) {
     Renting renting = rentings.get(i);
     if (renting.getMemberNum().equals(memberNum)) {
       Copy copy = renting.getCopy();
       Movie movie = movieSystem.getMovieByCopy(copy.getId());
       if (movie.getTitle().equals(title) && copy.getFormat().equals(format)) {
         rentings.remove(i);
       }
     }
   }
 }
Ejemplo n.º 3
0
 public void makeRental(Copy copy, String memberNum) {
   Renting renting = new Renting();
   renting.setCopy(copy);
   renting.setMemberNum(memberNum);
   rentings.add(renting);
 }