-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestCRecord.java
55 lines (55 loc) · 2.06 KB
/
TestCRecord.java
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
public class TestCRecord{
public static void main(String[] args){
CRecord a = new CRecord();
Customer aNode = new Customer("Jane", 1, "jane@gmail.com");
Customer bNode = new Customer("Joe", 2, "joe@gmail.com");
Customer cNode = new Customer("Jack", 3, "jack@gmail.com");
Customer dNode = new Customer("Jill", 4, "jill@gmail.com");
Customer eNode = new Customer("Abe", 5, "abe@gmail.com");
Customer fNode = new Customer("Beth", 6, "beth@gmial.com");
Customer gNode = new Customer("Chuck", 7, "chcuk@gmailcom");
Customer hNode = new Customer("Dot", 8, "dot @gmail.com");
Customer iNode = new Customer("Mike", 9, "mike@gmail.com");
Customer jNode = new Customer("Nick", 10, "nick@gmail.com");
Customer kNode = new Customer("Otis", 101, "oits@gmailcom");
Customer lNode = new Customer("James", 201, "james@gmail.com");
Customer mNode = new Customer("Oscar", 301, "oscar@gmail.com");
Customer nNode = new Customer("Oswald", 401, "oswald@gmail.com");
System.out.println("isEmptyHash = " + a.isEmptyRecord());
System.out.println();
a.insert(aNode);
a.insert(bNode);
a.insert(cNode);
System.out.println("Print Hash");
a.printRecord();
System.out.println();
a.insert(kNode);
a.insert(lNode);
a.insert(mNode);
a.insert(nNode);
System.out.println("Print Hash");
a.printRecord();
System.out.println();
System.out.println("Remove 21");
System.out.println(a.remove(201).getEmail() + " has been removed");
System.out.println();
System.out.println("Remove 1");
System.out.println(a.remove(1).getEmail() + " has been removed");
System.out.println();
System.out.println("Remove 41");
System.out.println(a.remove(401).getName() + " has been removed");
System.out.println();
System.out.println("Remove 5");
if(a.search(5) == null){
System.out.println("5 does not exist");
}else{
System.out.println(a.remove(5).getName() + " has been removed");
}
System.out.println();
System.out.println("Print Hash");
a.printRecord();
System.out.println();
System.out.println("isEmptyHash = " + a.isEmptyRecord());
System.out.println();
}
}