FileDocCategorySizeDatePackage
CommandLineView.javaAPI DocExample546Fri Apr 22 10:58:44 BST 2005None

CommandLineView.java

import java.util.Iterator;


public class CommandLineView {
   private RentABike rentaBike;
   public CommandLineView() {}

   public void setRentABike(RentABike rentaBike) {
      this.rentaBike = rentaBike;
   }

   public RentABike getRentaBike() { return this.rentaBike; }

   public void printAllBikes() {
      System.out.println(rentaBike.toString());
      Iterator iter = rentaBike.getBikes().iterator();
      while(iter.hasNext()) {
         Bike bike = (Bike)iter.next();
         System.out.println(bike.toString());
      }
   }
}