Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
44 lines (31 sloc) 861 Bytes
import edu.ucdavis.jr.*;
import java.util.*;
public class Beverage {
private final String name;
private final int drinkingTime;
private final BeverageWare bw;
private final ArrayList<Item> ingredients;
@Override
public String toString()
{
return name;
}
public Beverage(String name, int drinkingTime, BeverageWare bw, List<Item> ingredients) {
this.name = name;
this.drinkingTime = drinkingTime;
this.bw = bw;
this.ingredients = new ArrayList(ingredients);
}
public int getDrinkingTime() {
return drinkingTime;
}
public BeverageWare getBeverageWare() {
return bw;
}
// We make it a shallow copy so nobody can edit the ingredients
public List<Item> getIngredients() {
return new ArrayList<Item>(ingredients);
}
public static void main(String[] args) {
}
}