-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainTestArrayStorage.java
More file actions
37 lines (28 loc) · 1.01 KB
/
Copy pathMainTestArrayStorage.java
File metadata and controls
37 lines (28 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
import model.Resume;
import storage.ArrayStorage;
public class MainTestArrayStorage {
static final ArrayStorage ARRAY_STORAGE = new ArrayStorage();
public static void main(String[] args) throws Exception{
Resume r1 = new Resume("Name1");
Resume r2 = new Resume("Name2");
Resume r3 = new Resume("Name3");
ARRAY_STORAGE.save(r1);
ARRAY_STORAGE.save(r2);
ARRAY_STORAGE.save(r3);
System.out.println("Get r1: " + ARRAY_STORAGE.get(r1.getUuid()));
System.out.println("Size: " + ARRAY_STORAGE.size());
//System.out.println("Get dummy: " + ARRAY_STORAGE.get("dummy"));
printAll();
ARRAY_STORAGE.delete(r1.getUuid());
printAll();
ARRAY_STORAGE.clear();
printAll();
System.out.println("Size: " + ARRAY_STORAGE.size());
}
static void printAll() {
System.out.println("\nGet All");
for (Resume r : ARRAY_STORAGE.getAllSorted()) {
System.out.println(r);
}
}
}