belugabehr commented on a change in pull request #111: Add TransformedDeque, 
BlockingDeque, CircularDeque, PredicatedDeque and SynchronizedDeque for deque 
interface
URL: 
https://github.com/apache/commons-collections/pull/111#discussion_r361467871
 
 

 ##########
 File path: 
src/main/java/org/apache/commons/collections4/deque/CircularDeque.java
 ##########
 @@ -0,0 +1,636 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.collections4.deque;
+
+
+import org.apache.commons.collections4.BoundedCollection;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.util.AbstractCollection;
+import java.util.Collection;
+
+import java.util.Deque;
+import java.util.NoSuchElementException;
+import java.util.List;
+
+import java.util.ConcurrentModificationException;
+import java.util.Objects;
+import java.util.Iterator;
+/**
+ * CircularDeque is a deque with a fixed size that replaces its oldest
+ * element if full.
+ * <p>
+ * The removal order of a {@link CircularDeque} is based on the
+ * insertion order; elements are removed in the same order in which they
+ * were added. The iteration order is the same as the removal order.
+ * </p>
+ * <p>
+ * The {@link #add(Object)}, {@link #remove()}, {@link #peek()}, {@link #poll},
+ * {@link #offer(Object)} operations all perform in constant time.
+ * All other operations perform in linear time or worse.
+ * </p>
+ * <p>
+ * This deque prevents null objects from being added.
+ * </p>
+ *
+ * @param <E> the type of elements in this collection
+ * @since 4.5
+ */
+public class CircularDeque<E> extends AbstractCollection<E>
 
 Review 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

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to