Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Deque

 
Jon Camilleri
Ranch Hand
Posts: 664
Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Inserts the specified element at the front of this deque if it is possible to do so immediately without violating capacity restrictions".

How does JDK handle capacity within a Deque?
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15272
37
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The API documentation answers that question at the top of the description of interface Deque and in the descriptions of the implementations of the interface. For example for ArrayDeque it says:
Resizable-array implementation of the Deque interface. Array deques have no capacity restrictions; they grow as necessary to support usage.

And you can give a LinkedBlockingDeque a fixed capacity (see the documentation).
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic