Add TransformedDeque, BlockingDeque, CircularDeque, PredicatedDeque and SynchronizedDeque for deque interface#111
Open
dota17 wants to merge 9 commits intoapache:masterfrom
Open
Add TransformedDeque, BlockingDeque, CircularDeque, PredicatedDeque and SynchronizedDeque for deque interface#111dota17 wants to merge 9 commits intoapache:masterfrom
dota17 wants to merge 9 commits intoapache:masterfrom
Conversation
…into collections-queue-src
belugabehr
reviewed
Dec 26, 2019
| * @param <E> the type of elements in this collection | ||
| * @since 4.5 | ||
| */ | ||
| public class CircularDeque<E> extends AbstractCollection<E> |
There was a problem hiding this comment.
This seems like a lot of copy+pase code. Please just wrap a Java JDK ArrayDeque.
https://docs.oracle.com/javase/7/docs/api/java/util/ArrayDeque.html
belugabehr
reviewed
Dec 26, 2019
| * @param <E> the type of elements held in this deque | ||
| * @since 4.5 | ||
| */ | ||
| public class BlockingDeque<E> extends AbstractCollection<E> implements Deque<E>, Serializable { |
There was a problem hiding this comment.
There is already a BlockingDeque interface in the Java JDK, so this class name is kind of confusing and it does not implement the interface.
https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/BlockingDeque.html
https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/LinkedBlockingDeque.html
I'm not sure how useful decoration will be. Might be more helpful to have an ArrayBlockingDeque class.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I found someone raised that adding support for deque interface in Collections.(https://issues.apache.org/jira/browse/COLLECTIONS-563)
(https://issues.apache.org/jira/browse/COLLECTIONS-564)
This makes sense so I wrote some code to make a try. I want to know if my implementation is appropriate, if my PR is merged or given comments and suggestions, I would be happy to finish the rest of the work.