Class ConsumableBlockingQueue<T>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractQueue<E>
-
- java.util.concurrent.ArrayBlockingQueue<T>
-
- uk.gov.gchq.gaffer.commonutil.iterable.ConsumableBlockingQueue<T>
-
- Type Parameters:
T- the type of object in the queue
- All Implemented Interfaces:
Serializable,Iterable<T>,Collection<T>,BlockingQueue<T>,Queue<T>
public class ConsumableBlockingQueue<T> extends ArrayBlockingQueue<T>
Extension toArrayBlockingQueueto allow consumers to iterate over the queue, consuming the data, without being blocked.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ConsumableBlockingQueue(int maxSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Warning - this will convert the entire queue to an array to check if the items are equal so use it with with caution.inthashCode()Warning - this will convert the entire queue to an array to get a hashcode, so use it with caution.Iterator<T>iterator()StringtoString()Warning - this will convert the entire queue to an array to get a string, so use with caution.-
Methods inherited from class java.util.concurrent.ArrayBlockingQueue
add, clear, contains, drainTo, drainTo, forEach, offer, offer, peek, poll, poll, put, remainingCapacity, remove, removeAll, removeIf, retainAll, size, spliterator, take, toArray, toArray
-
Methods inherited from class java.util.AbstractQueue
addAll, element, remove
-
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty
-
Methods inherited from interface java.util.Collection
addAll, containsAll, isEmpty, parallelStream, stream, toArray
-
-
-
-
Method Detail
-
iterator
@Nonnull public Iterator<T> iterator()
- Specified by:
iteratorin interfaceCollection<T>- Specified by:
iteratorin interfaceIterable<T>- Overrides:
iteratorin classArrayBlockingQueue<T>
-
equals
public boolean equals(Object obj)
Warning - this will convert the entire queue to an array to check if the items are equal so use it with with caution.- Specified by:
equalsin interfaceCollection<T>- Overrides:
equalsin classObject- Parameters:
obj- the object to compare- Returns:
- true if equal, otherwise false.
-
hashCode
public int hashCode()
Warning - this will convert the entire queue to an array to get a hashcode, so use it with caution.- Specified by:
hashCodein interfaceCollection<T>- Overrides:
hashCodein classObject
-
toString
public String toString()
Warning - this will convert the entire queue to an array to get a string, so use with caution.- Overrides:
toStringin classArrayBlockingQueue<T>
-
-