You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Chen (Jira)" <ji...@apache.org> on 2019/11/09 02:55:00 UTC
[jira] [Comment Edited] (COLLECTIONS-733) Thread-Safe Array
Blocking Deque
[ https://issues.apache.org/jira/browse/COLLECTIONS-733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16970694#comment-16970694 ]
Chen edited comment on COLLECTIONS-733 at 11/9/19 2:54 AM:
-----------------------------------------------------------
Do you want a queue or a deque?
"What I have had the need for several times now is a resizable-array implementation of a bounded blocking queue. It should implement all the same methods as the ArrayBlockingQueue but it can grow as needed, like an ArrayDeque."
I think you can use a wrapper class which contains an ArrayBlockingQueue variable and a reSizeQueue() method, you can use the method to creat a new bigger size ArrayBlockingQueue to the variable when you want to resize the queue.
If this can solve your problem?
was (Author: guoping1):
Do you want a queue or a deque?
"What I have had the need for several times now is a resizable-array implementation of a bounded blocking queue. It should implement all the same methods as the ArrayBlockingQueue but it can grow as needed, like an ArrayDeque."
I think you can use a wrapper class which contains a ArrayBlockingQueue variable and a reSizeQueue() method, you can use the method to creat a new bigger size ArrayBlockingQueue to the variable when you want to resize the queue.
If this can solve your problem?
> Thread-Safe Array Blocking Deque
> --------------------------------
>
> Key: COLLECTIONS-733
> URL: https://issues.apache.org/jira/browse/COLLECTIONS-733
> Project: Commons Collections
> Issue Type: New Feature
> Reporter: David Mollitor
> Priority: Major
>
> The JDK offers an [ArrayDeque|https://docs.oracle.com/javase/8/docs/api/java/util/ArrayDeque.html] which is a resizable-array implementation of the [Deque|https://docs.oracle.com/javase/8/docs/api/java/util/Deque.html] interface.
> The JDK also offers an [ArrayBlockingQueue|https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ArrayBlockingQueue.html] which is a bounded blocking queue backed by an array.
> What I have had the need for several times now is a resizable-array implementation of a bounded blocking queue. It should implement all the same methods as the {{ArrayBlockingQueue}} but it can grow as needed, like an {{ArrayDeque}}.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)