public class MenuItem extends MenuComponent
Modifier and Type | Field and Description |
---|---|
(package private) java.lang.String |
description |
(package private) java.lang.String |
name |
(package private) double |
price |
(package private) boolean |
vegetarian |
Constructor and Description |
---|
MenuItem(java.lang.String name,
java.lang.String description,
boolean vegetarian,
double price) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDescription() |
java.lang.String |
getName() |
double |
getPrice() |
boolean |
isVegetarian() |
void |
print() |
add, getChild, remove
java.lang.String name
java.lang.String description
boolean vegetarian
double price
public MenuItem(java.lang.String name, java.lang.String description, boolean vegetarian, double price)
public java.lang.String getName()
getName
in class MenuComponent
public java.lang.String getDescription()
getDescription
in class MenuComponent
public double getPrice()
getPrice
in class MenuComponent
public boolean isVegetarian()
isVegetarian
in class MenuComponent
public void print()
print
in class MenuComponent