org.jboss.threads
Class ArrayQueue<E>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractQueue<E>
          extended by org.jboss.threads.ArrayQueue<E>
All Implemented Interfaces:
java.lang.Iterable<E>, java.util.Collection<E>, java.util.Queue<E>

public final class ArrayQueue<E>
extends java.util.AbstractQueue<E>
implements java.util.Queue<E>

A simple array-backed queue with a fixed size.


Constructor Summary
ArrayQueue(int capacity)
           
 
Method Summary
 void clear()
           
 boolean isEmpty()
           
 java.util.Iterator<E> iterator()
           
 boolean offer(E e)
           
 E peek()
           
 E poll()
           
 int size()
           
 
Methods inherited from class java.util.AbstractQueue
add, addAll, 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.Queue
add, element, remove
 
Methods inherited from interface java.util.Collection
addAll, contains, containsAll, equals, hashCode, remove, removeAll, retainAll, toArray, toArray
 

Constructor Detail

ArrayQueue

public ArrayQueue(int capacity)
Method Detail

iterator

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

isEmpty

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

size

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

offer

public boolean offer(E e)
Specified by:
offer in interface java.util.Queue<E>

poll

public E poll()
Specified by:
poll in interface java.util.Queue<E>

peek

public E peek()
Specified by:
peek in interface java.util.Queue<E>

clear

public void clear()
Specified by:
clear in interface java.util.Collection<E>
Overrides:
clear in class java.util.AbstractQueue<E>


Copyright © 2011. All Rights Reserved.