@SCJAllowed(value=INFRASTRUCTURE) class PriorityQueue extends java.lang.Object
PriorityQueue class holds the ready processes
in the PriorityScheduler. insert and
extractMax are O(log n).| Modifier and Type | Field and Description |
|---|---|
protected int |
heapSize |
protected int[] |
tree |
| Constructor and Description |
|---|
PriorityQueue(int size) |
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
exchange(int a,
int b) |
ScjProcess |
extractMax() |
(package private) void |
heapify(int i) |
void |
insert(ScjProcess obj) |
(package private) int |
left(int i) |
static void |
main(java.lang.String[] args) |
(package private) int |
parent(int i) |
void |
print()
Print out the contents of the priority queue.
|
void |
remove(ScjProcess obj) |
(package private) int |
right(int i) |
int parent(int i)
int left(int i)
int right(int i)
void exchange(int a,
int b)
void heapify(int i)
public void insert(ScjProcess obj)
public ScjProcess extractMax()
public void remove(ScjProcess obj)
public void print()
public static void main(java.lang.String[] args)