public class RepairPriorityQueue extends Object
| Constructor and Description |
|---|
RepairPriorityQueue() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsDigram(String digramStr)
Checks if a digram is in the queue.
|
RepairDigramRecord |
dequeue()
Returns the most frequently seen element -- the head of the queue.
|
void |
enqueue(RepairDigramRecord digramRecord)
Places an element in the queue at the place based on its frequency.
|
RepairDigramRecord |
get(String key)
Gets an element in the queue given its key.
|
RepairDigramRecord |
peek()
Peaks onto the head element (doesn't remove it).
|
int |
size()
Returns the queue size.
|
ArrayList<RepairDigramRecord> |
toList()
Needed this for debug purpose -- translates the doubly linked list into an array list.
|
String |
toString() |
RepairDigramRecord |
updateDigramFrequency(String digram,
int newFreq)
Updates the priority queue according to the change...
|
public void enqueue(RepairDigramRecord digramRecord)
digramRecord - the digram record to place into.public RepairDigramRecord dequeue()
public int size()
public RepairDigramRecord peek()
public boolean containsDigram(String digramStr)
digramStr - the digram string.public RepairDigramRecord get(String key)
key - the key to look for.public RepairDigramRecord updateDigramFrequency(String digram, int newFreq)
digram - the digram string.newFreq - new frequency.public ArrayList<RepairDigramRecord> toList()
Copyright © 2021 JMotif. All rights reserved.