|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.nih.nlm.mms.IndexEntryQueue
First In First Out queue for IndexEntry
objects. A producer
adds index entries until the queue is full and then blocks. A consumer
reads index entries out (notifying the producer when room is available
for adding more) and blocks when there are no more index entries to read.
The producer wakes up the consumer when there is more data to read.
Constructor Summary | |
IndexEntryQueue(int size)
Instantiates a IndexEntryQueue with the specified size. |
Method Summary | |
IndexEntry |
get()
Removes a IndexEntry from the queue, blocks if the queue is empty afterwards. |
boolean |
isEmpty()
Indicates whether or not the queue is empty. |
boolean |
isFull()
Indicates whether or not the queue is full. |
boolean |
isProducerFinished()
Indicates whether or not the producer is finished adding IndexEntry s. |
static void |
main(String[] s)
Self-qa test. |
void |
put(IndexEntry index_entry)
Adds a index entry to the queue, blocks if the queue is full afterwards. |
void |
setProducerFinished()
Sets the flag to true indicating that the producer is finished
adding IndexEntry s. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public IndexEntryQueue(int size)
IndexEntryQueue
with the specified size.
size
- the size of the queueMethod Detail |
public boolean isProducerFinished()
IndexEntry
s.
true
if so, false
otherwisepublic void setProducerFinished()
true
indicating that the producer is finished
adding IndexEntry
s.
public boolean isFull()
true
if full, false
otherwisepublic boolean isEmpty()
true
if empty, false
otherwisepublic void put(IndexEntry index_entry)
index_entry
- the IndexEntry
to addpublic IndexEntry get()
IndexEntry
from the queue, blocks if the queue is empty afterwards.
Wakes up a sleeping producer if the queue is at less than 50% full.
IndexEntry
public static void main(String[] s)
s
- command line arguments
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |