|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object writeattributes.AddressEdit.PriorityQueue
private class AddressEdit.PriorityQueue
Priority queue used to order the writing of attributes.
This queue stores AttributeRegions
in tab order. Queue elements are accessible randomly by index, and in
either the forward or reverse direction using a
queue iterator
.
The index is a partial order on the queue contents, so that
for all queue indices i and j:
q.get(i).getRow() < q.get(j).getRow if and only if i < j.
Nested Class Summary | |
---|---|
private class |
AddressEdit.PriorityQueue.PQIterator
Priority queue iterator. |
Field Summary | |
---|---|
private int |
generation
Counter which is incremented whenever a change is made to the queue. |
private java.util.ArrayList |
queue
The priority queue. |
Constructor Summary | |
---|---|
AddressEdit.PriorityQueue()
Create a default-sized queue. |
|
AddressEdit.PriorityQueue(int size)
Create a queue with a given initial size. |
Method Summary | |
---|---|
void |
add(AddressEdit.AttributeRegion ar)
Insert an element into the queue in index order. |
AddressEdit.AttributeRegion |
get(int index)
Return the queue element with the given index. |
int |
getGeneration()
Return the generation of the queue. |
java.util.Iterator |
queueIterator(int direction)
Return iterator over the queue contents. |
int |
size()
Return the queue size. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final java.util.ArrayList queue
The queue order reflects the tab order on the screen. In this case the tab order is given by the row number of each attribute's position.
private int generation
Constructor Detail |
---|
public AddressEdit.PriorityQueue()
public AddressEdit.PriorityQueue(int size)
size
- initial queue sizeMethod Detail |
---|
public void add(AddressEdit.AttributeRegion ar)
This implementation assumes small-sized queues, so a simple linear insertion algorithm is used.
ar
- the attribute and region to be insertedpublic int getGeneration()
public java.util.Iterator queueIterator(int direction)
direction
- negative to iterate from high to low, else low to high
iterator
for this queuepublic int size()
public AddressEdit.AttributeRegion get(int index)
index
- index number (0 <= index < queue.size())
java.lang.IllegalArgumentException
- if index out of range
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |