-
Notifications
You must be signed in to change notification settings - Fork 473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add TransformedDeque, BlockingDeque, CircularDeque, PredicatedDeque and SynchronizedDeque for deque interface #111
base: master
Are you sure you want to change the base?
Conversation
…into collections-queue-src
* @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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
* @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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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.