From 00f8c54647ae08549ff61d92a700cc9a98a995e4 Mon Sep 17 00:00:00 2001 From: Stephen Colebourne Date: Fri, 2 Jan 2004 02:14:29 +0000 Subject: [PATCH] Rename BinaryBuffer to PriorityBuffer git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@131498 13f79535-47bb-0310-9956-ffa450edef68 --- .../commons/collections/BinaryHeap.java | 6 ++-- ...{BinaryBuffer.java => PriorityBuffer.java} | 32 +++++++++---------- .../commons/collections/buffer/package.html | 2 +- .../commons/collections/buffer/TestAll.java | 11 ++++--- ...aryBuffer.java => TestPriorityBuffer.java} | 32 +++++++++---------- 5 files changed, 42 insertions(+), 41 deletions(-) rename src/java/org/apache/commons/collections/buffer/{BinaryBuffer.java => PriorityBuffer.java} (95%) rename src/test/org/apache/commons/collections/buffer/{TestBinaryBuffer.java => TestPriorityBuffer.java} (93%) diff --git a/src/java/org/apache/commons/collections/BinaryHeap.java b/src/java/org/apache/commons/collections/BinaryHeap.java index ee7233fe3..bb8551afd 100644 --- a/src/java/org/apache/commons/collections/BinaryHeap.java +++ b/src/java/org/apache/commons/collections/BinaryHeap.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/BinaryHeap.java,v 1.18 2004/01/02 01:36:51 psteitz Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/BinaryHeap.java,v 1.19 2004/01/02 02:14:28 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -68,7 +68,7 @@ import java.util.NoSuchElementException; * The PriorityQueue interface has now been replaced for most uses * by the Buffer interface. This class and the interface are * retained for backwards compatability. The intended replacement is - * {@link org.apache.commons.collections.buffer.BinaryBuffer BinaryBuffer}. + * {@link org.apache.commons.collections.buffer.PriorityBuffer PriorityBuffer}. *

