Package com.clowtown.mealplanner.datamodel.menuitem

Examples of com.clowtown.mealplanner.datamodel.menuitem.MenuItemListWrapper


            m.removeRow(i);
          }
          MenuMethod.reset();
          Date date = new Date();
          while(MenuMethod.dishesSelected < 5){
            MenuItemListWrapper dish = MenuMethod.getNextDish(date);
            m.addRow(dish.getArray());
          }
        }
      });
    }
    return generateButton;
View Full Code Here


  public static int dishesSelected = 0;
  private static ArrayList<MenuItemListWrapper> dishes = new ArrayList<MenuItemListWrapper>();
  private static Random r = new Random(System.currentTimeMillis());
 
  public static MenuItemListWrapper getNextDish(Date menuEndDate){
    MenuItemListWrapper newDish = randomDish(menuEndDate);
    dishes.add(newDish);
    dishesSelected++;
    if(newDish.isAllowLeftovers()){
      dishesSelected++;
    }
    return newDish;
  }
View Full Code Here

    for(int i=0;i<list.size();i++){
      dishesTried.put(new Integer(i), list.get(i).isInUse());
    }
    while(dishesTried.values().contains(new Boolean(false))){     
      int index = r.nextInt(list.size());
      MenuItemListWrapper d = new MenuItemListWrapper(index);
      if(!d.isInUse() && d.isAvailable(menuEndDate)){
        d.setInUse(true);
        return d;
      }
      dishesTried.put(new Integer(index), true);
     
     
    }
    return new MenuItemListWrapper(r.nextInt(list.size()));
  }
View Full Code Here

TOP

Related Classes of com.clowtown.mealplanner.datamodel.menuitem.MenuItemListWrapper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.