-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathQueueTest.java
More file actions
47 lines (30 loc) · 1.01 KB
/
QueueTest.java
File metadata and controls
47 lines (30 loc) · 1.01 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
import java.io.File;
import java.io.FileNotFoundException;
public class QueueTest {
public static void main(String[] args) throws FileNotFoundException {
File customers = new File("CustomersData.txt");
File queries = new File("QueriesContent.txt");
//one queue for all customers in a day
CustomerList today = new CustomerList();
today.createList(customers);
//getting queries
today.getQueries(queries);
//one queue to model customers in the store at any given time.
CustomerList store = new CustomerList();
while (!today.isEmpty()) {
System.out.println("Before");
System.out.println("Today:");
today.displayCustomers();
System.out.println("Store");
store.displayCustomers();
CustomerNode current = today.dequeue();
store.enqueue(current);
System.out.println("After");
System.out.println("Today:");
today.displayCustomers();
System.out.println("Store");
store.displayCustomers();
}
// TODO Auto-generated method stub
}
}