* The removal order of a binary heap is based on either the natural sort * order of its elements or a specified {@link Comparator}. The @@ -92,7 +92,7 @@ import java.util.NoSuchElementException; * * * @since Commons Collections 1.0 - * @version $Revision: 1.18 $ $Date: 2004/01/02 01:36:51 $ + * @version $Revision: 1.19 $ $Date: 2004/01/02 02:14:28 $ * * @author Peter Donald * @author Ram Chidambaram diff --git a/src/java/org/apache/commons/collections/buffer/BinaryBuffer.java b/src/java/org/apache/commons/collections/buffer/PriorityBuffer.java similarity index 95% rename from src/java/org/apache/commons/collections/buffer/BinaryBuffer.java rename to src/java/org/apache/commons/collections/buffer/PriorityBuffer.java index 38681d0f3..970c18367 100644 --- a/src/java/org/apache/commons/collections/buffer/BinaryBuffer.java +++ b/src/java/org/apache/commons/collections/buffer/PriorityBuffer.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/buffer/Attic/BinaryBuffer.java,v 1.3 2004/01/02 01:36:51 psteitz Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/buffer/PriorityBuffer.java,v 1.1 2004/01/02 02:14:29 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -85,14 +85,14 @@ import org.apache.commons.collections.BufferUnderflowException; * Note that this implementation is not synchronized. Use * {@link org.apache.commons.collections.BufferUtils#synchronizedBuffer(Buffer)} or * {@link org.apache.commons.collections.buffer.SynchronizedBuffer#decorate(Buffer)} - * to provide synchronized access to a BinaryBuffer: + * to provide synchronized access to a PriorityBuffer: * *

- * Buffer heap = SynchronizedBuffer.decorate(new BinaryBuffer());
+ * Buffer heap = SynchronizedBuffer.decorate(new PriorityBuffer());
  * 
* * @since Commons Collections 3.0 (previously BinaryHeap v1.0) - * @version $Revision: 1.3 $ $Date: 2004/01/02 01:36:51 $ + * @version $Revision: 1.1 $ $Date: 2004/01/02 02:14:29 $ * * @author Peter Donald * @author Ram Chidambaram @@ -100,19 +100,19 @@ import org.apache.commons.collections.BufferUnderflowException; * @author Paul Jack * @author Stephen Colebourne */ -public class BinaryBuffer extends AbstractCollection implements Buffer { +public class PriorityBuffer extends AbstractCollection implements Buffer { /** - * The default capacity for a binary heap. + * The default capacity for the buffer. */ private static final int DEFAULT_CAPACITY = 13; /** - * The elements in this heap. + * The elements in this buffer. */ protected Object[] elements; /** - * The number of elements currently in this heap. + * The number of elements currently in this buffer. */ protected int size; /** @@ -131,7 +131,7 @@ public class BinaryBuffer extends AbstractCollection implements Buffer { * Constructs a new empty buffer that sorts in ascending order by the * natural order of the objects added. */ - public BinaryBuffer() { + public PriorityBuffer() { this(DEFAULT_CAPACITY, true, null); } @@ -142,7 +142,7 @@ public class BinaryBuffer extends AbstractCollection implements Buffer { * @param comparator the comparator used to order the elements, * null means use natural order */ - public BinaryBuffer(Comparator comparator) { + public PriorityBuffer(Comparator comparator) { this(DEFAULT_CAPACITY, true, comparator); } @@ -153,7 +153,7 @@ public class BinaryBuffer extends AbstractCollection implements Buffer { * @param ascendingOrder if true the heap is created as a * minimum heap; otherwise, the heap is created as a maximum heap */ - public BinaryBuffer(boolean ascendingOrder) { + public PriorityBuffer(boolean ascendingOrder) { this(DEFAULT_CAPACITY, ascendingOrder, null); } @@ -165,7 +165,7 @@ public class BinaryBuffer extends AbstractCollection implements Buffer { * @param comparator the comparator used to order the elements, * null means use natural order */ - public BinaryBuffer(boolean ascendingOrder, Comparator comparator) { + public PriorityBuffer(boolean ascendingOrder, Comparator comparator) { this(DEFAULT_CAPACITY, ascendingOrder, comparator); } @@ -176,7 +176,7 @@ public class BinaryBuffer extends AbstractCollection implements Buffer { * @param capacity the initial capacity for the buffer, greater than zero * @throws IllegalArgumentException if capacity is <= 0 */ - public BinaryBuffer(int capacity) { + public PriorityBuffer(int capacity) { this(capacity, true, null); } @@ -189,7 +189,7 @@ public class BinaryBuffer extends AbstractCollection implements Buffer { * null means use natural order * @throws IllegalArgumentException if capacity is <= 0 */ - public BinaryBuffer(int capacity, Comparator comparator) { + public PriorityBuffer(int capacity, Comparator comparator) { this(capacity, true, comparator); } @@ -202,7 +202,7 @@ public class BinaryBuffer extends AbstractCollection implements Buffer { * minimum heap; otherwise, the heap is created as a maximum heap. * @throws IllegalArgumentException if capacity is <= 0 */ - public BinaryBuffer(int capacity, boolean ascendingOrder) { + public PriorityBuffer(int capacity, boolean ascendingOrder) { this(capacity, ascendingOrder, null); } @@ -217,7 +217,7 @@ public class BinaryBuffer extends AbstractCollection implements Buffer { * null means use natural order * @throws IllegalArgumentException if capacity is <= 0 */ - public BinaryBuffer(int capacity, boolean ascendingOrder, Comparator comparator) { + public PriorityBuffer(int capacity, boolean ascendingOrder, Comparator comparator) { super(); if (capacity <= 0) { throw new IllegalArgumentException("invalid capacity"); diff --git a/src/java/org/apache/commons/collections/buffer/package.html b/src/java/org/apache/commons/collections/buffer/package.html index d5784e8ca..26d5ddacc 100644 --- a/src/java/org/apache/commons/collections/buffer/package.html +++ b/src/java/org/apache/commons/collections/buffer/package.html @@ -5,7 +5,7 @@ This package contains implementations of the

The following implementations are provided in the package: