org.eclipse.core.internal.utils
Class Queue

java.lang.Object
  extended by org.eclipse.core.internal.utils.Queue

public class Queue
extends java.lang.Object

A Queue of objects.


Constructor Summary
Queue()
           
Queue(int size, boolean reuse)
          The parameter reuse indicates what do you want to happen with the object reference when you remove it from the queue.
 
Method Summary
 void add(java.lang.Object element)
           
 int decrement(int index)
          This method does not affect the queue itself.
 java.lang.Object elementAt(int index)
           
 java.lang.Object getNextAvailableObject()
          Returns an object that has been removed from the queue, if any.
 int increment(int index)
          This method does not affect the queue itself.
 int indexOf(java.lang.Object target)
           
 boolean isEmpty()
           
 java.util.Iterator iterator()
           
 java.lang.Object peek()
           
 java.lang.Object peekTail()
           
 java.lang.Object remove()
           
 java.lang.Object removeTail()
           
 void reset()
           
 int size()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Queue

public Queue()

Queue

public Queue(int size,
             boolean reuse)
The parameter reuse indicates what do you want to happen with the object reference when you remove it from the queue. If reuse is false the queue no longer holds a reference to the object when it is removed. If reuse is true you can use the method getNextAvailableObject to get an used object, set its new values and add it again to the queue.

Method Detail

add

public void add(java.lang.Object element)

decrement

public int decrement(int index)
This method does not affect the queue itself. It is only a helper to decrement an index in the queue.


elementAt

public java.lang.Object elementAt(int index)

iterator

public java.util.Iterator iterator()

getNextAvailableObject

public java.lang.Object getNextAvailableObject()
Returns an object that has been removed from the queue, if any. The intention is to support reuse of objects that have already been processed and removed from the queue. Returns null if there are no available objects.


increment

public int increment(int index)
This method does not affect the queue itself. It is only a helper to increment an index in the queue.


indexOf

public int indexOf(java.lang.Object target)

isEmpty

public boolean isEmpty()

peek

public java.lang.Object peek()

peekTail

public java.lang.Object peekTail()

remove

public java.lang.Object remove()

removeTail

public java.lang.Object removeTail()

reset

public void reset()

size

public int size()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object