- ArrayBlockingQueue
- DelayQueue
- LinkedBlockingQueue (a bq based on linked nodes)
- PriorityBlockingQueue
- SynchronousQueue
An ArrayBlockingQueue is a BOUNDED blocking queue backed by an array. It orders elements using FIFO discipline. This is the classic "bounded buffer" in which a fixed-size array holds elements inserted by producers and extracted by consumers. The head of the queue is the element that has been on the queue the longest time.
These data structures are all part of the wonderful Java Collections Framework. Enjoy the benefits of enhanced-for loop, generics and auto-boxing.
Here's a precanned example of enhanced-for-loop in action, utilising the colon operator:
void cancelAll(Collection
No comments:
Post a Comment