org.archive.queue
Class LinkedQueue

java.lang.Object
  extended by EDU.oswego.cs.dl.util.concurrent.LinkedQueue
      extended by org.archive.queue.LinkedQueue
All Implemented Interfaces:
EDU.oswego.cs.dl.util.concurrent.Channel, EDU.oswego.cs.dl.util.concurrent.Puttable, EDU.oswego.cs.dl.util.concurrent.Takable, java.io.Serializable

public class LinkedQueue
extends EDU.oswego.cs.dl.util.concurrent.LinkedQueue
implements java.io.Serializable

Version of LinkedQueue (from util.concurrent) which gives more options for understanding its contents: a running count of entries and an iterator.

Author:
gojomo
See Also:
Serialized Form

Nested Class Summary
 class LinkedQueue.LinkedQueueIterator
          Iterator over contents of a org.archive.queue.LinkedQueue.
 
Field Summary
protected  int count
          Count of items in queue.
 
Fields inherited from class EDU.oswego.cs.dl.util.concurrent.LinkedQueue
head_, last_, putLock_, waitingForTake_
 
Constructor Summary
LinkedQueue()
           
 
Method Summary
protected  java.lang.Object extract()
           
 int getCount()
          Return a count of entries in the queue.
protected  void insert(java.lang.Object x)
           
 java.util.Iterator iterator()
           
 
Methods inherited from class EDU.oswego.cs.dl.util.concurrent.LinkedQueue
isEmpty, offer, peek, poll, put, take
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

count

protected int count
Count of items in queue.

Constructor Detail

LinkedQueue

public LinkedQueue()
Method Detail

extract

protected java.lang.Object extract()
Overrides:
extract in class EDU.oswego.cs.dl.util.concurrent.LinkedQueue

insert

protected void insert(java.lang.Object x)
Overrides:
insert in class EDU.oswego.cs.dl.util.concurrent.LinkedQueue

getCount

public int getCount()
Return a count of entries in the queue. Note that this counter's maintenance and access is generally unsynchronized, and so may not reflect all inserts/extracts in progress.

Returns:
count of items in queue

iterator

public java.util.Iterator iterator()


Copyright © 2003-2005 Internet Archive. All Rights Reserved.