LinkedBlockingDeque

This is the simplest implementation of the BlockingQueue and also its BlockingDeque subinterface. As we discussed in the previous chapter, a Deque is a double-ended queue that has add, remove, and offer method types, among others, in the form of xxxFirst and xxxLast to carry out the act with one or other end of the queue. The Deque interface defines getFirst and getLast, instead of consistently naming elementFirst and elementLast, so this is something you should get used to. After all, the IDEs help with automatic code completion so this should not really be a big problem.

Get Java Projects - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.