util
Class BlockingQueue

java.lang.Object
  extended byutil.BlockingQueue
All Implemented Interfaces:
Queue

public class BlockingQueue
extends java.lang.Object
implements Queue

Diese Queue blockiert, wenn Objekte abgefragt werden sollen, aber keine mehr da sind, bis neue Objekte hinzugefügt wurden

Author:
Stephan

Constructor Summary
BlockingQueue()
           
BlockingQueue(java.util.Collection coll)
          Constructs a list containing the elements of the specified collection, in the order they are returned by the collection's iterator.
BlockingQueue(int initialCapacity)
           
 
Method Summary
 boolean add(java.lang.Object o)
          Appends the specified element to the end of this list (optional operation).
 boolean addAll(java.util.Collection coll)
          Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator (optional operation).
 void clear()
          Löscht alle Elemente dieser Queue.
 java.lang.Object get()
          Gibt das nächste Element der Queue zurück.
 int hashCode()
           
 boolean isEmpty()
          Returns true if this list contains no elements.
 int size()
          Returns the number of elements in this list.
 
Methods inherited from class java.lang.Object
equals, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlockingQueue

public BlockingQueue(int initialCapacity)

BlockingQueue

public BlockingQueue(java.util.Collection coll)
Constructs a list containing the elements of the specified collection, in the order they are returned by the collection's iterator. The ArrayList instance has an initial capacity of 110% the size of the specified collection.

Throws:
java.lang.NullPointerException - if the specified collection is null.

BlockingQueue

public BlockingQueue()
Method Detail

size

public int size()
Description copied from interface: Queue
Returns the number of elements in this list. If this list contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Specified by:
size in interface Queue
Returns:
the number of elements in this list.
See Also:
Queue.size()

isEmpty

public boolean isEmpty()
Description copied from interface: Queue
Returns true if this list contains no elements.

Specified by:
isEmpty in interface Queue
Returns:
true if this list contains no elements.
See Also:
Queue.isEmpty()

add

public boolean add(java.lang.Object o)
Description copied from interface: Queue
Appends the specified element to the end of this list (optional operation).

Lists that support this operation may place limitations on what elements may be added to this list. In particular, some lists will refuse to add null elements, and others will impose restrictions on the type of elements that may be added. List classes should clearly specify in their documentation any restrictions on what elements may be added.

Specified by:
add in interface Queue
Returns:
true (as per the general contract of the Collection.add method).
See Also:
Queue.add(java.lang.Object)

get

public java.lang.Object get()
Description copied from interface: Queue
Gibt das nächste Element der Queue zurück. Kann null zurückgeben, wenn kein Objekt mehr da ist oder auch blockieren

Specified by:
get in interface Queue
See Also:
Queue.get()

addAll

public boolean addAll(java.util.Collection coll)
Description copied from interface: Queue
Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator (optional operation). The behavior of this operation is unspecified if the specified collection is modified while the operation is in progress. (Note that this will occur if the specified collection is this list, and it's nonempty.)

Specified by:
addAll in interface Queue
Returns:
true if this list changed as a result of the call.
See Also:
Queue.addAll(java.util.Collection)

clear

public void clear()
Description copied from interface: Queue
Löscht alle Elemente dieser Queue.

Specified by:
clear in interface Queue
See Also:
Queue.clear()

hashCode

public int hashCode()