diff --git a/src/java/org/apache/commons/collections/buffer/BlockingBuffer.java b/src/java/org/apache/commons/collections/buffer/BlockingBuffer.java index e9a4b3e65..68ffa300a 100644 --- a/src/java/org/apache/commons/collections/buffer/BlockingBuffer.java +++ b/src/java/org/apache/commons/collections/buffer/BlockingBuffer.java @@ -35,7 +35,7 @@ import org.apache.commons.collections.BufferUnderflowException; * order that they arrive. * * @since Commons Collections 3.0 - * @version $Revision: 1.3 $ $Date: 2004/02/18 00:58:18 $ + * @version $Revision: 1.4 $ $Date: 2004/05/15 12:33:23 $ * * @author Stephen Colebourne * @author Janek Bogucki @@ -47,6 +47,7 @@ public class BlockingBuffer extends SynchronizedBuffer { * Factory method to create a blocking buffer. * * @param buffer the buffer to decorate, must not be null + * @return a new blocking Buffer * @throws IllegalArgumentException if buffer is null */ public static Buffer decorate(Buffer buffer) { diff --git a/src/java/org/apache/commons/collections/buffer/PredicatedBuffer.java b/src/java/org/apache/commons/collections/buffer/PredicatedBuffer.java index c14f58338..d7aff6973 100644 --- a/src/java/org/apache/commons/collections/buffer/PredicatedBuffer.java +++ b/src/java/org/apache/commons/collections/buffer/PredicatedBuffer.java @@ -27,7 +27,7 @@ import org.apache.commons.collections.collection.PredicatedCollection; * is thrown. * * @since Commons Collections 3.0 - * @version $Revision: 1.3 $ $Date: 2004/02/18 00:58:18 $ + * @version $Revision: 1.4 $ $Date: 2004/05/15 12:33:23 $ * * @author Stephen Colebourne * @author Paul Jack @@ -42,6 +42,7 @@ public class PredicatedBuffer extends PredicatedCollection implements Buffer { * * @param buffer the buffer to decorate, must not be null * @param predicate the predicate to use for validation, must not be null + * @return a new predicated Buffer * @throws IllegalArgumentException if buffer or predicate is null * @throws IllegalArgumentException if the buffer contains invalid elements */ diff --git a/src/java/org/apache/commons/collections/buffer/PriorityBuffer.java b/src/java/org/apache/commons/collections/buffer/PriorityBuffer.java index 14e9edf54..c7de86e5f 100644 --- a/src/java/org/apache/commons/collections/buffer/PriorityBuffer.java +++ b/src/java/org/apache/commons/collections/buffer/PriorityBuffer.java @@ -50,7 +50,7 @@ import org.apache.commons.collections.BufferUnderflowException; * * * @since Commons Collections 3.0 (previously BinaryHeap v1.0) - * @version $Revision: 1.4 $ $Date: 2004/02/18 00:58:18 $ + * @version $Revision: 1.5 $ $Date: 2004/05/15 12:33:23 $ * * @author Peter Donald * @author Ram Chidambaram @@ -230,6 +230,7 @@ public class PriorityBuffer extends AbstractCollection implements Buffer { * The element added will be sorted according to the comparator in use. * * @param element the element to be added + * @return true always */ public boolean add(Object element) { if (isAtCapacity()) { diff --git a/src/java/org/apache/commons/collections/buffer/SynchronizedBuffer.java b/src/java/org/apache/commons/collections/buffer/SynchronizedBuffer.java index 47eaef534..568875c20 100644 --- a/src/java/org/apache/commons/collections/buffer/SynchronizedBuffer.java +++ b/src/java/org/apache/commons/collections/buffer/SynchronizedBuffer.java @@ -25,7 +25,7 @@ import org.apache.commons.collections.collection.SynchronizedCollection; * Methods are synchronized, then forwarded to the decorated buffer. * * @since Commons Collections 3.0 - * @version $Revision: 1.3 $ $Date: 2004/02/18 00:58:18 $ + * @version $Revision: 1.4 $ $Date: 2004/05/15 12:33:23 $ * * @author Stephen Colebourne */ @@ -35,6 +35,7 @@ public class SynchronizedBuffer extends SynchronizedCollection implements Buffer * Factory method to create a synchronized buffer. * * @param buffer the buffer to decorate, must not be null + * @return a new synchronized Buffer * @throws IllegalArgumentException if buffer is null */ public static Buffer decorate(Buffer buffer) { diff --git a/src/java/org/apache/commons/collections/buffer/TransformedBuffer.java b/src/java/org/apache/commons/collections/buffer/TransformedBuffer.java index 182762848..d7ad8f09b 100644 --- a/src/java/org/apache/commons/collections/buffer/TransformedBuffer.java +++ b/src/java/org/apache/commons/collections/buffer/TransformedBuffer.java @@ -28,7 +28,7 @@ import org.apache.commons.collections.collection.TransformedCollection; * use the Integer form to remove objects. * * @since Commons Collections 3.0 - * @version $Revision: 1.3 $ $Date: 2004/02/18 00:58:18 $ + * @version $Revision: 1.4 $ $Date: 2004/05/15 12:33:23 $ * * @author Stephen Colebourne */ @@ -42,6 +42,7 @@ public class TransformedBuffer extends TransformedCollection implements Buffer { * * @param buffer the buffer to decorate, must not be null * @param transformer the transformer to use for conversion, must not be null + * @return a new transformed Buffer * @throws IllegalArgumentException if buffer or transformer is null */ public static Buffer decorate(Buffer buffer, Transformer transformer) { diff --git a/src/java/org/apache/commons/collections/buffer/TypedBuffer.java b/src/java/org/apache/commons/collections/buffer/TypedBuffer.java index 7968cc1e2..9540bf88e 100644 --- a/src/java/org/apache/commons/collections/buffer/TypedBuffer.java +++ b/src/java/org/apache/commons/collections/buffer/TypedBuffer.java @@ -27,7 +27,7 @@ import org.apache.commons.collections.functors.InstanceofPredicate; * collection, an IllegalArgumentException is thrown. * * @since Commons Collections 3.0 - * @version $Revision: 1.4 $ $Date: 2004/05/07 23:28:38 $ + * @version $Revision: 1.5 $ $Date: 2004/05/15 12:33:23 $ * * @author Stephen Colebourne * @author Matthew Hawthorne @@ -42,6 +42,7 @@ public class TypedBuffer { * * @param buffer the buffer to decorate, must not be null * @param type the type to allow into the buffer, must not be null + * @return a new typed Buffer * @throws IllegalArgumentException if buffer or type is null * @throws IllegalArgumentException if the buffer contains invalid elements */ @@ -53,6 +54,7 @@ public class TypedBuffer { * Restrictive constructor. */ protected TypedBuffer() { + super(); } } diff --git a/src/java/org/apache/commons/collections/buffer/UnboundedFifoBuffer.java b/src/java/org/apache/commons/collections/buffer/UnboundedFifoBuffer.java index 458fc84f3..ff758a8e1 100644 --- a/src/java/org/apache/commons/collections/buffer/UnboundedFifoBuffer.java +++ b/src/java/org/apache/commons/collections/buffer/UnboundedFifoBuffer.java @@ -44,7 +44,7 @@ import org.apache.commons.collections.BufferUnderflowException; * This buffer prevents null objects from being added. * * @since Commons Collections 3.0 (previously in main package v2.1) - * @version $Revision: 1.7 $ $Date: 2004/02/18 00:58:18 $ + * @version $Revision: 1.8 $ $Date: 2004/05/15 12:33:23 $ * * @author Avalon * @author Federico Barbieri @@ -54,8 +54,11 @@ import org.apache.commons.collections.BufferUnderflowException; */ public class UnboundedFifoBuffer extends AbstractCollection implements Buffer { + /** The array of objects in the buffer. */ protected Object[] buffer; + /** The current head index. */ protected int head; + /** The current tail index. */ protected int tail; /** diff --git a/src/java/org/apache/commons/collections/buffer/UnmodifiableBuffer.java b/src/java/org/apache/commons/collections/buffer/UnmodifiableBuffer.java index 254712e68..edc7ec27b 100644 --- a/src/java/org/apache/commons/collections/buffer/UnmodifiableBuffer.java +++ b/src/java/org/apache/commons/collections/buffer/UnmodifiableBuffer.java @@ -26,7 +26,7 @@ import org.apache.commons.collections.iterators.UnmodifiableIterator; * Decorates another Buffer to ensure it can't be altered. * * @since Commons Collections 3.0 - * @version $Revision: 1.5 $ $Date: 2004/02/18 00:58:18 $ + * @version $Revision: 1.6 $ $Date: 2004/05/15 12:33:23 $ * * @author Stephen Colebourne */ @@ -34,8 +34,11 @@ public final class UnmodifiableBuffer extends AbstractBufferDecorator implements /** * Factory method to create an unmodifiable buffer. + *

+ * If the buffer passed in is already unmodifiable, it is returned. * * @param buffer the buffer to decorate, must not be null + * @return an unmodifiable Buffer * @throws IllegalArgumentException if buffer is null */ public static Buffer decorate(Buffer buffer) {