Interface WaterMarkQueue<T>
- Type Parameters:
T- The object
- All Superinterfaces:
BlockingQueue<T>,Collection<T>,Iterable<T>,Queue<T>
- All Known Implementing Classes:
DefaultWaterMarkQueue
This queue acts as a queue with a mark. The methods exposed by the
BlockingQueue
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
Modifier and TypeMethodDescriptionbooleanofferAfter(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, takeMethods inherited from interface java.util.Collection
addAll, clear, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toArray
-
Method Details
-
offerAfter
Offer the element after the water mark.- Parameters:
object- object to be inserted- Returns:
- true if the insert is successful
-