Interface WaterMarkQueue<T>
-
- Type Parameters:
T
- The object
- All Superinterfaces:
BlockingQueue<T>
,Collection<T>
,Iterable<T>
,Queue<T>
- All Known Implementing Classes:
DefaultWaterMarkQueue
public interface WaterMarkQueue<T> extends BlockingQueue<T>
This queue acts as a queue with a mark. The methods exposed by theBlockingQueue
interface will add elements up to the mark. We call this mark the waterMark. After the water mark the all the insertion operations will fails as if the queue is bounded by this waterMark. After this to add values to the queue the offerAfter method should be called.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
offerAfter(T object)
Offer the element after the water mark.-
Methods inherited from interface java.util.concurrent.BlockingQueue
add, contains, drainTo, drainTo, offer, offer, poll, put, remainingCapacity, remove, take
-
Methods inherited from interface java.util.Collection
addAll, clear, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toArray
-
-
-
-
Method Detail
-
offerAfter
boolean offerAfter(T object)
Offer the element after the water mark.- Parameters:
object
- object to be inserted- Returns:
- true if the insert is successful
-
-