Пример #1
0
  /**
   * @param args
   * @roseuid 418A8CAA02AF
   */
  public static void main(String[] args) {
    teaFlavorFactory = new TeaFlavorFactory();

    takeOrders("chai", 2);
    takeOrders("chai", 2);
    takeOrders("camomile", 1);
    takeOrders("camomile", 1);
    takeOrders("earl grey", 1);
    takeOrders("camomile", 897);
    takeOrders("chai", 97);
    takeOrders("chai", 97);
    takeOrders("camomile", 3);
    takeOrders("earl grey", 3);
    takeOrders("chai", 3);
    takeOrders("earl grey", 96);
    takeOrders("camomile", 552);
    takeOrders("chai", 121);
    takeOrders("earl grey", 121);

    for (int i = 0; i < ordersMade; i++) {
      flavors[i].serveTea(tables[i]);
    }
    System.out.println(" ");
    System.out.println(
        "total teaFlavor objects made: " + teaFlavorFactory.getTotalTeaFlavorsMade());
  }
Пример #2
0
 /**
  * @param flavorIn
  * @param table
  * @roseuid 418A8CAA0128
  */
 static void takeOrders(String flavorIn, int table) {
   flavors[ordersMade] = teaFlavorFactory.getTeaFlavor(flavorIn);
   tables[ordersMade++] = new TeaOrderContext(table);
 }