-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathWaitlistList.java
More file actions
63 lines (50 loc) · 1.47 KB
/
WaitlistList.java
File metadata and controls
63 lines (50 loc) · 1.47 KB
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
60
61
62
63
package com.company;
import java.util.*;
public class WaitlistList {
private static WaitlistList waitlistList;
public LinkedList<WaitList> waitListFull = new LinkedList<WaitList>();
public static WaitlistList instance() {
if (waitlistList == null) {
return (waitlistList = new WaitlistList());
}
else {
return waitlistList;
}
}
public Iterator <WaitList> getWaitList()
{
return waitListFull.iterator();
}
public void PrintWaitList()
{
for (int i = 0; i < waitListFull.size(); i++)
{
System.out.println(waitListFull.get(i));
}
}
public void PrintWaitList(Client client)
{
for (int i = 0; i < waitListFull.size(); i++)
{
WaitList temp = waitListFull.get(i);
if (client == temp.getClient())
System.out.println(waitListFull.get(i));
}
}
public void AddWaitList(Client client, Product product, int quantity)
{
WaitList temp = new WaitList(client,product,quantity);
waitListFull.add(temp);
}
public void DisplayWaitList()
{
System.out.println("In progress");
// for (int i = 0; i < waitListFull.size(); )
}
public WaitList get_listed_obj (int position) {
return waitListFull.get(position);
}
public void set_listed_obj (int position, WaitList update) {
waitListFull.set(position, update);
}
}