File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Deque Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Deque" Watch "Deque" New topic
Author

Deque

Jon Camilleri
Ranch Hand

Joined: Apr 25, 2008
Posts: 660

"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?


Jon
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

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).


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Deque
 
Similar Threads
Collection class to be used when behavior needed as LIFO
Arraylist and linklist !!
Question about inserting elements into a treemap as compared to arraylist?
Double-ended queue java source code or c++ source code