jpaul.DataStructs
Class WorkQueue<T>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractQueue<T>
          extended by jpaul.DataStructs.WorkQueue<T>
All Implemented Interfaces:
java.lang.Iterable<T>, java.util.Collection<T>, java.util.Queue<T>

public class WorkQueue<T>
extends java.util.AbstractQueue<T>

WorkQueue

Version:
$Id: WorkQueue.java,v 1.4 2006/03/14 02:29:31 salcianu Exp $
Author:
Alexandru Salcianu - salcianu@alum.mit.edu

Constructor Summary
WorkQueue()
           
WorkQueue(int blockCapacity)
          Creates a WorkQueue.
 
Method Summary
 boolean isEmpty()
           
 java.util.Iterator<T> iterator()
           
 boolean offer(T elem)
           
 T peek()
           
 T poll()
           
 int size()
           
 
Methods inherited from class java.util.AbstractQueue
add, addAll, clear, element, remove
 
Methods inherited from class java.util.AbstractCollection
contains, containsAll, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
contains, containsAll, equals, hashCode, remove, removeAll, retainAll, toArray, toArray
 

Constructor Detail

WorkQueue

public WorkQueue()

WorkQueue

public WorkQueue(int blockCapacity)
Creates a WorkQueue.

Method Detail

offer

public boolean offer(T elem)

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Collection<T>
Overrides:
isEmpty in class java.util.AbstractCollection<T>

peek

public T peek()

poll

public T poll()

size

public int size()
Specified by:
size in interface java.util.Collection<T>
Specified by:
size in class java.util.AbstractCollection<T>

iterator

public java.util.Iterator<T> iterator()
Specified by:
iterator in interface java.lang.Iterable<T>
Specified by:
iterator in interface java.util.Collection<T>
Specified by:
iterator in class java.util.AbstractCollection<T>


Copyright 2005 Alexandru Salcianu - salcianu@alum.mit.edu