/* FoodItem.java        Authors: Koffman & Wolz
 * Class for storing a food description, calorie amount, and checkbox.
 * Uses Swing.
 */
import javax.swing.*;

public class FoodItem {
  private String description;
  private int calorieAmount;
  private JCheckBox box;

  // Creates a new FoodItem item whose check box has text desc
  FoodItem(String desc, int cal) {
    description = desc;
    calorieAmount = cal;
    box = new JCheckBox(desc);
  }

  public JCheckBox getBox() {
    return box;
  }

  public int getCalories() {
    return calorieAmount;
  }

  public String getDescription() {
    return description;
  }

  public String toString() {
    return description + ", calories " + calorieAmount + 
           ", selected: " + box.isSelected();
  }

}
