FileDocCategorySizeDatePackage
CommandLineView.javaAPI DocExample599Fri Apr 22 11:04:44 BST 2005com.springbook

CommandLineView.java

package com.springbook;

import com.springbook.Bike;

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());
      }
   }
}