-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMenu.java
More file actions
59 lines (53 loc) · 844 Bytes
/
Menu.java
File metadata and controls
59 lines (53 loc) · 844 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import java.util.ArrayList;
class Menu
{
public ArrayList <Item> a=null;
public Menu()
{
a=new ArrayList<Item>();
}
public void addItemToMenu(Item i)
{
a.add(i);
}
public Item getItem(String name){
for(Item i: a)
{
ArrayList<String> iname=i.getNames();
for(String s: iname)
{
if(s.equals(name))
{
return i;
}
}
}
return null;
}
public boolean searchItem(String name)
{
for(Item i: a)
{
ArrayList<String> iname=i.getNames();
for(String s: iname)
{
if(s.equals(name))
{
return true;
}
}
}
return false;
}
/*public void getItemList()
{
CSVReader c=new CSVReader();
a=new ArrayList <Item>();
a=c.readArray();
for(Item i: a)
{
System.out.println("food"+i.getName());
System.out.println("food"+i.getPrice());
}
}*/
}