diff --git a/src/java/org/apache/commons/collections/CircularFifoBuffer.java b/src/java/org/apache/commons/collections/CircularFifoBuffer.java
deleted file mode 100644
index 6014a7e16..000000000
--- a/src/java/org/apache/commons/collections/CircularFifoBuffer.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/Attic/CircularFifoBuffer.java,v 1.5 2003/11/29 18:04:57 scolebourne Exp $
- * ====================================================================
- *
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2003 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution, if
- * any, must include the following acknowledgement:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgement may appear in the software itself,
- * if and wherever such third-party acknowledgements normally appear.
- *
- * 4. The names "The Jakarta Project", "Commons", and "Apache Software
- * Foundation" must not be used to endorse or promote products derived
- * from this software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache"
- * nor may "Apache" appear in their names without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- *
- * The removal order of a CircularFifoBuffer
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.
- *
- * The {@link #add(Object)}, {@link #remove()} and {@link #get()} operations - * all perform in constant time. All other operations perform in linear - * time or worse. - *
- * Note that this implementation is not synchronized. The following can be
- * used to provide synchronized access to your CircularFifoBuffer
:
- *
- * Buffer fifo = BufferUtils.synchronizedBuffer(new CircularFifoBuffer()); - *- *
- * This buffer prevents null objects from being added.
- *
- * @deprecated WILL BE REMOVED BEFORE v3.0
- * @since Commons Collections 3.0
- * @version $Revision: 1.5 $ $Date: 2003/11/29 18:04:57 $
- *
- * @author Stefano Fornari
- * @author Stephen Colebourne
- */
-public class CircularFifoBuffer extends BoundedFifoBuffer {
-
- /**
- * Constructor that creates a buffer with the default size of 32.
- */
- public CircularFifoBuffer() {
- super(32);
- }
-
- /**
- * Constructor that creates a buffer with the specified size.
- *
- * @param size the size of the buffer (cannot be changed)
- * @throws IllegalArgumentException if the size is less than 1
- */
- public CircularFifoBuffer(int size) {
- super(size);
- }
-
- /**
- * Constructor that creates a buffer from the specified collection.
- * The collection size also sets the buffer size
- *
- * @param coll the collection to copy into the buffer, may not be null
- * @throws NullPointerException if the collection is null
- */
- public CircularFifoBuffer(Collection coll) {
- super(coll);
- }
-
- /**
- * If the buffer is full, the least recently added element is discarded so
- * that a new element can be inserted.
- *
- * @param element the element to add
- * @return true, always
- */
- public boolean add(Object element) {
- if (isFull()) {
- remove();
- }
- return super.add(element);
- }
-
-}
diff --git a/src/java/org/apache/commons/collections/CommonsLinkedList.java b/src/java/org/apache/commons/collections/CommonsLinkedList.java
deleted file mode 100644
index ee0768859..000000000
--- a/src/java/org/apache/commons/collections/CommonsLinkedList.java
+++ /dev/null
@@ -1,636 +0,0 @@
-/*
- * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/Attic/CommonsLinkedList.java,v 1.10 2003/12/11 00:18:06 scolebourne Exp $
- * ====================================================================
- *
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2003 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution, if
- * any, must include the following acknowledgement:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgement may appear in the software itself,
- * if and wherever such third-party acknowledgements normally appear.
- *
- * 4. The names "The Jakarta Project", "Commons", and "Apache Software
- * Foundation" must not be used to endorse or promote products derived
- * from this software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache"
- * nor may "Apache" appear in their names without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * true
iff the elements are both null
- * or {@link Object#equals equal}.
- */
- public boolean elementEquals(Object otherElement) {
- if (element == null) {
- return otherElement == null;
- } else {
- return element.equals(otherElement);
- }
- }
- }
-
- /**
- * A {@link java.util.ListIterator} {@link CommonsLinkedList}.
- *
- * @author Rich Dougherty
- */
- protected class ListIteratorImpl implements ListIterator {
-
- /**
- * The node that will be returned by {@link #next()}. If this is equal
- * to {@link #marker} then there are no more elements to return.
- */
- protected Node nextNode;
-
- /**
- * The index of {@link #nextNode}.
- */
- protected int nextIndex;
-
- /**
- * The last node that was returned by {@link #next()} or {@link
- * #previous()}. Set to null
if {@link #next()} or {@link
- * #previous()} haven't been called, or if the node has been removed
- * with {@link #remove()} or a new node added with {@link #add(Object)}.
- * Should be accesed through {@link #getLastNodeReturned()} to enforce
- * this behaviour.
- */
- protected Node lastNodeReturned;
-
- /**
- * The modification count that the list is expected to have. If the list
- * doesn't have this count, then a
- * {@link java.util.ConcurrentModificationException} may be thrown by
- * the operations.
- */
- protected int expectedModCount;
-
- /**
- * Create a ListIterator for a list, starting at the first element in
- * the list.
- */
- public ListIteratorImpl() throws IndexOutOfBoundsException {
- this(0);
- }
-
- /**
- * Create a ListIterator for a list.
- *
- * @param startIndex The index to start at.
- */
- public ListIteratorImpl(int startIndex)
- throws IndexOutOfBoundsException {
- expectedModCount = modCount;
- nextNode = getNode(startIndex, true);
- nextIndex = startIndex;
- }
-
- /**
- * Checks the modification count of the list is the value that this
- * object expects.
- *
- * @throws ConcurrentModificationException If the list's modification
- * count isn't the value that was expected.
- */
- protected void checkModCount()
- throws ConcurrentModificationException {
- if (modCount != expectedModCount) {
- throw new ConcurrentModificationException();
- }
- }
-
- /**
- * Gets the last node returned.
- *
- * @throws IllegalStateException If {@link #next()} or {@link
- * #previous()} haven't been called, or if the node has been removed
- * with {@link #remove()} or a new node added with {@link #add(Object)}.
- */
- protected Node getLastNodeReturned() throws IllegalStateException {
- if (lastNodeReturned == null) {
- throw new IllegalStateException();
- }
- return lastNodeReturned;
- }
-
- public boolean hasNext() {
- return nextNode != marker;
- }
-
- public Object next() {
- checkModCount();
- if (!hasNext()) {
- throw new NoSuchElementException("No element at index " +
- nextIndex + ".");
- }
- Object element = nextNode.element;
- lastNodeReturned = nextNode;
- nextNode = nextNode.next;
- nextIndex++;
- return element;
- }
-
- public boolean hasPrevious() {
- return nextNode.previous != marker;
- }
-
- public Object previous() {
- checkModCount();
- if (!hasPrevious()) {
- throw new NoSuchElementException("Already at start of list.");
- }
- nextNode = nextNode.previous;
- Object element = nextNode.element;
- lastNodeReturned = nextNode;
- nextIndex--;
- return element;
- }
-
- public int nextIndex() {
- return nextIndex;
- }
-
- public int previousIndex() {
- return nextIndex - 1;
- }
-
- public void remove() {
- checkModCount();
- removeNode(getLastNodeReturned());
- lastNodeReturned = null;
- nextIndex--;
- expectedModCount++;
- }
-
- public void set(Object o) {
- checkModCount();
- getLastNodeReturned().element = o;
- }
-
- public void add(Object o) {
- checkModCount();
- addNodeBefore(nextNode, o);
- lastNodeReturned = null;
- nextIndex++;
- expectedModCount++;
- }
-
- }
-
- private static final long serialVersionUID = 1L;
-
- /**
- * A {@link Node} which indicates the start and end of the list and does not
- * hold a value. The value of next
is the first item in the
- * list. The value of of previous
is the last item in the list.
- */
- protected transient Node marker;
-
- /**
- * The size of the list.
- */
- protected transient int size;
-
- public CommonsLinkedList() {
- initializeEmptyList();
- }
-
- public CommonsLinkedList(Collection c) {
- initializeEmptyList();
- addAll(c);
- }
-
- /**
- * The equivalent of a default constructor, broken out so it can be called
- * by any constructor and by readObject
.
- * Subclasses which override this method should make sure they call it so
- * the list is initialised properly.
- */
- protected void initializeEmptyList() {
- marker = createNode();
- marker.next = marker;
- marker.previous = marker;
- }
-
- // Operations on nodes
-
- /**
- * Creates a new node with previous, next and element all set to null.
- *
- * @return newly created node
- */
- protected Node createNode() {
- return new Node();
- }
-
- /**
- * Creates a new node with the specified properties.
- *
- * @param previous node to precede the new node
- * @param next node to follow the new node
- * @param element element of the new node
- */
- protected Node createNode(Node previous, Node next, Object element) {
- return new Node(previous, next, element);
- }
-
- /**
- * Creates a new node with the specified object as its
- * elemnent
and inserts it before node
.
- *
- * @param node node to insert before
- * @param object element of the newly added node
- * @throws NullPointerException if node
is null
- */
- private void addNodeBefore(Node node, Object o) {
- Node newNode = createNode(node.previous, node, o);
- node.previous.next = newNode;
- node.previous = newNode;
- size++;
- modCount++;
- }
-
- /**
- * Creates a new node with the specified object as its
- * elemnent
and inserts it after node
.
- *
- * @param node node to insert after
- * @param o element of the newly added node
- * @throws NullPointerException if node
is null
- */
- protected void addNodeAfter(Node node, Object o) {
- Node newNode = createNode(node, node.next, o);
- node.next.previous = newNode;
- node.next = newNode;
- size++;
- modCount++;
- }
-
- /**
- * Removes the specified node.
- *
- * @param node the node to remove
- * @throws NullPointerException if node
is null
- */
- protected void removeNode(Node node) {
- node.previous.next = node.next;
- node.next.previous = node.previous;
- size--;
- modCount++;
- }
-
- /**
- * Removes all nodes by resetting the circular list marker.
- */
- protected void removeAllNodes() {
- marker.next = marker;
- marker.previous = marker;
- size = 0;
- modCount++;
- }
-
- /**
- * Gets the node at a particular index.
- *
- * @param index The index, starting from 0.
- * @param endMarkerAllowed Whether or not the end marker can be returned if
- * startIndex is set to the list's size.
- * @throws IndexOutOfBoundsException If the index is less than 0; equal to
- * the size of the list and endMakerAllowed is false; or greater than the
- * size of the list.
- */
- protected Node getNode(int index, boolean endMarkerAllowed) throws IndexOutOfBoundsException {
- // Check the index is within the bounds
- if (index < 0) {
- throw new IndexOutOfBoundsException("Couldn't get the node: " +
- "index (" + index + ") less than zero.");
- }
- if (!endMarkerAllowed && index == size) {
- throw new IndexOutOfBoundsException("Couldn't get the node: " +
- "index (" + index + ") is the size of the list.");
- }
- if (index > size) {
- throw new IndexOutOfBoundsException("Couldn't get the node: " +
- "index (" + index + ") greater than the size of the " +
- "list (" + size + ").");
- }
- // Search the list and get the node
- Node node;
- if (index < (size / 2)) {
- // Search forwards
- node = marker.next;
- for (int currentIndex = 0; currentIndex < index; currentIndex++) {
- node = node.next;
- }
- } else {
- // Search backwards
- node = marker;
- for (int currentIndex = size; currentIndex > index; currentIndex--) {
- node = node.previous;
- }
- }
- return node;
- }
-
- // List implementation required by AbstractSequentialList
-
- public ListIterator listIterator() {
- return new ListIteratorImpl();
- }
-
- public ListIterator listIterator(int startIndex) {
- return new ListIteratorImpl(startIndex);
- }
-
- public int size() {
- return size;
- }
-
- // List implementation not required by AbstractSequentialList, but provided
- // for efficiency or to override LinkedList's implementation.
-
- public void clear() {
- removeAllNodes();
- }
-
- public boolean add(Object o) {
- addLast(o);
- return true;
- }
-
- public void add(int index, Object element) {
- Node node = getNode(index, true);
- addNodeBefore(node, element);
- }
-
- public boolean addAll(Collection c) {
- return addAll(size, c);
- }
-
- public boolean addAll(int index, Collection c) {
- Node node = getNode(index, true);
- for (Iterator itr = c.iterator(); itr.hasNext();) {
- Object element = itr.next();
- addNodeBefore(node, element);
- }
- return true;
- }
-
- public Object get(int index) {
- Node node = getNode(index, false);
- return node.element;
- }
-
- public Object set(int index, Object element) {
- Node node = getNode(index, false);
- Object oldElement = node.element;
- node.element = element;
- return oldElement;
- }
-
- public Object remove(int index) {
- Node node = getNode(index, false);
- Object oldElement = node.element;
- removeNode(node);
- return oldElement;
- }
-
- public boolean remove(Object element) {
- for (Node node = marker.next; node != marker; node = node.next) {
- if (node.elementEquals(element)) {
- removeNode(node);
- return true;
- }
- }
- return false;
- }
-
- public int indexOf(Object element) {
- int i = 0;
- for (Node node = marker.next; node != marker; node = node.next) {
- if (node.elementEquals(element)) {
- return i;
- }
- i++;
- }
- return -1;
- }
-
- public int lastIndexOf(Object element) {
- int i = size - 1;
- for (Node node = marker.previous; node != marker; node = node.previous) {
- if (node.elementEquals(element)) {
- return i;
- }
- i--;
- }
- return -1;
- }
-
- public boolean contains(Object element) {
- return indexOf(element) != -1;
- }
-
- public Object[] toArray() {
- return toArray(new Object[size]);
- }
-
- public Object[] toArray(Object[] array) {
- // Extend the array if needed
- if (array.length < size) {
- Class componentType = array.getClass().getComponentType();
- array = (Object[]) Array.newInstance(componentType, size);
- }
- // Copy the values into the array
- Node node = marker.next;
- for (int i = 0; i < size; i++) {
- array[i] = node.element;
- node = node.next;
- }
- // Set the value after the last element to null
- if (array.length > size) {
- array[size] = null;
- }
- return array;
- }
- // Extra methods compatible with java.util.LinkedList.
-
- public Object getFirst() {
- Node node = marker.next;
- if (node == marker) {
- throw new NoSuchElementException();
- }
- return node.element;
- }
-
- public Object getLast() {
- Node node = marker.previous;
- if (node == marker) {
- throw new NoSuchElementException();
- }
- return node.element;
- }
-
- public void addFirst(Object o) {
- addNodeAfter(marker, o);
- }
-
- public void addLast(Object o) {
- addNodeBefore(marker, o);
- }
-
- public Object removeFirst() {
- Node node = marker.next;
- if (node == marker) {
- throw new NoSuchElementException();
- }
- Object oldElement = node.element;
- removeNode(node);
- return oldElement;
- }
-
- public Object removeLast() {
- Node node = marker.previous;
- if (node == marker) {
- throw new NoSuchElementException();
- }
- Object oldElement = node.element;
- removeNode(node);
- return oldElement;
- }
-
- // Serialization methods
-
- private void writeObject(ObjectOutputStream outputStream)
- throws IOException, ClassNotFoundException {
- outputStream.defaultWriteObject();
- // Write the size so we know how many nodes to read back
- outputStream.writeInt(size());
- for (Iterator itr = iterator(); itr.hasNext();) {
- outputStream.writeObject(itr.next());
- }
- }
-
- private void readObject(ObjectInputStream inputStream)
- throws IOException, ClassNotFoundException {
- inputStream.defaultReadObject();
- initializeEmptyList();
- int size = inputStream.readInt();
- for (int i = 0; i < size; i++) {
- add(inputStream.readObject());
- }
- }
-
-}
diff --git a/src/java/org/apache/commons/collections/MultiKey.java b/src/java/org/apache/commons/collections/MultiKey.java
deleted file mode 100644
index f8cdc3cce..000000000
--- a/src/java/org/apache/commons/collections/MultiKey.java
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/Attic/MultiKey.java,v 1.5 2003/12/05 20:23:57 scolebourne Exp $
- * ====================================================================
- *
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2003 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution, if
- * any, must include the following acknowledgement:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgement may appear in the software itself,
- * if and wherever such third-party acknowledgements normally appear.
- *
- * 4. The names "The Jakarta Project", "Commons", and "Apache Software
- * Foundation" must not be used to endorse or promote products derived
- * from this software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache"
- * nor may "Apache" appear in their names without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * MultiKey
allows multiple map keys to be merged together.
- *
- * The purpose of this class is to avoid the need to write code to handle - * maps of maps. An example might be the need to lookup a filename by - * key and locale. The typical solution might be nested maps. This class - * can be used instead by creating an instance passing in the key and locale. - * - * @deprecated WILL BE REMOVED BEFORE v3.0 - * @since Commons Collections 3.0 - * @version $Revision: 1.5 $ $Date: 2003/12/05 20:23:57 $ - * - * @author Howard Lewis Ship - * @author Stephen Colebourne - */ -public class MultiKey implements Serializable { - - private static final long serialVersionUID = 4465448607415788805L; - - /** The individual keys */ - private final Object[] keys; - /** The cached hashCode */ - private final int hashCode; - - /** - * Constructor taking two keys. - * - * @param key1 the first key - * @param key2 the second key - */ - public MultiKey(Object key1, Object key2) { - this(new Object[] {key1, key2}, false); - } - - /** - * Constructor taking three keys. - * - * @param key1 the first key - * @param key2 the second key - * @param key3 the third key - */ - public MultiKey(Object key1, Object key2, Object key3) { - this(new Object[] {key1, key2, key3}, false); - } - - /** - * Constructor taking four keys. - * - * @param key1 the first key - * @param key2 the second key - * @param key3 the third key - * @param key4 the fourth key - */ - public MultiKey(Object key1, Object key2, Object key3, Object key4) { - this(new Object[] {key1, key2, key3, key4}, false); - } - - /** - * Constructor taking five keys. - * - * @param key1 the first key - * @param key2 the second key - * @param key3 the third key - * @param key4 the fourth key - * @param key5 the fifth key - */ - public MultiKey(Object key1, Object key2, Object key3, Object key4, Object key5) { - this(new Object[] {key1, key2, key3, key4, key5}, false); - } - - /** - * Constructor taking an array of keys. - * - * @param keys the array of keys - * @throws IllegalArgumentException if the key array is null - */ - public MultiKey(Object[] keys) { - this(keys, true); - } - - /** - * Constructor taking an array of keys. - *
- * If the array is not copied, then it must not be modified. - * - * @param keys the array of keys - * @param makeCopy true to copy the array, false to assign it - * @throws IllegalArgumentException if the key array is null - */ - protected MultiKey(Object[] keys, boolean makeCopy) { - super(); - if (keys == null) { - throw new IllegalArgumentException("The array of keys must not be null"); - } - if (makeCopy) { - this.keys = (Object[]) keys.clone(); - } else { - this.keys = keys; - } - - int total = 0; - for (int i = 0; i < keys.length; i++) { - if (keys[i] != null) { - if (i == 0) { - total = keys[i].hashCode(); - } else { - total ^= keys[i].hashCode(); - } - } - } - hashCode = total; - } - - /** - * Gets a copy of the individual keys. - * - * @return the individual keys - */ - public Object[] getKeys() { - return (Object[]) keys.clone(); - } - - /** - * Compares this object to another. - *
- * To be equal, the other object must be a MultiKey
with the
- * same number of keys which are also equal.
- *
- * @param other the other object to compare to
- * @return true if equal
- */
- public boolean equals(Object other) {
- if (other == this) {
- return true;
- }
- if (other instanceof MultiKey) {
- MultiKey otherMulti = (MultiKey) other;
- return Arrays.equals(keys, otherMulti.keys);
- }
- return false;
- }
-
- /**
- * Gets the combined hashcode that is computed from all the keys.
- *
- * This value is computed once and then cached, so elements should not
- * change their hash codes once created (note that this is the same
- * constraint that would be used if the individual keys elements were
- * themselves {@link java.util.Map Map} keys.
- *
- * @return the hashcode
- */
- public int hashCode() {
- return hashCode;
- }
-
- /**
- * Gets a debugging string version of the key.
- *
- * @return a debugging string
- */
- public String toString() {
- return "MultiKey" + Arrays.asList(keys).toString();
- }
-
-}
diff --git a/src/java/org/apache/commons/collections/NodeCachingLinkedList.java b/src/java/org/apache/commons/collections/NodeCachingLinkedList.java
deleted file mode 100644
index 337f4f74d..000000000
--- a/src/java/org/apache/commons/collections/NodeCachingLinkedList.java
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
- * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/Attic/NodeCachingLinkedList.java,v 1.10 2003/12/11 00:18:06 scolebourne Exp $
- * ====================================================================
- *
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2002-2003 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution, if
- * any, must include the following acknowledgement:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgement may appear in the software itself,
- * if and wherever such third-party acknowledgements normally appear.
- *
- * 4. The names "The Jakarta Project", "Commons", and "Apache Software
- * Foundation" must not be used to endorse or promote products derived
- * from this software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache"
- * nor may "Apache" appear in their names without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * null
if no nodes are cached.
- * Cached nodes are stored in a singly-linked list with {@link Node#next}
- * pointing to the next element.
- */
- private transient Node firstCachedNode;
-
- /**
- * The size of the cache.
- */
- private transient int cacheSize = 0;
-
- /**
- * The maximum size of the cache.
- */
- private int maximumCacheSize = DEFAULT_MAXIMUM_CACHE_SIZE;
-
- /**
- * Constructor.
- */
- public NodeCachingLinkedList() {
- super();
- }
-
- /**
- * Constructor that copies the specified collection
- *
- * @param coll the collection to copy
- */
- public NodeCachingLinkedList(Collection coll) {
- super(coll);
- }
-
- /**
- * Constructor that species the maximum cache size.
- *
- * @param maximumCacheSize the maximum cache size
- */
- public NodeCachingLinkedList(int maximumCacheSize) {
- super();
- this.maximumCacheSize = maximumCacheSize;
- }
-
- // Cache operations
-
- /**
- * Gets the maximum size of the cache.
- */
- public int getMaximumCacheSize() {
- return maximumCacheSize;
- }
-
- /**
- * Sets the maximum size of the cache.
- */
- public void setMaximumCacheSize(int maximumCacheSize) {
- this.maximumCacheSize = maximumCacheSize;
- shrinkCacheToMaximumSize();
- }
-
- /**
- * Reduce the size of the cache to the maximum, if necessary.
- */
- private void shrinkCacheToMaximumSize() {
- // Rich Dougherty: This could be more efficient.
- while (cacheSize > maximumCacheSize) {
- getNodeFromCache();
- }
- }
-
- /**
- * Gets a node from the cache. If a node is returned, then the value of
- * {@link #cacheSize} is decreased accordingly. The node that is returned
- * will have null
values for next, previous and element.
- *
- * @return A node, or null
if there are no nodes in the cache.
- */
- private Node getNodeFromCache() {
- if (cacheSize == 0) {
- return null;
- }
- Node cachedNode = firstCachedNode;
- firstCachedNode = cachedNode.next;
- cachedNode.next = null; // This should be changed anyway, but defensively
- // set it to null.
- cacheSize--;
- return cachedNode;
- }
-
- private boolean cacheFull() {
- return cacheSize >= maximumCacheSize;
- }
-
- /**
- * Adds a node to the cache, if the cache isn't full. The node's contents
- * are cleared to so they can be garbage collected.
- */
- private void addNodeToCache(Node node) {
- if (cacheFull()) {
- // Don't cache the node.
- return;
- }
- // Clear the node's contents and add it to the cache.
- Node nextCachedNode = firstCachedNode;
- node.previous = null;
- node.next = nextCachedNode;
- node.element = null;
- firstCachedNode = node;
- cacheSize++;
- }
-
- // Node operations
-
- /**
- * Create a node, getting it from the cache if possible.
- */
- protected Node createNode() {
- Node cachedNode = getNodeFromCache();
- if (cachedNode == null) {
- return super.createNode();
- } else {
- return cachedNode;
- }
- }
-
- /**
- * Creates a new node with the specified properties, using a cached Node
- * if possible.
- *
- * @param previous node to precede the new node
- * @param next node to follow the new node
- * @param element element of the new node
- */
- protected Node createNode(Node previous, Node next, Object element) {
- Node cachedNode = getNodeFromCache();
- if (cachedNode == null) {
- return super.createNode(previous, next, element);
- } else {
- cachedNode.next = next;
- cachedNode.previous = previous;
- cachedNode.element = element;
- return cachedNode;
- }
- }
-
- /**
- * Calls the superclass' implementation then calls
- * addNodeToCache
on the node which has
- * been removed.
- */
- protected void removeNode(Node node) {
- super.removeNode(node);
- addNodeToCache(node);
- }
-
- protected void removeAllNodes() {
- // Add the removed nodes to the cache, then remove the rest.
- // We can add them to the cache before removing them, since
- // {@link CommonsLinkedList.removeAllNodes()} removes the
- // nodes by removing references directly from {@link #marker}.
- int numberOfNodesToCache = Math.min(size, maximumCacheSize - cacheSize);
- Node node = marker.next;
- for (int currentIndex = 0; currentIndex < numberOfNodesToCache; currentIndex++) {
- Node oldNode = node;
- node = node.next;
- addNodeToCache(oldNode);
- }
- super.removeAllNodes();
- }
-
-}
diff --git a/src/test/org/apache/commons/collections/TestAll.java b/src/test/org/apache/commons/collections/TestAll.java
index a323e5920..930ad665f 100644
--- a/src/test/org/apache/commons/collections/TestAll.java
+++ b/src/test/org/apache/commons/collections/TestAll.java
@@ -1,5 +1,5 @@
/*
- * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestAll.java,v 1.54 2003/11/16 20:35:46 scolebourne Exp $
+ * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestAll.java,v 1.55 2004/01/04 18:02:58 scolebourne Exp $
* ====================================================================
*
* The Apache Software License, Version 1.1
@@ -64,7 +64,7 @@ import junit.framework.TestSuite;
/**
* Entry point for all Collections package tests.
*
- * @version $Revision: 1.54 $ $Date: 2003/11/16 20:35:46 $
+ * @version $Revision: 1.55 $ $Date: 2004/01/04 18:02:58 $
*
* @author Rodney Waldhoff
* @author Stephen Colebourne
@@ -80,6 +80,7 @@ public class TestAll extends TestCase {
suite.addTest(TestClosureUtils.suite());
suite.addTest(TestCollectionUtils.suite());
suite.addTest(TestBufferUtils.suite());
+ suite.addTest(TestEnumerationUtils.suite());
suite.addTest(TestFactoryUtils.suite());
suite.addTest(TestListUtils.suite());
suite.addTest(TestMapUtils.suite());
@@ -92,8 +93,6 @@ public class TestAll extends TestCase {
suite.addTest(TestBinaryHeap.suite());
suite.addTest(TestBoundedFifoBuffer.suite());
suite.addTest(TestBoundedFifoBuffer2.suite());
- suite.addTest(TestCircularFifoBuffer.suite());
- suite.addTest(TestCommonsLinkedList.suite());
suite.addTest(TestCursorableLinkedList.suite());
suite.addTest(TestDoubleOrderedMap.suite());
suite.addTest(TestExtendedProperties.suite());
@@ -107,14 +106,11 @@ public class TestAll extends TestCase {
suite.addTest(TestIteratorUtils.suite());
suite.addTest(TestLRUMap.suite());
suite.addTest(TestMultiHashMap.suite());
- suite.addTest(TestMultiKey.suite());
- suite.addTest(TestNodeCachingLinkedList.suite());
suite.addTest(TestReferenceMap.suite());
suite.addTest(TestSequencedHashMap.suite());
suite.addTest(TestStaticBucketMap.suite());
suite.addTest(TestTreeBag.suite());
suite.addTest(TestUnboundedFifoBuffer.suite());
- suite.addTest(TestEnumerationUtils.suite());
return suite;
}
diff --git a/src/test/org/apache/commons/collections/TestCircularFifoBuffer.java b/src/test/org/apache/commons/collections/TestCircularFifoBuffer.java
deleted file mode 100644
index ed1dc3d01..000000000
--- a/src/test/org/apache/commons/collections/TestCircularFifoBuffer.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/*
- * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/Attic/TestCircularFifoBuffer.java,v 1.7 2003/11/18 22:37:16 scolebourne Exp $
- * ====================================================================
- *
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2001-2003 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution, if
- * any, must include the following acknowledgement:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgement may appear in the software itself,
- * if and wherever such third-party acknowledgements normally appear.
- *
- * 4. The names "The Jakarta Project", "Commons", and "Apache Software
- * Foundation" must not be used to endorse or promote products derived
- * from this software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache"
- * nor may "Apache" appear in their names without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- *