ahc.collection
Interface Queue

All Known Implementing Classes:
GenericQueue

public interface Queue

This is the generic interface that all queue classes must implement.

Author:
Arno Haase

Method Summary
 void add(java.lang.Object obj)
           
 void clear()
           
 boolean isEmpty()
           
 boolean isThreadSafe()
           
 java.lang.Object peek()
          This method is implemented only for non-threadsafe queues so that it does not have InterruptedException in its signature.
 java.lang.Object peek(boolean blocking)
           
 java.lang.Object peek(int timeoutMillis)
           
 java.lang.Object remove()
          This method is implemented only for non-threadsafe queues so that it does not have InterruptedException in its signature.
 java.lang.Object remove(boolean blocking)
           
 java.lang.Object remove(int timeoutMillis)
           
 int size()
           
 

Method Detail

add

public void add(java.lang.Object obj)

remove

public java.lang.Object remove()
This method is implemented only for non-threadsafe queues so that it does not have InterruptedException in its signature. Therefore, this method does not block but rather throws NoSuchElementException if called on an empty queue.


remove

public java.lang.Object remove(boolean blocking)
                        throws java.lang.InterruptedException
java.lang.InterruptedException

remove

public java.lang.Object remove(int timeoutMillis)
                        throws java.lang.InterruptedException,
                               TimeoutException
java.lang.InterruptedException
TimeoutException

peek

public java.lang.Object peek()
This method is implemented only for non-threadsafe queues so that it does not have InterruptedException in its signature. Therefore, this method does not block but rather throws NoSuchElementException if called on an empty queue.


peek

public java.lang.Object peek(boolean blocking)
                      throws java.lang.InterruptedException
java.lang.InterruptedException

peek

public java.lang.Object peek(int timeoutMillis)
                      throws java.lang.InterruptedException,
                             TimeoutException
java.lang.InterruptedException
TimeoutException

size

public int size()

isEmpty

public boolean isEmpty()

clear

public void clear()

isThreadSafe

public boolean isThreadSafe()