-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGatorBook.java
More file actions
26 lines (24 loc) · 905 Bytes
/
GatorBook.java
File metadata and controls
26 lines (24 loc) · 905 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
import java.util.PriorityQueue;
public class GatorBook {
public int BookID;
public String BookName;
public String AuthorName;
public String AvailabilityStatus;
public int BorrowedBy;
public PriorityQueue<GatorReservation> ReservationHeap;
GatorBook(int BookID, String BookName, String AuthorName, String AvailabilityStatus) {
this.BookID = BookID;
this.BookName = BookName;
this.AuthorName = AuthorName;
this.AvailabilityStatus = AvailabilityStatus;
this.BorrowedBy = -1;
this.ReservationHeap = new PriorityQueue<GatorReservation>((g1, g2) -> {
if (g1.priorityNumber < g2.priorityNumber)
return -1;
else if (g1.priorityNumber > g2.priorityNumber)
return 1;
else
return g1.timeOfReservation.compareTo(g2.timeOfReservation);
});
}
}