diff --git a/src/java/org/apache/commons/collections/primitives/AbstractByteCollection.java b/src/java/org/apache/commons/collections/primitives/AbstractByteCollection.java deleted file mode 100644 index db1ca3e32..000000000 --- a/src/java/org/apache/commons/collections/primitives/AbstractByteCollection.java +++ /dev/null @@ -1,177 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/AbstractByteCollection.java,v 1.3 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -/** - * Abstract base class for {@link ByteCollection}s. - *

- * Read-only subclasses must override {@link #iterator} - * and {@link #size}. Mutable subclasses - * should also override {@link #add} and - * {@link ByteIterator#remove ByteIterator.remove}. - * All other methods have at least some base implementation - * derived from these. Subclasses may choose to override - * these methods to provide a more efficient implementation. - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public abstract class AbstractByteCollection implements ByteCollection { - public abstract ByteIterator iterator(); - public abstract int size(); - - protected AbstractByteCollection() { } - - /** Unsupported in this base implementation. */ - public boolean add(byte element) { - throw new UnsupportedOperationException("add(byte) is not supported."); - } - - public boolean addAll(ByteCollection c) { - boolean modified = false; - for(ByteIterator iter = c.iterator(); iter.hasNext(); ) { - modified |= add(iter.next()); - } - return modified; - } - - public void clear() { - for(ByteIterator iter = iterator(); iter.hasNext();) { - iter.next(); - iter.remove(); - } - } - - public boolean contains(byte element) { - for(ByteIterator iter = iterator(); iter.hasNext();) { - if(iter.next() == element) { - return true; - } - } - return false; - } - - public boolean containsAll(ByteCollection c) { - for(ByteIterator iter = c.iterator(); iter.hasNext();) { - if(!contains(iter.next())) { - return false; - } - } - return true; - } - - public boolean isEmpty() { - return (0 == size()); - } - - public boolean removeElement(byte element) { - for(ByteIterator iter = iterator(); iter.hasNext();) { - if(iter.next() == element) { - iter.remove(); - return true; - } - } - return false; - } - - public boolean removeAll(ByteCollection c) { - boolean modified = false; - for(ByteIterator iter = c.iterator(); iter.hasNext(); ) { - modified |= removeElement(iter.next()); - } - return modified; - } - - public boolean retainAll(ByteCollection c) { - boolean modified = false; - for(ByteIterator iter = iterator(); iter.hasNext();) { - if(!c.contains(iter.next())) { - iter.remove(); - modified = true; - } - } - return modified; - } - - public byte[] toArray() { - byte[] array = new byte[size()]; - int i = 0; - for(ByteIterator iter = iterator(); iter.hasNext();) { - array[i] = iter.next(); - i++; - } - return array; - } - - public byte[] toArray(byte[] a) { - if(a.length < size()) { - return toArray(); - } else { - int i = 0; - for(ByteIterator iter = iterator(); iter.hasNext();) { - a[i] = iter.next(); - i++; - } - return a; - } - } -} diff --git a/src/java/org/apache/commons/collections/primitives/AbstractCharCollection.java b/src/java/org/apache/commons/collections/primitives/AbstractCharCollection.java deleted file mode 100644 index fde45aff5..000000000 --- a/src/java/org/apache/commons/collections/primitives/AbstractCharCollection.java +++ /dev/null @@ -1,177 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/AbstractCharCollection.java,v 1.3 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -/** - * Abstract base class for {@link CharCollection}s. - *

- * Read-only subclasses must override {@link #iterator} - * and {@link #size}. Mutable subclasses - * should also override {@link #add} and - * {@link CharIterator#remove CharIterator.remove}. - * All other methods have at least some base implementation - * derived from these. Subclasses may choose to override - * these methods to provide a more efficient implementation. - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public abstract class AbstractCharCollection implements CharCollection { - public abstract CharIterator iterator(); - public abstract int size(); - - protected AbstractCharCollection() { } - - /** Unsupported in this base implementation. */ - public boolean add(char element) { - throw new UnsupportedOperationException("add(char) is not supported."); - } - - public boolean addAll(CharCollection c) { - boolean modified = false; - for(CharIterator iter = c.iterator(); iter.hasNext(); ) { - modified |= add(iter.next()); - } - return modified; - } - - public void clear() { - for(CharIterator iter = iterator(); iter.hasNext();) { - iter.next(); - iter.remove(); - } - } - - public boolean contains(char element) { - for(CharIterator iter = iterator(); iter.hasNext();) { - if(iter.next() == element) { - return true; - } - } - return false; - } - - public boolean containsAll(CharCollection c) { - for(CharIterator iter = c.iterator(); iter.hasNext();) { - if(!contains(iter.next())) { - return false; - } - } - return true; - } - - public boolean isEmpty() { - return (0 == size()); - } - - public boolean removeElement(char element) { - for(CharIterator iter = iterator(); iter.hasNext();) { - if(iter.next() == element) { - iter.remove(); - return true; - } - } - return false; - } - - public boolean removeAll(CharCollection c) { - boolean modified = false; - for(CharIterator iter = c.iterator(); iter.hasNext(); ) { - modified |= removeElement(iter.next()); - } - return modified; - } - - public boolean retainAll(CharCollection c) { - boolean modified = false; - for(CharIterator iter = iterator(); iter.hasNext();) { - if(!c.contains(iter.next())) { - iter.remove(); - modified = true; - } - } - return modified; - } - - public char[] toArray() { - char[] array = new char[size()]; - int i = 0; - for(CharIterator iter = iterator(); iter.hasNext();) { - array[i] = iter.next(); - i++; - } - return array; - } - - public char[] toArray(char[] a) { - if(a.length < size()) { - return toArray(); - } else { - int i = 0; - for(CharIterator iter = iterator(); iter.hasNext();) { - a[i] = iter.next(); - i++; - } - return a; - } - } -} diff --git a/src/java/org/apache/commons/collections/primitives/AbstractDoubleCollection.java b/src/java/org/apache/commons/collections/primitives/AbstractDoubleCollection.java deleted file mode 100644 index 841959a61..000000000 --- a/src/java/org/apache/commons/collections/primitives/AbstractDoubleCollection.java +++ /dev/null @@ -1,177 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/AbstractDoubleCollection.java,v 1.3 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -/** - * Abstract base class for {@link DoubleCollection}s. - *

- * Read-only subclasses must override {@link #iterator} - * and {@link #size}. Mutable subclasses - * should also override {@link #add} and - * {@link DoubleIterator#remove DoubleIterator.remove}. - * All other methods have at least some base implementation - * derived from these. Subclasses may choose to override - * these methods to provide a more efficient implementation. - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public abstract class AbstractDoubleCollection implements DoubleCollection { - public abstract DoubleIterator iterator(); - public abstract int size(); - - protected AbstractDoubleCollection() { } - - /** Unsupported in this base implementation. */ - public boolean add(double element) { - throw new UnsupportedOperationException("add(double) is not supported."); - } - - public boolean addAll(DoubleCollection c) { - boolean modified = false; - for(DoubleIterator iter = c.iterator(); iter.hasNext(); ) { - modified |= add(iter.next()); - } - return modified; - } - - public void clear() { - for(DoubleIterator iter = iterator(); iter.hasNext();) { - iter.next(); - iter.remove(); - } - } - - public boolean contains(double element) { - for(DoubleIterator iter = iterator(); iter.hasNext();) { - if(iter.next() == element) { - return true; - } - } - return false; - } - - public boolean containsAll(DoubleCollection c) { - for(DoubleIterator iter = c.iterator(); iter.hasNext();) { - if(!contains(iter.next())) { - return false; - } - } - return true; - } - - public boolean isEmpty() { - return (0 == size()); - } - - public boolean removeElement(double element) { - for(DoubleIterator iter = iterator(); iter.hasNext();) { - if(iter.next() == element) { - iter.remove(); - return true; - } - } - return false; - } - - public boolean removeAll(DoubleCollection c) { - boolean modified = false; - for(DoubleIterator iter = c.iterator(); iter.hasNext(); ) { - modified |= removeElement(iter.next()); - } - return modified; - } - - public boolean retainAll(DoubleCollection c) { - boolean modified = false; - for(DoubleIterator iter = iterator(); iter.hasNext();) { - if(!c.contains(iter.next())) { - iter.remove(); - modified = true; - } - } - return modified; - } - - public double[] toArray() { - double[] array = new double[size()]; - int i = 0; - for(DoubleIterator iter = iterator(); iter.hasNext();) { - array[i] = iter.next(); - i++; - } - return array; - } - - public double[] toArray(double[] a) { - if(a.length < size()) { - return toArray(); - } else { - int i = 0; - for(DoubleIterator iter = iterator(); iter.hasNext();) { - a[i] = iter.next(); - i++; - } - return a; - } - } -} diff --git a/src/java/org/apache/commons/collections/primitives/AbstractFloatCollection.java b/src/java/org/apache/commons/collections/primitives/AbstractFloatCollection.java deleted file mode 100644 index b3115db0e..000000000 --- a/src/java/org/apache/commons/collections/primitives/AbstractFloatCollection.java +++ /dev/null @@ -1,177 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/AbstractFloatCollection.java,v 1.3 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -/** - * Abstract base class for {@link FloatCollection}s. - *

- * Read-only subclasses must override {@link #iterator} - * and {@link #size}. Mutable subclasses - * should also override {@link #add} and - * {@link FloatIterator#remove FloatIterator.remove}. - * All other methods have at least some base implementation - * derived from these. Subclasses may choose to override - * these methods to provide a more efficient implementation. - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public abstract class AbstractFloatCollection implements FloatCollection { - public abstract FloatIterator iterator(); - public abstract int size(); - - protected AbstractFloatCollection() { } - - /** Unsupported in this base implementation. */ - public boolean add(float element) { - throw new UnsupportedOperationException("add(float) is not supported."); - } - - public boolean addAll(FloatCollection c) { - boolean modified = false; - for(FloatIterator iter = c.iterator(); iter.hasNext(); ) { - modified |= add(iter.next()); - } - return modified; - } - - public void clear() { - for(FloatIterator iter = iterator(); iter.hasNext();) { - iter.next(); - iter.remove(); - } - } - - public boolean contains(float element) { - for(FloatIterator iter = iterator(); iter.hasNext();) { - if(iter.next() == element) { - return true; - } - } - return false; - } - - public boolean containsAll(FloatCollection c) { - for(FloatIterator iter = c.iterator(); iter.hasNext();) { - if(!contains(iter.next())) { - return false; - } - } - return true; - } - - public boolean isEmpty() { - return (0 == size()); - } - - public boolean removeElement(float element) { - for(FloatIterator iter = iterator(); iter.hasNext();) { - if(iter.next() == element) { - iter.remove(); - return true; - } - } - return false; - } - - public boolean removeAll(FloatCollection c) { - boolean modified = false; - for(FloatIterator iter = c.iterator(); iter.hasNext(); ) { - modified |= removeElement(iter.next()); - } - return modified; - } - - public boolean retainAll(FloatCollection c) { - boolean modified = false; - for(FloatIterator iter = iterator(); iter.hasNext();) { - if(!c.contains(iter.next())) { - iter.remove(); - modified = true; - } - } - return modified; - } - - public float[] toArray() { - float[] array = new float[size()]; - int i = 0; - for(FloatIterator iter = iterator(); iter.hasNext();) { - array[i] = iter.next(); - i++; - } - return array; - } - - public float[] toArray(float[] a) { - if(a.length < size()) { - return toArray(); - } else { - int i = 0; - for(FloatIterator iter = iterator(); iter.hasNext();) { - a[i] = iter.next(); - i++; - } - return a; - } - } -} diff --git a/src/java/org/apache/commons/collections/primitives/AbstractIntCollection.java b/src/java/org/apache/commons/collections/primitives/AbstractIntCollection.java deleted file mode 100644 index 82648d2b4..000000000 --- a/src/java/org/apache/commons/collections/primitives/AbstractIntCollection.java +++ /dev/null @@ -1,177 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/AbstractIntCollection.java,v 1.7 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -/** - * Abstract base class for {@link IntCollection}s. - *

- * Read-only subclasses must override {@link #iterator} - * and {@link #size}. Mutable subclasses - * should also override {@link #add} and - * {@link IntIterator#remove IntIterator.remove}. - * All other methods have at least some base implementation - * derived from these. Subclasses may choose to override - * these methods to provide a more efficient implementation. - * - * @since Commons Collections 2.2 - * @version $Revision: 1.7 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public abstract class AbstractIntCollection implements IntCollection { - public abstract IntIterator iterator(); - public abstract int size(); - - protected AbstractIntCollection() { } - - /** Unsupported in this base implementation. */ - public boolean add(int element) { - throw new UnsupportedOperationException("add(int) is not supported."); - } - - public boolean addAll(IntCollection c) { - boolean modified = false; - for(IntIterator iter = c.iterator(); iter.hasNext(); ) { - modified |= add(iter.next()); - } - return modified; - } - - public void clear() { - for(IntIterator iter = iterator(); iter.hasNext();) { - iter.next(); - iter.remove(); - } - } - - public boolean contains(int element) { - for(IntIterator iter = iterator(); iter.hasNext();) { - if(iter.next() == element) { - return true; - } - } - return false; - } - - public boolean containsAll(IntCollection c) { - for(IntIterator iter = c.iterator(); iter.hasNext();) { - if(!contains(iter.next())) { - return false; - } - } - return true; - } - - public boolean isEmpty() { - return (0 == size()); - } - - public boolean removeElement(int element) { - for(IntIterator iter = iterator(); iter.hasNext();) { - if(iter.next() == element) { - iter.remove(); - return true; - } - } - return false; - } - - public boolean removeAll(IntCollection c) { - boolean modified = false; - for(IntIterator iter = c.iterator(); iter.hasNext(); ) { - modified |= removeElement(iter.next()); - } - return modified; - } - - public boolean retainAll(IntCollection c) { - boolean modified = false; - for(IntIterator iter = iterator(); iter.hasNext();) { - if(!c.contains(iter.next())) { - iter.remove(); - modified = true; - } - } - return modified; - } - - public int[] toArray() { - int[] array = new int[size()]; - int i = 0; - for(IntIterator iter = iterator(); iter.hasNext();) { - array[i] = iter.next(); - i++; - } - return array; - } - - public int[] toArray(int[] a) { - if(a.length < size()) { - return toArray(); - } else { - int i = 0; - for(IntIterator iter = iterator(); iter.hasNext();) { - a[i] = iter.next(); - i++; - } - return a; - } - } -} diff --git a/src/java/org/apache/commons/collections/primitives/AbstractLongCollection.java b/src/java/org/apache/commons/collections/primitives/AbstractLongCollection.java deleted file mode 100644 index a568f348e..000000000 --- a/src/java/org/apache/commons/collections/primitives/AbstractLongCollection.java +++ /dev/null @@ -1,177 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/AbstractLongCollection.java,v 1.3 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -/** - * Abstract base class for {@link LongCollection}s. - *

- * Read-only subclasses must override {@link #iterator} - * and {@link #size}. Mutable subclasses - * should also override {@link #add} and - * {@link LongIterator#remove LongIterator.remove}. - * All other methods have at least some base implementation - * derived from these. Subclasses may choose to override - * these methods to provide a more efficient implementation. - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public abstract class AbstractLongCollection implements LongCollection { - public abstract LongIterator iterator(); - public abstract int size(); - - protected AbstractLongCollection() { } - - /** Unsupported in this base implementation. */ - public boolean add(long element) { - throw new UnsupportedOperationException("add(long) is not supported."); - } - - public boolean addAll(LongCollection c) { - boolean modified = false; - for(LongIterator iter = c.iterator(); iter.hasNext(); ) { - modified |= add(iter.next()); - } - return modified; - } - - public void clear() { - for(LongIterator iter = iterator(); iter.hasNext();) { - iter.next(); - iter.remove(); - } - } - - public boolean contains(long element) { - for(LongIterator iter = iterator(); iter.hasNext();) { - if(iter.next() == element) { - return true; - } - } - return false; - } - - public boolean containsAll(LongCollection c) { - for(LongIterator iter = c.iterator(); iter.hasNext();) { - if(!contains(iter.next())) { - return false; - } - } - return true; - } - - public boolean isEmpty() { - return (0 == size()); - } - - public boolean removeElement(long element) { - for(LongIterator iter = iterator(); iter.hasNext();) { - if(iter.next() == element) { - iter.remove(); - return true; - } - } - return false; - } - - public boolean removeAll(LongCollection c) { - boolean modified = false; - for(LongIterator iter = c.iterator(); iter.hasNext(); ) { - modified |= removeElement(iter.next()); - } - return modified; - } - - public boolean retainAll(LongCollection c) { - boolean modified = false; - for(LongIterator iter = iterator(); iter.hasNext();) { - if(!c.contains(iter.next())) { - iter.remove(); - modified = true; - } - } - return modified; - } - - public long[] toArray() { - long[] array = new long[size()]; - int i = 0; - for(LongIterator iter = iterator(); iter.hasNext();) { - array[i] = iter.next(); - i++; - } - return array; - } - - public long[] toArray(long[] a) { - if(a.length < size()) { - return toArray(); - } else { - int i = 0; - for(LongIterator iter = iterator(); iter.hasNext();) { - a[i] = iter.next(); - i++; - } - return a; - } - } -} diff --git a/src/java/org/apache/commons/collections/primitives/AbstractLongList.java b/src/java/org/apache/commons/collections/primitives/AbstractLongList.java deleted file mode 100644 index dd17c09a3..000000000 --- a/src/java/org/apache/commons/collections/primitives/AbstractLongList.java +++ /dev/null @@ -1,395 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/AbstractLongList.java,v 1.8 2003/10/09 09:52:56 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -import java.util.AbstractList; - -/** - * Abstract base class for lists of primitive long elements.

- * - * The {@link java.util.List List} methods are all implemented, but they forward to - * abstract methods that operate on long elements. For - * instance, the {@link #get(int)} method simply forwards to - * {@link #getLong(int)}. The primitive long that is - * returned from {@link #getLong(int)} is wrapped in a {@link java.lang.Long} - * and returned from {@link #get(int)}.

- * - * Concrete implementations offer substantial memory savings by not storing - * primitives as wrapped objects. If you exclusively use the primitive - * signatures, there can also be substantial performance gains, since - * temporary wrapper objects do not need to be created.

- * - * To implement a read-only list of long elements, you need - * only implement the {@link #getLong(int)} and {@link #size()} methods. - * To implement a modifiable list, you will also need to implement the - * {@link #setLong(int,long)}, {@link #addLong(int,long)}, - * {@link #removeLongAt(int)} and {@link #clear()} methods. You may want - * to override the other methods to increase performance.

- * - * @version $Revision: 1.8 $ $Date: 2003/10/09 09:52:56 $ - * @author Rodney Waldhoff - * @deprecated This should have been removed all with several other types that extended the Object-based ones - */ -public abstract class AbstractLongList extends AbstractList { - - //------------------------------------------------------ Abstract Accessors - - /** - * Returns the number of long elements currently in this - * list. - * - * @return the size of this list - */ - abstract public int size(); - - /** - * Returns the long element at the specified index in this - * array. - * - * @param index the index of the element to return - * @return the long element at that index - * @throws IndexOutOfBoundsException if the index is negative or - * greater than or equal to {@link #size()} - */ - abstract public long getLong(int index); - - //--------------------------------------------------------------- Accessors - - /** - * Returns true if this list contains the given - * long element. The default implementation uses - * {@link #indexOfLong(long)} to determine if the given value is - * in this list. - * - * @param value the element to search for - * @return true if this list contains the given value, false otherwise - */ - public boolean containsLong(long value) { - return indexOfLong(value) >= 0; - } - - /** - * Returns the first index of the given long element, or - * -1 if the value is not in this list. The default implementation is: - * - *

-     *   for (int i = 0; i < size(); i++) {
-     *       if (getLong(i) == value) return i;
-     *   }
-     *   return -1;
-     *  
- * - * @param value the element to search for - * @return the first index of that element, or -1 if the element is - * not in this list - */ - public int indexOfLong(long value) { - for (int i = 0; i < size(); i++) { - if (getLong(i) == value) return i; - } - return -1; - } - - /** - * Returns the last index of the given long element, or - * -1 if the value is not in this list. The default implementation is: - * - *
-     *   for (int i = size() - 1; i >= 0; i--) {
-     *       if (getLong(i) == value) return i;
-     *   }
-     *   return -1;
-     *  
- * - * @param value the element to search for - * @return the last index of that element, or -1 if the element is - * not in this list - */ - public int lastIndexOfLong(long value) { - for (int i = size() - 1; i >= 0; i--) { - if (getLong(i) == value) return i; - } - return -1; - } - - /** - * Returns new Long({@link #getLong getLong(index)}). - * - * @param index the index of the element to return - * @return an {@link Long} object wrapping the long - * value at that index - * @throws IndexOutOfBoundsException if the index is negative or - * greater than or equal to {@link #size()} - */ - public Object get(int index) { - return new Long(getLong(index)); - } - - /** - * Returns {@link #containsLong containsLong(((Long)value).longValue())}. - * - * @param value an {@link Long} object whose wrapped long - * value to search for - * @return true if this list contains that long value - * @throws ClassCastException if the given object is not an - * {@link Long} - * @throws NullPointerException if the given object is null - */ - public boolean contains(Object value) { - return containsLong(((Long)value).longValue()); - } - - /** - * Returns ({@link #size} == 0). - * - * @return true if this list is empty, false otherwise - */ - public boolean isEmpty() { - return (0 == size()); - } - - /** - * Returns {@link #indexOfLong indexOfLong(((Long).longValue())}. - * - * @param value an {@link Long} object whose wrapped long - * value to search for - * @return the first index of that long value, or -1 if - * this list does not contain that value - * @throws ClassCastException if the given object is not an - * {@link Long} - * @throws NullPointerException if the given object is null - */ - public int indexOf(Object value) { - return indexOfLong(((Long)value).longValue()); - } - - /** - * Returns {@link #lastIndexOfLong lastIndexOfLong(((Long).longValue())}. - * - * @param value an {@link Long} object whose wrapped long - * value to search for - * @return the last index of that long value, or -1 if - * this list does not contain that value - * @throws ClassCastException if the given object is not an - * {@link Long} - * @throws NullPointerException if the given object is null - */ - public int lastIndexOf(Object value) { - return lastIndexOfLong(((Long)value).longValue()); - } - - //------------------------------------------------------ Abstract Modifiers - - /** - * Sets the element at the given index to the given long - * value. - * - * @param index the index of the element to set - * @param value the long value to set it to - * @return the previous long value at that index - * @throws IndexOutOfBoundsException if the index is negative or - * greater than or equal to {@link #size()}. - */ - abstract public long setLong(int index, long value); - - /** - * Inserts the given long value into this list at the - * specified index. - * - * @param index the index for the insertion - * @param value the value to insert at that index - * @throws IndexOutOfBoundsException if the index is negative or - * greater than {@link #size()} - */ - abstract public void addLong(int index, long value); - - /** - * Removes the long element at the specified index. - * - * @param index the index of the element to remove - * @return the removed long value - * @throws IndexOutOfBoundsException if the index is negative or - * greater than or equal to {@link #size()} - */ - abstract public long removeLongAt(int index); - - /** - * Removes all long values from this list. - */ - abstract public void clear(); - - //--------------------------------------------------------------- Modifiers - - /** - * Adds the given long value to the end of this list. - * The default implementation invokes {@link #addLong(int,long) - * addLong(size(), value)}. - * - * @param value the value to add - * @return true, always - */ - public boolean addLong(long value) { - addLong(size(), value); - return true; - } - - /** - * Removes the first occurrence of the given long value - * from this list. The default implementation is: - * - *
-     *   int i = indexOfLong(value);
-     *   if (i < 0) return false;
-     *   removeLongAt(i);
-     *   return true;
-     *  
- * - * @param value the value to remove - * @return true if this list contained that value and removed it, - * or false if this list didn't contain the value - */ - public boolean removeLong(long value) { - int i = indexOfLong(value); - if (i < 0) return false; - removeLongAt(i); - return true; - } - - /** - * Returns new Long({@link #setLong(int,long) - * setLong(index,((Long).longValue())}). - * - * @param index the index of the element to set - * @param value an {@link Long} object whose long value - * to set at that index - * @return an {@link Long} that wraps the long value - * previously at that index - * @throws IndexOutOfBoundsException if the index is negative or greater - * than or equal to {@link #size()} - * @throws ClassCastException if the given value is not an {@link Long} - * @throws NullPointerException if the given value is null - */ - public Object set(int index, Object value) { - return new Long(setLong(index,((Long)value).longValue())); - } - - /** - * Invokes {@link #addLong(long) addLong(((Long)value).longValue())}). - * - * @param value an {@link Long} object that wraps the long - * value to add - * @return true, always - * @throws ClassCastException if the given value is not an {@link Long} - * @throws NullPointerException if the given value is null - */ - public boolean add(Object value) { - return addLong(((Long)value).longValue()); - } - - /** - * Invokes {@link #addLong(int,long) addLong(index,((Long)value).longValue())}). - * - * @param index the index of the insertion - * @param value an {@link Long} object that wraps the long - * value to insert - * @throws IndexOutOfBoundsException if the index is negative or greater - * than {@link #size()} - * @throws ClassCastException if the given value is not an {@link Long} - * @throws NullPointerException if the given value is null - */ - public void add(int index, Object value) { - addLong(index,((Long)value).longValue()); - } - - /** - * Returns new Long({@link #removeLongAt(int) removeLongAt(index)}). - * - * @param index the index of the element to remove - * @return an {@link Long} object that wraps the value that was - * removed from that index - * @throws IndexOutOfBoundsException if the given index is negative - * or greater than or equal to {@link #size()} - */ - public Object remove(int index) { - return new Long(removeLongAt(index)); - } - - /** - * Returns {@link #removeLong(long) removeLong(((Long)value).longValue())}. - * - * @param value an {@link Long} object that wraps the long - * value to remove - * @return true if the first occurrence of that long value - * was removed from this list, or false if this list - * did not contain that long value - * @throws ClassCastException if the given value is not an {@link Long} - * @throws NullPointerException if the given value is null - */ - public boolean remove(Object value) { - return removeLong(((Long)value).longValue()); - } -} - - - - //--------------------------------------------------------------- Accessors - - - - - diff --git a/src/java/org/apache/commons/collections/primitives/AbstractShortCollection.java b/src/java/org/apache/commons/collections/primitives/AbstractShortCollection.java deleted file mode 100644 index 8151154e7..000000000 --- a/src/java/org/apache/commons/collections/primitives/AbstractShortCollection.java +++ /dev/null @@ -1,177 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/AbstractShortCollection.java,v 1.3 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -/** - * Abstract base class for {@link ShortCollection}s. - *

- * Read-only subclasses must override {@link #iterator} - * and {@link #size}. Mutable subclasses - * should also override {@link #add} and - * {@link ShortIterator#remove ShortIterator.remove}. - * All other methods have at least some base implementation - * derived from these. Subclasses may choose to override - * these methods to provide a more efficient implementation. - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public abstract class AbstractShortCollection implements ShortCollection { - public abstract ShortIterator iterator(); - public abstract int size(); - - protected AbstractShortCollection() { } - - /** Unsupported in this base implementation. */ - public boolean add(short element) { - throw new UnsupportedOperationException("add(short) is not supported."); - } - - public boolean addAll(ShortCollection c) { - boolean modified = false; - for(ShortIterator iter = c.iterator(); iter.hasNext(); ) { - modified |= add(iter.next()); - } - return modified; - } - - public void clear() { - for(ShortIterator iter = iterator(); iter.hasNext();) { - iter.next(); - iter.remove(); - } - } - - public boolean contains(short element) { - for(ShortIterator iter = iterator(); iter.hasNext();) { - if(iter.next() == element) { - return true; - } - } - return false; - } - - public boolean containsAll(ShortCollection c) { - for(ShortIterator iter = c.iterator(); iter.hasNext();) { - if(!contains(iter.next())) { - return false; - } - } - return true; - } - - public boolean isEmpty() { - return (0 == size()); - } - - public boolean removeElement(short element) { - for(ShortIterator iter = iterator(); iter.hasNext();) { - if(iter.next() == element) { - iter.remove(); - return true; - } - } - return false; - } - - public boolean removeAll(ShortCollection c) { - boolean modified = false; - for(ShortIterator iter = c.iterator(); iter.hasNext(); ) { - modified |= removeElement(iter.next()); - } - return modified; - } - - public boolean retainAll(ShortCollection c) { - boolean modified = false; - for(ShortIterator iter = iterator(); iter.hasNext();) { - if(!c.contains(iter.next())) { - iter.remove(); - modified = true; - } - } - return modified; - } - - public short[] toArray() { - short[] array = new short[size()]; - int i = 0; - for(ShortIterator iter = iterator(); iter.hasNext();) { - array[i] = iter.next(); - i++; - } - return array; - } - - public short[] toArray(short[] a) { - if(a.length < size()) { - return toArray(); - } else { - int i = 0; - for(ShortIterator iter = iterator(); iter.hasNext();) { - a[i] = iter.next(); - i++; - } - return a; - } - } -} diff --git a/src/java/org/apache/commons/collections/primitives/ArrayByteList.java b/src/java/org/apache/commons/collections/primitives/ArrayByteList.java deleted file mode 100644 index 0e0fdb05a..000000000 --- a/src/java/org/apache/commons/collections/primitives/ArrayByteList.java +++ /dev/null @@ -1,267 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/ArrayByteList.java,v 1.3 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.Serializable; - -/** - * An {@link ByteList} backed by an array of bytes. - * This implementation supports all optional methods. - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public class ArrayByteList extends RandomAccessByteList implements ByteList, Serializable { - - // constructors - //------------------------------------------------------------------------- - - /** - * Construct an empty list with the default - * initial capacity. - */ - public ArrayByteList() { - this(8); - } - - /** - * Construct an empty list with the given - * initial capacity. - * @throws IllegalArgumentException when initialCapacity is negative - */ - public ArrayByteList(int initialCapacity) { - if(initialCapacity < 0) { - throw new IllegalArgumentException("capacity " + initialCapacity); - } - _data = new byte[initialCapacity]; - _size = 0; - } - - /** - * Constructs a list containing the elements of the given collection, - * in the order they are returned by that collection's iterator. - * - * @see ArrayByteList#addAll(org.apache.commons.collections.primitives.ByteCollection) - * @param that the non-null collection of bytes - * to add - * @throws NullPointerException if that is null - */ - public ArrayByteList(ByteCollection that) { - this(that.size()); - addAll(that); - } - - // ByteList methods - //------------------------------------------------------------------------- - - public byte get(int index) { - checkRange(index); - return _data[index]; - } - - public int size() { - return _size; - } - - /** - * Removes the element at the specified position in - * (optional operation). Any subsequent elements - * are shifted to the left, subtracting one from their - * indices. Returns the element that was removed. - * - * @param index the index of the element to remove - * @return the value of the element that was removed - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - public byte removeElementAt(int index) { - checkRange(index); - incrModCount(); - byte oldval = _data[index]; - int numtomove = _size - index - 1; - if(numtomove > 0) { - System.arraycopy(_data,index+1,_data,index,numtomove); - } - _size--; - return oldval; - } - - /** - * Replaces the element at the specified - * position in me with the specified element - * (optional operation). - * - * @param index the index of the element to change - * @param element the value to be stored at the specified position - * @return the value previously stored at the specified position - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - public byte set(int index, byte element) { - checkRange(index); - incrModCount(); - byte oldval = _data[index]; - _data[index] = element; - return oldval; - } - - /** - * Inserts the specified element at the specified position - * (optional operation). Shifts the element currently - * at that position (if any) and any subsequent elements to the - * right, increasing their indices. - * - * @param index the index at which to insert the element - * @param element the value to insert - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException if some aspect of the specified element - * prevents it from being added to me - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - public void add(int index, byte element) { - checkRangeIncludingEndpoint(index); - incrModCount(); - ensureCapacity(_size+1); - int numtomove = _size-index; - System.arraycopy(_data,index,_data,index+1,numtomove); - _data[index] = element; - _size++; - } - - // capacity methods - //------------------------------------------------------------------------- - - /** - * Increases my capacity, if necessary, to ensure that I can hold at - * least the number of elements specified by the minimum capacity - * argument without growing. - */ - public void ensureCapacity(int mincap) { - incrModCount(); - if(mincap > _data.length) { - int newcap = (_data.length * 3)/2 + 1; - byte[] olddata = _data; - _data = new byte[newcap < mincap ? mincap : newcap]; - System.arraycopy(olddata,0,_data,0,_size); - } - } - - /** - * Reduce my capacity, if necessary, to match my - * current {@link #size size}. - */ - public void trimToSize() { - incrModCount(); - if(_size < _data.length) { - byte[] olddata = _data; - _data = new byte[_size]; - System.arraycopy(olddata,0,_data,0,_size); - } - } - - // private methods - //------------------------------------------------------------------------- - - private void writeObject(ObjectOutputStream out) throws IOException{ - out.defaultWriteObject(); - out.writeInt(_data.length); - for(int i=0;i<_size;i++) { - out.writeByte(_data[i]); - } - } - - private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { - in.defaultReadObject(); - _data = new byte[in.readInt()]; - for(int i=0;i<_size;i++) { - _data[i] = in.readByte(); - } - } - - private final void checkRange(int index) { - if(index < 0 || index >= _size) { - throw new IndexOutOfBoundsException("Should be at least 0 and less than " + _size + ", found " + index); - } - } - - private final void checkRangeIncludingEndpoint(int index) { - if(index < 0 || index > _size) { - throw new IndexOutOfBoundsException("Should be at least 0 and at most " + _size + ", found " + index); - } - } - - // attributes - //------------------------------------------------------------------------- - - private transient byte[] _data = null; - private int _size = 0; - -} diff --git a/src/java/org/apache/commons/collections/primitives/ArrayCharList.java b/src/java/org/apache/commons/collections/primitives/ArrayCharList.java deleted file mode 100644 index 3985fa7f5..000000000 --- a/src/java/org/apache/commons/collections/primitives/ArrayCharList.java +++ /dev/null @@ -1,267 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/ArrayCharList.java,v 1.3 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.Serializable; - -/** - * An {@link CharList} backed by an array of chars. - * This implementation supports all optional methods. - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public class ArrayCharList extends RandomAccessCharList implements CharList, Serializable { - - // constructors - //------------------------------------------------------------------------- - - /** - * Construct an empty list with the default - * initial capacity. - */ - public ArrayCharList() { - this(8); - } - - /** - * Construct an empty list with the given - * initial capacity. - * @throws IllegalArgumentException when initialCapacity is negative - */ - public ArrayCharList(int initialCapacity) { - if(initialCapacity < 0) { - throw new IllegalArgumentException("capacity " + initialCapacity); - } - _data = new char[initialCapacity]; - _size = 0; - } - - /** - * Constructs a list containing the elements of the given collection, - * in the order they are returned by that collection's iterator. - * - * @see ArrayCharList#addAll(org.apache.commons.collections.primitives.CharCollection) - * @param that the non-null collection of chars - * to add - * @throws NullPointerException if that is null - */ - public ArrayCharList(CharCollection that) { - this(that.size()); - addAll(that); - } - - // CharList methods - //------------------------------------------------------------------------- - - public char get(int index) { - checkRange(index); - return _data[index]; - } - - public int size() { - return _size; - } - - /** - * Removes the element at the specified position in - * (optional operation). Any subsequent elements - * are shifted to the left, subtracting one from their - * indices. Returns the element that was removed. - * - * @param index the index of the element to remove - * @return the value of the element that was removed - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - public char removeElementAt(int index) { - checkRange(index); - incrModCount(); - char oldval = _data[index]; - int numtomove = _size - index - 1; - if(numtomove > 0) { - System.arraycopy(_data,index+1,_data,index,numtomove); - } - _size--; - return oldval; - } - - /** - * Replaces the element at the specified - * position in me with the specified element - * (optional operation). - * - * @param index the index of the element to change - * @param element the value to be stored at the specified position - * @return the value previously stored at the specified position - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - public char set(int index, char element) { - checkRange(index); - incrModCount(); - char oldval = _data[index]; - _data[index] = element; - return oldval; - } - - /** - * Inserts the specified element at the specified position - * (optional operation). Shifts the element currently - * at that position (if any) and any subsequent elements to the - * right, increasing their indices. - * - * @param index the index at which to insert the element - * @param element the value to insert - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException if some aspect of the specified element - * prevents it from being added to me - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - public void add(int index, char element) { - checkRangeIncludingEndpoint(index); - incrModCount(); - ensureCapacity(_size+1); - int numtomove = _size-index; - System.arraycopy(_data,index,_data,index+1,numtomove); - _data[index] = element; - _size++; - } - - // capacity methods - //------------------------------------------------------------------------- - - /** - * Increases my capacity, if necessary, to ensure that I can hold at - * least the number of elements specified by the minimum capacity - * argument without growing. - */ - public void ensureCapacity(int mincap) { - incrModCount(); - if(mincap > _data.length) { - int newcap = (_data.length * 3)/2 + 1; - char[] olddata = _data; - _data = new char[newcap < mincap ? mincap : newcap]; - System.arraycopy(olddata,0,_data,0,_size); - } - } - - /** - * Reduce my capacity, if necessary, to match my - * current {@link #size size}. - */ - public void trimToSize() { - incrModCount(); - if(_size < _data.length) { - char[] olddata = _data; - _data = new char[_size]; - System.arraycopy(olddata,0,_data,0,_size); - } - } - - // private methods - //------------------------------------------------------------------------- - - private void writeObject(ObjectOutputStream out) throws IOException{ - out.defaultWriteObject(); - out.writeInt(_data.length); - for(int i=0;i<_size;i++) { - out.writeChar(_data[i]); - } - } - - private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { - in.defaultReadObject(); - _data = new char[in.readInt()]; - for(int i=0;i<_size;i++) { - _data[i] = in.readChar(); - } - } - - private final void checkRange(int index) { - if(index < 0 || index >= _size) { - throw new IndexOutOfBoundsException("Should be at least 0 and less than " + _size + ", found " + index); - } - } - - private final void checkRangeIncludingEndpoint(int index) { - if(index < 0 || index > _size) { - throw new IndexOutOfBoundsException("Should be at least 0 and at most " + _size + ", found " + index); - } - } - - // attributes - //------------------------------------------------------------------------- - - private transient char[] _data = null; - private int _size = 0; - -} diff --git a/src/java/org/apache/commons/collections/primitives/ArrayDoubleList.java b/src/java/org/apache/commons/collections/primitives/ArrayDoubleList.java deleted file mode 100644 index 288ecac04..000000000 --- a/src/java/org/apache/commons/collections/primitives/ArrayDoubleList.java +++ /dev/null @@ -1,267 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/ArrayDoubleList.java,v 1.3 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.Serializable; - -/** - * An {@link DoubleList} backed by an array of doubles. - * This implementation supports all optional methods. - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public class ArrayDoubleList extends RandomAccessDoubleList implements DoubleList, Serializable { - - // constructors - //------------------------------------------------------------------------- - - /** - * Construct an empty list with the default - * initial capacity. - */ - public ArrayDoubleList() { - this(8); - } - - /** - * Construct an empty list with the given - * initial capacity. - * @throws IllegalArgumentException when initialCapacity is negative - */ - public ArrayDoubleList(int initialCapacity) { - if(initialCapacity < 0) { - throw new IllegalArgumentException("capacity " + initialCapacity); - } - _data = new double[initialCapacity]; - _size = 0; - } - - /** - * Constructs a list containing the elements of the given collection, - * in the order they are returned by that collection's iterator. - * - * @see ArrayDoubleList#addAll(org.apache.commons.collections.primitives.DoubleCollection) - * @param that the non-null collection of doubles - * to add - * @throws NullPointerException if that is null - */ - public ArrayDoubleList(DoubleCollection that) { - this(that.size()); - addAll(that); - } - - // DoubleList methods - //------------------------------------------------------------------------- - - public double get(int index) { - checkRange(index); - return _data[index]; - } - - public int size() { - return _size; - } - - /** - * Removes the element at the specified position in - * (optional operation). Any subsequent elements - * are shifted to the left, subtracting one from their - * indices. Returns the element that was removed. - * - * @param index the index of the element to remove - * @return the value of the element that was removed - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - public double removeElementAt(int index) { - checkRange(index); - incrModCount(); - double oldval = _data[index]; - int numtomove = _size - index - 1; - if(numtomove > 0) { - System.arraycopy(_data,index+1,_data,index,numtomove); - } - _size--; - return oldval; - } - - /** - * Replaces the element at the specified - * position in me with the specified element - * (optional operation). - * - * @param index the index of the element to change - * @param element the value to be stored at the specified position - * @return the value previously stored at the specified position - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - public double set(int index, double element) { - checkRange(index); - incrModCount(); - double oldval = _data[index]; - _data[index] = element; - return oldval; - } - - /** - * Inserts the specified element at the specified position - * (optional operation). Shifts the element currently - * at that position (if any) and any subsequent elements to the - * right, increasing their indices. - * - * @param index the index at which to insert the element - * @param element the value to insert - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException if some aspect of the specified element - * prevents it from being added to me - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - public void add(int index, double element) { - checkRangeIncludingEndpoint(index); - incrModCount(); - ensureCapacity(_size+1); - int numtomove = _size-index; - System.arraycopy(_data,index,_data,index+1,numtomove); - _data[index] = element; - _size++; - } - - // capacity methods - //------------------------------------------------------------------------- - - /** - * Increases my capacity, if necessary, to ensure that I can hold at - * least the number of elements specified by the minimum capacity - * argument without growing. - */ - public void ensureCapacity(int mincap) { - incrModCount(); - if(mincap > _data.length) { - int newcap = (_data.length * 3)/2 + 1; - double[] olddata = _data; - _data = new double[newcap < mincap ? mincap : newcap]; - System.arraycopy(olddata,0,_data,0,_size); - } - } - - /** - * Reduce my capacity, if necessary, to match my - * current {@link #size size}. - */ - public void trimToSize() { - incrModCount(); - if(_size < _data.length) { - double[] olddata = _data; - _data = new double[_size]; - System.arraycopy(olddata,0,_data,0,_size); - } - } - - // private methods - //------------------------------------------------------------------------- - - private void writeObject(ObjectOutputStream out) throws IOException{ - out.defaultWriteObject(); - out.writeInt(_data.length); - for(int i=0;i<_size;i++) { - out.writeDouble(_data[i]); - } - } - - private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { - in.defaultReadObject(); - _data = new double[in.readInt()]; - for(int i=0;i<_size;i++) { - _data[i] = in.readDouble(); - } - } - - private final void checkRange(int index) { - if(index < 0 || index >= _size) { - throw new IndexOutOfBoundsException("Should be at least 0 and less than " + _size + ", found " + index); - } - } - - private final void checkRangeIncludingEndpoint(int index) { - if(index < 0 || index > _size) { - throw new IndexOutOfBoundsException("Should be at least 0 and at most " + _size + ", found " + index); - } - } - - // attributes - //------------------------------------------------------------------------- - - private transient double[] _data = null; - private int _size = 0; - -} diff --git a/src/java/org/apache/commons/collections/primitives/ArrayFloatList.java b/src/java/org/apache/commons/collections/primitives/ArrayFloatList.java deleted file mode 100644 index 36c41ddd1..000000000 --- a/src/java/org/apache/commons/collections/primitives/ArrayFloatList.java +++ /dev/null @@ -1,267 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/ArrayFloatList.java,v 1.4 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.Serializable; - -/** - * An {@link FloatList} backed by an array of floats. - * This implementation supports all optional methods. - * - * @since Commons Collections 2.2 - * @version $Revision: 1.4 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public class ArrayFloatList extends RandomAccessFloatList implements FloatList, Serializable { - - // constructors - //------------------------------------------------------------------------- - - /** - * Construct an empty list with the default - * initial capacity. - */ - public ArrayFloatList() { - this(8); - } - - /** - * Construct an empty list with the given - * initial capacity. - * @throws IllegalArgumentException when initialCapacity is negative - */ - public ArrayFloatList(int initialCapacity) { - if(initialCapacity < 0) { - throw new IllegalArgumentException("capacity " + initialCapacity); - } - _data = new float[initialCapacity]; - _size = 0; - } - - /** - * Constructs a list containing the elements of the given collection, - * in the order they are returned by that collection's iterator. - * - * @see ArrayFloatList#addAll(org.apache.commons.collections.primitives.FloatCollection) - * @param that the non-null collection of floats - * to add - * @throws NullPointerException if that is null - */ - public ArrayFloatList(FloatCollection that) { - this(that.size()); - addAll(that); - } - - // FloatList methods - //------------------------------------------------------------------------- - - public float get(int index) { - checkRange(index); - return _data[index]; - } - - public int size() { - return _size; - } - - /** - * Removes the element at the specified position in - * (optional operation). Any subsequent elements - * are shifted to the left, subtracting one from their - * indices. Returns the element that was removed. - * - * @param index the index of the element to remove - * @return the value of the element that was removed - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - public float removeElementAt(int index) { - checkRange(index); - incrModCount(); - float oldval = _data[index]; - int numtomove = _size - index - 1; - if(numtomove > 0) { - System.arraycopy(_data,index+1,_data,index,numtomove); - } - _size--; - return oldval; - } - - /** - * Replaces the element at the specified - * position in me with the specified element - * (optional operation). - * - * @param index the index of the element to change - * @param element the value to be stored at the specified position - * @return the value previously stored at the specified position - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - public float set(int index, float element) { - checkRange(index); - incrModCount(); - float oldval = _data[index]; - _data[index] = element; - return oldval; - } - - /** - * Inserts the specified element at the specified position - * (optional operation). Shifts the element currently - * at that position (if any) and any subsequent elements to the - * right, increasing their indices. - * - * @param index the index at which to insert the element - * @param element the value to insert - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException if some aspect of the specified element - * prevents it from being added to me - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - public void add(int index, float element) { - checkRangeIncludingEndpoint(index); - incrModCount(); - ensureCapacity(_size+1); - int numtomove = _size-index; - System.arraycopy(_data,index,_data,index+1,numtomove); - _data[index] = element; - _size++; - } - - // capacity methods - //------------------------------------------------------------------------- - - /** - * Increases my capacity, if necessary, to ensure that I can hold at - * least the number of elements specified by the minimum capacity - * argument without growing. - */ - public void ensureCapacity(int mincap) { - incrModCount(); - if(mincap > _data.length) { - int newcap = (_data.length * 3)/2 + 1; - float[] olddata = _data; - _data = new float[newcap < mincap ? mincap : newcap]; - System.arraycopy(olddata,0,_data,0,_size); - } - } - - /** - * Reduce my capacity, if necessary, to match my - * current {@link #size size}. - */ - public void trimToSize() { - incrModCount(); - if(_size < _data.length) { - float[] olddata = _data; - _data = new float[_size]; - System.arraycopy(olddata,0,_data,0,_size); - } - } - - // private methods - //------------------------------------------------------------------------- - - private void writeObject(ObjectOutputStream out) throws IOException{ - out.defaultWriteObject(); - out.writeInt(_data.length); - for(int i=0;i<_size;i++) { - out.writeFloat(_data[i]); - } - } - - private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { - in.defaultReadObject(); - _data = new float[in.readInt()]; - for(int i=0;i<_size;i++) { - _data[i] = in.readFloat(); - } - } - - private final void checkRange(int index) { - if(index < 0 || index >= _size) { - throw new IndexOutOfBoundsException("Should be at least 0 and less than " + _size + ", found " + index); - } - } - - private final void checkRangeIncludingEndpoint(int index) { - if(index < 0 || index > _size) { - throw new IndexOutOfBoundsException("Should be at least 0 and at most " + _size + ", found " + index); - } - } - - // attributes - //------------------------------------------------------------------------- - - private transient float[] _data = null; - private int _size = 0; - -} diff --git a/src/java/org/apache/commons/collections/primitives/ArrayIntList.java b/src/java/org/apache/commons/collections/primitives/ArrayIntList.java deleted file mode 100644 index 37accb440..000000000 --- a/src/java/org/apache/commons/collections/primitives/ArrayIntList.java +++ /dev/null @@ -1,267 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/ArrayIntList.java,v 1.9 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.Serializable; - -/** - * An {@link IntList} backed by an array of ints. - * This implementation supports all optional methods. - * - * @since Commons Collections 2.2 - * @version $Revision: 1.9 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public class ArrayIntList extends RandomAccessIntList implements IntList, Serializable { - - // constructors - //------------------------------------------------------------------------- - - /** - * Construct an empty list with the default - * initial capacity. - */ - public ArrayIntList() { - this(8); - } - - /** - * Construct an empty list with the given - * initial capacity. - * @throws IllegalArgumentException when initialCapacity is negative - */ - public ArrayIntList(int initialCapacity) { - if(initialCapacity < 0) { - throw new IllegalArgumentException("capacity " + initialCapacity); - } - _data = new int[initialCapacity]; - _size = 0; - } - - /** - * Constructs a list containing the elements of the given collection, - * in the order they are returned by that collection's iterator. - * - * @see ArrayIntList#addAll(org.apache.commons.collections.primitives.IntCollection) - * @param that the non-null collection of ints - * to add - * @throws NullPointerException if that is null - */ - public ArrayIntList(IntCollection that) { - this(that.size()); - addAll(that); - } - - // IntList methods - //------------------------------------------------------------------------- - - public int get(int index) { - checkRange(index); - return _data[index]; - } - - public int size() { - return _size; - } - - /** - * Removes the element at the specified position in - * (optional operation). Any subsequent elements - * are shifted to the left, subtracting one from their - * indices. Returns the element that was removed. - * - * @param index the index of the element to remove - * @return the value of the element that was removed - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - public int removeElementAt(int index) { - checkRange(index); - incrModCount(); - int oldval = _data[index]; - int numtomove = _size - index - 1; - if(numtomove > 0) { - System.arraycopy(_data,index+1,_data,index,numtomove); - } - _size--; - return oldval; - } - - /** - * Replaces the element at the specified - * position in me with the specified element - * (optional operation). - * - * @param index the index of the element to change - * @param element the value to be stored at the specified position - * @return the value previously stored at the specified position - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - public int set(int index, int element) { - checkRange(index); - incrModCount(); - int oldval = _data[index]; - _data[index] = element; - return oldval; - } - - /** - * Inserts the specified element at the specified position - * (optional operation). Shifts the element currently - * at that position (if any) and any subsequent elements to the - * right, increasing their indices. - * - * @param index the index at which to insert the element - * @param element the value to insert - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException if some aspect of the specified element - * prevents it from being added to me - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - public void add(int index, int element) { - checkRangeIncludingEndpoint(index); - incrModCount(); - ensureCapacity(_size+1); - int numtomove = _size-index; - System.arraycopy(_data,index,_data,index+1,numtomove); - _data[index] = element; - _size++; - } - - // capacity methods - //------------------------------------------------------------------------- - - /** - * Increases my capacity, if necessary, to ensure that I can hold at - * least the number of elements specified by the minimum capacity - * argument without growing. - */ - public void ensureCapacity(int mincap) { - incrModCount(); - if(mincap > _data.length) { - int newcap = (_data.length * 3)/2 + 1; - int[] olddata = _data; - _data = new int[newcap < mincap ? mincap : newcap]; - System.arraycopy(olddata,0,_data,0,_size); - } - } - - /** - * Reduce my capacity, if necessary, to match my - * current {@link #size size}. - */ - public void trimToSize() { - incrModCount(); - if(_size < _data.length) { - int[] olddata = _data; - _data = new int[_size]; - System.arraycopy(olddata,0,_data,0,_size); - } - } - - // private methods - //------------------------------------------------------------------------- - - private void writeObject(ObjectOutputStream out) throws IOException{ - out.defaultWriteObject(); - out.writeInt(_data.length); - for(int i=0;i<_size;i++) { - out.writeInt(_data[i]); - } - } - - private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { - in.defaultReadObject(); - _data = new int[in.readInt()]; - for(int i=0;i<_size;i++) { - _data[i] = in.readInt(); - } - } - - private final void checkRange(int index) { - if(index < 0 || index >= _size) { - throw new IndexOutOfBoundsException("Should be at least 0 and less than " + _size + ", found " + index); - } - } - - private final void checkRangeIncludingEndpoint(int index) { - if(index < 0 || index > _size) { - throw new IndexOutOfBoundsException("Should be at least 0 and at most " + _size + ", found " + index); - } - } - - // attributes - //------------------------------------------------------------------------- - - private transient int[] _data = null; - private int _size = 0; - -} diff --git a/src/java/org/apache/commons/collections/primitives/ArrayLongList.java b/src/java/org/apache/commons/collections/primitives/ArrayLongList.java deleted file mode 100644 index 9049e1fff..000000000 --- a/src/java/org/apache/commons/collections/primitives/ArrayLongList.java +++ /dev/null @@ -1,267 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/ArrayLongList.java,v 1.4 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.Serializable; - -/** - * An {@link LongList} backed by an array of longs. - * This implementation supports all optional methods. - * - * @since Commons Collections 2.2 - * @version $Revision: 1.4 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public class ArrayLongList extends RandomAccessLongList implements LongList, Serializable { - - // constructors - //------------------------------------------------------------------------- - - /** - * Construct an empty list with the default - * initial capacity. - */ - public ArrayLongList() { - this(8); - } - - /** - * Construct an empty list with the given - * initial capacity. - * @throws IllegalArgumentException when initialCapacity is negative - */ - public ArrayLongList(int initialCapacity) { - if(initialCapacity < 0) { - throw new IllegalArgumentException("capacity " + initialCapacity); - } - _data = new long[initialCapacity]; - _size = 0; - } - - /** - * Constructs a list containing the elements of the given collection, - * in the order they are returned by that collection's iterator. - * - * @see ArrayLongList#addAll(org.apache.commons.collections.primitives.LongCollection) - * @param that the non-null collection of longs - * to add - * @throws NullPointerException if that is null - */ - public ArrayLongList(LongCollection that) { - this(that.size()); - addAll(that); - } - - // LongList methods - //------------------------------------------------------------------------- - - public long get(int index) { - checkRange(index); - return _data[index]; - } - - public int size() { - return _size; - } - - /** - * Removes the element at the specified position in - * (optional operation). Any subsequent elements - * are shifted to the left, subtracting one from their - * indices. Returns the element that was removed. - * - * @param index the index of the element to remove - * @return the value of the element that was removed - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - public long removeElementAt(int index) { - checkRange(index); - incrModCount(); - long oldval = _data[index]; - int numtomove = _size - index - 1; - if(numtomove > 0) { - System.arraycopy(_data,index+1,_data,index,numtomove); - } - _size--; - return oldval; - } - - /** - * Replaces the element at the specified - * position in me with the specified element - * (optional operation). - * - * @param index the index of the element to change - * @param element the value to be stored at the specified position - * @return the value previously stored at the specified position - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - public long set(int index, long element) { - checkRange(index); - incrModCount(); - long oldval = _data[index]; - _data[index] = element; - return oldval; - } - - /** - * Inserts the specified element at the specified position - * (optional operation). Shifts the element currently - * at that position (if any) and any subsequent elements to the - * right, increasing their indices. - * - * @param index the index at which to insert the element - * @param element the value to insert - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException if some aspect of the specified element - * prevents it from being added to me - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - public void add(int index, long element) { - checkRangeIncludingEndpoint(index); - incrModCount(); - ensureCapacity(_size+1); - int numtomove = _size-index; - System.arraycopy(_data,index,_data,index+1,numtomove); - _data[index] = element; - _size++; - } - - // capacity methods - //------------------------------------------------------------------------- - - /** - * Increases my capacity, if necessary, to ensure that I can hold at - * least the number of elements specified by the minimum capacity - * argument without growing. - */ - public void ensureCapacity(int mincap) { - incrModCount(); - if(mincap > _data.length) { - int newcap = (_data.length * 3)/2 + 1; - long[] olddata = _data; - _data = new long[newcap < mincap ? mincap : newcap]; - System.arraycopy(olddata,0,_data,0,_size); - } - } - - /** - * Reduce my capacity, if necessary, to match my - * current {@link #size size}. - */ - public void trimToSize() { - incrModCount(); - if(_size < _data.length) { - long[] olddata = _data; - _data = new long[_size]; - System.arraycopy(olddata,0,_data,0,_size); - } - } - - // private methods - //------------------------------------------------------------------------- - - private void writeObject(ObjectOutputStream out) throws IOException{ - out.defaultWriteObject(); - out.writeInt(_data.length); - for(int i=0;i<_size;i++) { - out.writeLong(_data[i]); - } - } - - private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { - in.defaultReadObject(); - _data = new long[in.readInt()]; - for(int i=0;i<_size;i++) { - _data[i] = in.readLong(); - } - } - - private final void checkRange(int index) { - if(index < 0 || index >= _size) { - throw new IndexOutOfBoundsException("Should be at least 0 and less than " + _size + ", found " + index); - } - } - - private final void checkRangeIncludingEndpoint(int index) { - if(index < 0 || index > _size) { - throw new IndexOutOfBoundsException("Should be at least 0 and at most " + _size + ", found " + index); - } - } - - // attributes - //------------------------------------------------------------------------- - - private transient long[] _data = null; - private int _size = 0; - -} diff --git a/src/java/org/apache/commons/collections/primitives/ArrayShortList.java b/src/java/org/apache/commons/collections/primitives/ArrayShortList.java deleted file mode 100644 index 77da380b0..000000000 --- a/src/java/org/apache/commons/collections/primitives/ArrayShortList.java +++ /dev/null @@ -1,267 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/ArrayShortList.java,v 1.4 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.Serializable; - -/** - * An {@link ShortList} backed by an array of shorts. - * This implementation supports all optional methods. - * - * @since Commons Collections 2.2 - * @version $Revision: 1.4 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public class ArrayShortList extends RandomAccessShortList implements ShortList, Serializable { - - // constructors - //------------------------------------------------------------------------- - - /** - * Construct an empty list with the default - * initial capacity. - */ - public ArrayShortList() { - this(8); - } - - /** - * Construct an empty list with the given - * initial capacity. - * @throws IllegalArgumentException when initialCapacity is negative - */ - public ArrayShortList(int initialCapacity) { - if(initialCapacity < 0) { - throw new IllegalArgumentException("capacity " + initialCapacity); - } - _data = new short[initialCapacity]; - _size = 0; - } - - /** - * Constructs a list containing the elements of the given collection, - * in the order they are returned by that collection's iterator. - * - * @see ArrayShortList#addAll(org.apache.commons.collections.primitives.ShortCollection) - * @param that the non-null collection of shorts - * to add - * @throws NullPointerException if that is null - */ - public ArrayShortList(ShortCollection that) { - this(that.size()); - addAll(that); - } - - // ShortList methods - //------------------------------------------------------------------------- - - public short get(int index) { - checkRange(index); - return _data[index]; - } - - public int size() { - return _size; - } - - /** - * Removes the element at the specified position in - * (optional operation). Any subsequent elements - * are shifted to the left, subtracting one from their - * indices. Returns the element that was removed. - * - * @param index the index of the element to remove - * @return the value of the element that was removed - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - public short removeElementAt(int index) { - checkRange(index); - incrModCount(); - short oldval = _data[index]; - int numtomove = _size - index - 1; - if(numtomove > 0) { - System.arraycopy(_data,index+1,_data,index,numtomove); - } - _size--; - return oldval; - } - - /** - * Replaces the element at the specified - * position in me with the specified element - * (optional operation). - * - * @param index the index of the element to change - * @param element the value to be stored at the specified position - * @return the value previously stored at the specified position - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - public short set(int index, short element) { - checkRange(index); - incrModCount(); - short oldval = _data[index]; - _data[index] = element; - return oldval; - } - - /** - * Inserts the specified element at the specified position - * (optional operation). Shifts the element currently - * at that position (if any) and any subsequent elements to the - * right, increasing their indices. - * - * @param index the index at which to insert the element - * @param element the value to insert - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException if some aspect of the specified element - * prevents it from being added to me - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - public void add(int index, short element) { - checkRangeIncludingEndpoint(index); - incrModCount(); - ensureCapacity(_size+1); - int numtomove = _size-index; - System.arraycopy(_data,index,_data,index+1,numtomove); - _data[index] = element; - _size++; - } - - // capacity methods - //------------------------------------------------------------------------- - - /** - * Increases my capacity, if necessary, to ensure that I can hold at - * least the number of elements specified by the minimum capacity - * argument without growing. - */ - public void ensureCapacity(int mincap) { - incrModCount(); - if(mincap > _data.length) { - int newcap = (_data.length * 3)/2 + 1; - short[] olddata = _data; - _data = new short[newcap < mincap ? mincap : newcap]; - System.arraycopy(olddata,0,_data,0,_size); - } - } - - /** - * Reduce my capacity, if necessary, to match my - * current {@link #size size}. - */ - public void trimToSize() { - incrModCount(); - if(_size < _data.length) { - short[] olddata = _data; - _data = new short[_size]; - System.arraycopy(olddata,0,_data,0,_size); - } - } - - // private methods - //------------------------------------------------------------------------- - - private void writeObject(ObjectOutputStream out) throws IOException{ - out.defaultWriteObject(); - out.writeInt(_data.length); - for(int i=0;i<_size;i++) { - out.writeShort(_data[i]); - } - } - - private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { - in.defaultReadObject(); - _data = new short[in.readInt()]; - for(int i=0;i<_size;i++) { - _data[i] = in.readShort(); - } - } - - private final void checkRange(int index) { - if(index < 0 || index >= _size) { - throw new IndexOutOfBoundsException("Should be at least 0 and less than " + _size + ", found " + index); - } - } - - private final void checkRangeIncludingEndpoint(int index) { - if(index < 0 || index > _size) { - throw new IndexOutOfBoundsException("Should be at least 0 and at most " + _size + ", found " + index); - } - } - - // attributes - //------------------------------------------------------------------------- - - private transient short[] _data = null; - private int _size = 0; - -} diff --git a/src/java/org/apache/commons/collections/primitives/ArrayUnsignedByteList.java b/src/java/org/apache/commons/collections/primitives/ArrayUnsignedByteList.java deleted file mode 100644 index 4f4bb40ae..000000000 --- a/src/java/org/apache/commons/collections/primitives/ArrayUnsignedByteList.java +++ /dev/null @@ -1,318 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/ArrayUnsignedByteList.java,v 1.5 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.Serializable; - -/** - * A {@link ShortList} backed by an array of unsigned - * byte values. - * This list stores short values - * in the range [{@link #MIN_VALUE}, - * {@link #MAX_VALUE}] in 8-bits - * per element. Attempts to use elements outside this - * range may cause an - * {@link IllegalArgumentException IllegalArgumentException} - * to be thrown. - *

- * This implementation supports all optional methods. - * - * @since Commons Collections 2.2 - * @version $Revision: 1.5 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public class ArrayUnsignedByteList extends RandomAccessShortList implements ShortList, Serializable { - - // constructors - //------------------------------------------------------------------------- - - /** - * Construct an empty list with the default - * initial capacity. - */ - public ArrayUnsignedByteList() { - this(8); - } - - /** - * Construct an empty list with the given - * initial capacity. - * @throws IllegalArgumentException when initialCapacity is negative - */ - public ArrayUnsignedByteList(int initialCapacity) { - if(initialCapacity < 0) { - throw new IllegalArgumentException("capacity " + initialCapacity); - } - _data = new byte[initialCapacity]; - _size = 0; - } - - /** - * Constructs a list containing the elements of the given collection, - * in the order they are returned by that collection's iterator. - * - * @see ShortList#addAll(org.apache.commons.collections.primitives.ShortCollection) - * @param that the non-null collection of ints - * to add - * @throws NullPointerException if that is null - */ - public ArrayUnsignedByteList(ShortCollection that) { - this(that.size()); - addAll(that); - } - - // ShortList methods - //------------------------------------------------------------------------- - - /** - * Returns the element at the specified position within - * me. - * By construction, the returned value will be - * between {@link #MIN_VALUE} and {@link #MAX_VALUE}, inclusive. - * - * @param index the index of the element to return - * @return the value of the element at the specified position - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - public short get(int index) { - checkRange(index); - return toShort(_data[index]); - } - - public int size() { - return _size; - } - - /** - * Removes the element at the specified position in - * (optional operation). Any subsequent elements - * are shifted to the left, subtracting one from their - * indices. Returns the element that was removed. - * By construction, the returned value will be - * between {@link #MIN_VALUE} and {@link #MAX_VALUE}, inclusive. - * - * @param index the index of the element to remove - * @return the value of the element that was removed - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - public short removeElementAt(int index) { - checkRange(index); - incrModCount(); - short oldval = toShort(_data[index]); - int numtomove = _size - index - 1; - if(numtomove > 0) { - System.arraycopy(_data,index+1,_data,index,numtomove); - } - _size--; - return oldval; - } - - /** - * Replaces the element at the specified - * position in me with the specified element - * (optional operation). - * Throws {@link IllegalArgumentException} if element - * is less than {@link #MIN_VALUE} or greater than {@link #MAX_VALUE}. - * - * @param index the index of the element to change - * @param element the value to be stored at the specified position - * @return the value previously stored at the specified position - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - public short set(int index, short element) { - assertValidUnsignedByte(element); - checkRange(index); - incrModCount(); - short oldval = toShort(_data[index]); - _data[index] = fromShort(element); - return oldval; - } - - /** - * Inserts the specified element at the specified position - * (optional operation). Shifts the element currently - * at that position (if any) and any subsequent elements to the - * right, increasing their indices. - * Throws {@link IllegalArgumentException} if element - * is less than {@link #MIN_VALUE} or greater than {@link #MAX_VALUE}. - * - * @param index the index at which to insert the element - * @param element the value to insert - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException if some aspect of the specified element - * prevents it from being added to me - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - public void add(int index, short element) { - assertValidUnsignedByte(element); - checkRangeIncludingEndpoint(index); - incrModCount(); - ensureCapacity(_size+1); - int numtomove = _size-index; - System.arraycopy(_data,index,_data,index+1,numtomove); - _data[index] = fromShort(element); - _size++; - } - - // capacity methods - //------------------------------------------------------------------------- - - /** - * Increases my capacity, if necessary, to ensure that I can hold at - * least the number of elements specified by the minimum capacity - * argument without growing. - */ - public void ensureCapacity(int mincap) { - incrModCount(); - if(mincap > _data.length) { - int newcap = (_data.length * 3)/2 + 1; - byte[] olddata = _data; - _data = new byte[newcap < mincap ? mincap : newcap]; - System.arraycopy(olddata,0,_data,0,_size); - } - } - - /** - * Reduce my capacity, if necessary, to match my - * current {@link #size size}. - */ - public void trimToSize() { - incrModCount(); - if(_size < _data.length) { - byte[] olddata = _data; - _data = new byte[_size]; - System.arraycopy(olddata,0,_data,0,_size); - } - } - - // private methods - //------------------------------------------------------------------------- - - private final short toShort(byte value) { - return (short)(((short)value)&MAX_VALUE); - } - - private final byte fromShort(short value) { - return (byte)(value&MAX_VALUE); - } - - private final void assertValidUnsignedByte(short value) throws IllegalArgumentException { - if(value > MAX_VALUE) { - throw new IllegalArgumentException(value + " > " + MAX_VALUE); - } - if(value < MIN_VALUE) { - throw new IllegalArgumentException(value + " < " + MIN_VALUE); - } - } - - private void writeObject(ObjectOutputStream out) throws IOException{ - out.defaultWriteObject(); - out.writeInt(_data.length); - for(int i=0;i<_size;i++) { - out.writeByte(_data[i]); - } - } - - private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { - in.defaultReadObject(); - _data = new byte[in.readInt()]; - for(int i=0;i<_size;i++) { - _data[i] = in.readByte(); - } - } - - private final void checkRange(int index) { - if(index < 0 || index >= _size) { - throw new IndexOutOfBoundsException("Should be at least 0 and less than " + _size + ", found " + index); - } - } - - private final void checkRangeIncludingEndpoint(int index) { - if(index < 0 || index > _size) { - throw new IndexOutOfBoundsException("Should be at least 0 and at most " + _size + ", found " + index); - } - } - - private transient byte[] _data = null; - private int _size = 0; - - /** - * The maximum possible unsigned 8-bit value. - */ - public static final short MAX_VALUE = 0xFF; - - /** - * The minimum possible unsigned 8-bit value. - */ - public static final short MIN_VALUE = 0; - -} diff --git a/src/java/org/apache/commons/collections/primitives/ArrayUnsignedIntList.java b/src/java/org/apache/commons/collections/primitives/ArrayUnsignedIntList.java deleted file mode 100644 index 821dfa539..000000000 --- a/src/java/org/apache/commons/collections/primitives/ArrayUnsignedIntList.java +++ /dev/null @@ -1,321 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/ArrayUnsignedIntList.java,v 1.7 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.Serializable; - -/** - * An {@link IntList} backed by an array of unsigned - * int values. - * This list stores int values - * in the range [{@link #MIN_VALUE 0}, - * {@link #MAX_VALUE 65535}] in 16-bits - * per element. Attempts to use elements outside this - * range may cause an - * {@link IllegalArgumentException IllegalArgumentException} - * to be thrown. - *

- * This implementation supports all optional methods. - * - * @since Commons Collections 2.2 - * @version $Revision: 1.7 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public class ArrayUnsignedIntList extends RandomAccessLongList implements LongList, Serializable { - - // constructors - //------------------------------------------------------------------------- - - /** - * Construct an empty list with the default - * initial capacity. - */ - public ArrayUnsignedIntList() { - this(8); - } - - /** - * Construct an empty list with the given - * initial capacity. - * @throws IllegalArgumentException when initialCapacity is negative - */ - public ArrayUnsignedIntList(int initialCapacity) { - if(initialCapacity < 0) { - throw new IllegalArgumentException("capacity " + initialCapacity); - } - _data = new int[initialCapacity]; - _size = 0; - } - - /** - * Constructs a list containing the elements of the given collection, - * in the order they are returned by that collection's iterator. - * - * @see AbstractLongCollection#addAll(LongCollection) - * @param that the non-null collection of ints - * to add - * @throws NullPointerException if that is null - */ - public ArrayUnsignedIntList(LongCollection that) { - this(that.size()); - addAll(that); - } - - // IntList methods - //------------------------------------------------------------------------- - - /** - * Returns the element at the specified position within - * me. - * By construction, the returned value will be - * between {@link #MIN_VALUE} and {@link #MAX_VALUE}, inclusive. - * - * @param index the index of the element to return - * @return the value of the element at the specified position - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - public long get(int index) { - checkRange(index); - return toLong(_data[index]); - } - - public int size() { - return _size; - } - - /** - * Removes the element at the specified position in - * (optional operation). Any subsequent elements - * are shifted to the left, subtracting one from their - * indices. Returns the element that was removed. - * By construction, the returned value will be - * between {@link #MIN_VALUE} and {@link #MAX_VALUE}, inclusive. - * - * @param index the index of the element to remove - * @return the value of the element that was removed - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - public long removeElementAt(int index) { - checkRange(index); - incrModCount(); - long oldval = toLong(_data[index]); - int numtomove = _size - index - 1; - if(numtomove > 0) { - System.arraycopy(_data,index+1,_data,index,numtomove); - } - _size--; - return oldval; - } - - /** - * Replaces the element at the specified - * position in me with the specified element - * (optional operation). - * Throws {@link IllegalArgumentException} if element - * is less than {@link #MIN_VALUE} or greater than {@link #MAX_VALUE}. - * - * @param index the index of the element to change - * @param element the value to be stored at the specified position - * @return the value previously stored at the specified position - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - public long set(int index, long element) { - assertValidUnsignedInt(element); - checkRange(index); - incrModCount(); - long oldval = toLong(_data[index]); - _data[index] = fromLong(element); - return oldval; - } - - /** - * Inserts the specified element at the specified position - * (optional operation). Shifts the element currently - * at that position (if any) and any subsequent elements to the - * right, increasing their indices. - * Throws {@link IllegalArgumentException} if element - * is less than {@link #MIN_VALUE} or greater than {@link #MAX_VALUE}. - * - * @param index the index at which to insert the element - * @param element the value to insert - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException if some aspect of the specified element - * prevents it from being added to me - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - public void add(int index, long element) { - assertValidUnsignedInt(element); - checkRangeIncludingEndpoint(index); - incrModCount(); - ensureCapacity(_size+1); - int numtomove = _size-index; - System.arraycopy(_data,index,_data,index+1,numtomove); - _data[index] = fromLong(element); - _size++; - } - - // capacity methods - //------------------------------------------------------------------------- - - /** - * Increases my capacity, if necessary, to ensure that I can hold at - * least the number of elements specified by the minimum capacity - * argument without growing. - */ - public void ensureCapacity(int mincap) { - incrModCount(); - if(mincap > _data.length) { - int newcap = (_data.length * 3)/2 + 1; - int[] olddata = _data; - _data = new int[newcap < mincap ? mincap : newcap]; - System.arraycopy(olddata,0,_data,0,_size); - } - } - - /** - * Reduce my capacity, if necessary, to match my - * current {@link #size size}. - */ - public void trimToSize() { - incrModCount(); - if(_size < _data.length) { - int[] olddata = _data; - _data = new int[_size]; - System.arraycopy(olddata,0,_data,0,_size); - } - } - - // private methods - //------------------------------------------------------------------------- - - private final long toLong(int value) { - return ((long)value)&MAX_VALUE; - } - - private final int fromLong(long value) { - return (int)(value&MAX_VALUE); - } - - private final void assertValidUnsignedInt(long value) throws IllegalArgumentException { - if(value > MAX_VALUE) { - throw new IllegalArgumentException(value + " > " + MAX_VALUE); - } - if(value < MIN_VALUE) { - throw new IllegalArgumentException(value + " < " + MIN_VALUE); - } - } - - private void writeObject(ObjectOutputStream out) throws IOException{ - out.defaultWriteObject(); - out.writeInt(_data.length); - for(int i=0;i<_size;i++) { - out.writeInt(_data[i]); - } - } - - private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { - in.defaultReadObject(); - _data = new int[in.readInt()]; - for(int i=0;i<_size;i++) { - _data[i] = in.readInt(); - } - } - - private final void checkRange(int index) { - if(index < 0 || index >= _size) { - throw new IndexOutOfBoundsException("Should be at least 0 and less than " + _size + ", found " + index); - } - } - - private final void checkRangeIncludingEndpoint(int index) { - if(index < 0 || index > _size) { - throw new IndexOutOfBoundsException("Should be at least 0 and at most " + _size + ", found " + index); - } - } - - // attributes - //------------------------------------------------------------------------- - - /** - * The maximum possible unsigned 32-bit value. - */ - public static final long MAX_VALUE = 0xFFFFFFFFL; - - /** - * The minimum possible unsigned 32-bit value. - */ - public static final long MIN_VALUE = 0L; - - private transient int[] _data = null; - private int _size = 0; - -} diff --git a/src/java/org/apache/commons/collections/primitives/ArrayUnsignedShortList.java b/src/java/org/apache/commons/collections/primitives/ArrayUnsignedShortList.java deleted file mode 100644 index a9a802702..000000000 --- a/src/java/org/apache/commons/collections/primitives/ArrayUnsignedShortList.java +++ /dev/null @@ -1,318 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/ArrayUnsignedShortList.java,v 1.9 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.Serializable; - -/** - * An {@link IntList} backed by an array of unsigned - * short values. - * This list stores int values - * in the range [{@link #MIN_VALUE 0}, - * {@link #MAX_VALUE 65535}] in 16-bits - * per element. Attempts to use elements outside this - * range may cause an - * {@link IllegalArgumentException IllegalArgumentException} - * to be thrown. - *

- * This implementation supports all optional methods. - * - * @since Commons Collections 2.2 - * @version $Revision: 1.9 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public class ArrayUnsignedShortList extends RandomAccessIntList implements IntList, Serializable { - - // constructors - //------------------------------------------------------------------------- - - /** - * Construct an empty list with the default - * initial capacity. - */ - public ArrayUnsignedShortList() { - this(8); - } - - /** - * Construct an empty list with the given - * initial capacity. - * @throws IllegalArgumentException when initialCapacity is negative - */ - public ArrayUnsignedShortList(int initialCapacity) { - if(initialCapacity < 0) { - throw new IllegalArgumentException("capacity " + initialCapacity); - } - _data = new short[initialCapacity]; - _size = 0; - } - - /** - * Constructs a list containing the elements of the given collection, - * in the order they are returned by that collection's iterator. - * - * @see ArrayIntList#addAll(org.apache.commons.collections.primitives.IntCollection) - * @param that the non-null collection of ints - * to add - * @throws NullPointerException if that is null - */ - public ArrayUnsignedShortList(IntCollection that) { - this(that.size()); - addAll(that); - } - - // IntList methods - //------------------------------------------------------------------------- - - /** - * Returns the element at the specified position within - * me. - * By construction, the returned value will be - * between {@link #MIN_VALUE} and {@link #MAX_VALUE}, inclusive. - * - * @param index the index of the element to return - * @return the value of the element at the specified position - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - public int get(int index) { - checkRange(index); - return toInt(_data[index]); - } - - public int size() { - return _size; - } - - /** - * Removes the element at the specified position in - * (optional operation). Any subsequent elements - * are shifted to the left, subtracting one from their - * indices. Returns the element that was removed. - * By construction, the returned value will be - * between {@link #MIN_VALUE} and {@link #MAX_VALUE}, inclusive. - * - * @param index the index of the element to remove - * @return the value of the element that was removed - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - public int removeElementAt(int index) { - checkRange(index); - incrModCount(); - int oldval = toInt(_data[index]); - int numtomove = _size - index - 1; - if(numtomove > 0) { - System.arraycopy(_data,index+1,_data,index,numtomove); - } - _size--; - return oldval; - } - - /** - * Replaces the element at the specified - * position in me with the specified element - * (optional operation). - * Throws {@link IllegalArgumentException} if element - * is less than {@link #MIN_VALUE} or greater than {@link #MAX_VALUE}. - * - * @param index the index of the element to change - * @param element the value to be stored at the specified position - * @return the value previously stored at the specified position - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - public int set(int index, int element) { - assertValidUnsignedShort(element); - checkRange(index); - incrModCount(); - int oldval = toInt(_data[index]); - _data[index] = fromInt(element); - return oldval; - } - - /** - * Inserts the specified element at the specified position - * (optional operation). Shifts the element currently - * at that position (if any) and any subsequent elements to the - * right, increasing their indices. - * Throws {@link IllegalArgumentException} if element - * is less than {@link #MIN_VALUE} or greater than {@link #MAX_VALUE}. - * - * @param index the index at which to insert the element - * @param element the value to insert - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException if some aspect of the specified element - * prevents it from being added to me - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - public void add(int index, int element) { - assertValidUnsignedShort(element); - checkRangeIncludingEndpoint(index); - incrModCount(); - ensureCapacity(_size+1); - int numtomove = _size-index; - System.arraycopy(_data,index,_data,index+1,numtomove); - _data[index] = fromInt(element); - _size++; - } - - // capacity methods - //------------------------------------------------------------------------- - - /** - * Increases my capacity, if necessary, to ensure that I can hold at - * least the number of elements specified by the minimum capacity - * argument without growing. - */ - public void ensureCapacity(int mincap) { - incrModCount(); - if(mincap > _data.length) { - int newcap = (_data.length * 3)/2 + 1; - short[] olddata = _data; - _data = new short[newcap < mincap ? mincap : newcap]; - System.arraycopy(olddata,0,_data,0,_size); - } - } - - /** - * Reduce my capacity, if necessary, to match my - * current {@link #size size}. - */ - public void trimToSize() { - incrModCount(); - if(_size < _data.length) { - short[] olddata = _data; - _data = new short[_size]; - System.arraycopy(olddata,0,_data,0,_size); - } - } - - // private methods - //------------------------------------------------------------------------- - - private final int toInt(short value) { - return ((int)value)&MAX_VALUE; - } - - private final short fromInt(int value) { - return (short)(value&MAX_VALUE); - } - - private final void assertValidUnsignedShort(int value) throws IllegalArgumentException { - if(value > MAX_VALUE) { - throw new IllegalArgumentException(value + " > " + MAX_VALUE); - } - if(value < MIN_VALUE) { - throw new IllegalArgumentException(value + " < " + MIN_VALUE); - } - } - - private void writeObject(ObjectOutputStream out) throws IOException{ - out.defaultWriteObject(); - out.writeInt(_data.length); - for(int i=0;i<_size;i++) { - out.writeShort(_data[i]); - } - } - - private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { - in.defaultReadObject(); - _data = new short[in.readInt()]; - for(int i=0;i<_size;i++) { - _data[i] = in.readShort(); - } - } - - private final void checkRange(int index) { - if(index < 0 || index >= _size) { - throw new IndexOutOfBoundsException("Should be at least 0 and less than " + _size + ", found " + index); - } - } - - private final void checkRangeIncludingEndpoint(int index) { - if(index < 0 || index > _size) { - throw new IndexOutOfBoundsException("Should be at least 0 and at most " + _size + ", found " + index); - } - } - - // attributes - //------------------------------------------------------------------------- - - /** The maximum possible unsigned 16-bit value (0xFFFF). */ - public static final int MAX_VALUE = 0xFFFF; - - - /** The minimum possible unsigned 16-bit value (0x0000). */ - public static final int MIN_VALUE = 0; - - private transient short[] _data = null; - private int _size = 0; - -} diff --git a/src/java/org/apache/commons/collections/primitives/ByteCollection.java b/src/java/org/apache/commons/collections/primitives/ByteCollection.java deleted file mode 100644 index f4e19ca84..000000000 --- a/src/java/org/apache/commons/collections/primitives/ByteCollection.java +++ /dev/null @@ -1,248 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/ByteCollection.java,v 1.3 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -/** - * A collection of byte values. - * - * @see org.apache.commons.collections.primitives.adapters.ByteCollectionCollection - * @see org.apache.commons.collections.primitives.adapters.CollectionByteCollection - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public interface ByteCollection { - /** - * Ensures that I contain the specified element - * (optional operation). Returns true - * iff I changed as a result of this call. - *

- * If a collection refuses to add the specified - * element for any reason other than that it already contains - * the element, it must throw an exception (rather than - * simply returning false). This preserves the invariant - * that a collection always contains the specified element after - * this call returns. - * - * @param element the value whose presence within me is to be ensured - * @return true iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException may be thrown if some aspect of the - * specified element prevents it from being added to me - */ - boolean add(byte element); - - /** - * {@link #add Adds} all of the elements in the - * specified collection to me (optional operation). - * - * @param c the collection of elements whose presence within me is to - * be ensured - * @return true iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException may be thrown if some aspect of some - * specified element prevents it from being added to me - */ - boolean addAll(ByteCollection c); - - /** - * Removes all my elements (optional operation). - * I will be {@link #isEmpty empty} after this - * method successfully returns. - * - * @throws UnsupportedOperationException when this operation is not - * supported - */ - void clear(); - - /** - * Returns true iff I contain - * the specified element. - * - * @param element the value whose presence within me is to be tested - * @return true iff I contain the specified element - */ - boolean contains(byte element); - - /** - * Returns true iff I {@link #contains contain} - * all of the elements in the given collection. - * - * @param c the collection of elements whose presence within me is to - * be tested - * @return true iff I contain the all the specified elements - */ - boolean containsAll(ByteCollection c); - - /** - * Returns true iff I contain no elements. - * @return true iff I contain no elements. - */ - boolean isEmpty(); - - /** - * Returns an {@link ByteIterator iterator} over all my elements. - * This base interface places no constraints on the order - * in which the elements are returned by the returned iterator. - * @return an {@link ByteIterator iterator} over all my elements. - */ - ByteIterator iterator(); - - /** - * Removes all of my elements that are contained in the - * specified collection (optional operation). - * The behavior of this method is unspecified if - * the given collection is modified while this method - * is executing. Note that this includes the case - * in which the given collection is this collection, - * and it is not empty. - * - * @param c the collection of elements to remove - * @return true iff I contained the at least one of the - * specified elements, in other words, returns true - * iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - */ - boolean removeAll(ByteCollection c); - - /** - * Removes a single occurrence of the specified element - * (optional operation). - * - * @param element the element to remove, if present - * @return true iff I contained the specified element, - * in other words, iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - */ - boolean removeElement(byte element); - - /** - * Removes all of my elements that are not contained in the - * specified collection (optional operation). - * (In other words, retains only my elements that are - * contained in the specified collection.) - * The behavior of this method is unspecified if - * the given collection is modified while this method - * is executing. - * - * @param c the collection of elements to retain - * @return true iff I changed as a result - * of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - */ - boolean retainAll(ByteCollection c); - - /** - * Returns the number of elements I contain. - * @return the number of elements I contain - */ - int size(); - - /** - * Returns an array containing all of my elements. - * The length of the returned array will be equal - * to my {@link #size size}. - *

- * The returned array will be independent of me, - * so that callers may modify that - * returned array without modifying this collection. - *

- * When I guarantee the order in which - * elements are returned by an {@link #iterator iterator}, - * the returned array will contain elements in the - * same order. - * - * @return an array containing all my elements - */ - byte[] toArray(); - - /** - * Returns an array containing all of my elements, - * using the given array if it is large - * enough. When the length of the given array is - * larger than the number of elements I contain, - * values outside of my range will be unchanged. - *

- * The returned array will be independent of me, - * so that callers may modify that - * returned array without modifying this collection. - *

- * When I guarantee the order in which - * elements are returned by an {@link #iterator iterator}, - * the returned array will contain elements in the - * same order. - * - * @param a an array that may be used to contain the elements - * @return an array containing all my elements - */ - byte[] toArray(byte[] a); -} diff --git a/src/java/org/apache/commons/collections/primitives/ByteIterator.java b/src/java/org/apache/commons/collections/primitives/ByteIterator.java deleted file mode 100644 index 9e5302e0a..000000000 --- a/src/java/org/apache/commons/collections/primitives/ByteIterator.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/ByteIterator.java,v 1.3 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -/** - * An iterator over byte values. - * - * @see org.apache.commons.collections.primitives.adapters.ByteIteratorIterator - * @see org.apache.commons.collections.primitives.adapters.IteratorByteIterator - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public interface ByteIterator { - /** - * Returns true iff I have more elements. - * (In other words, returns true iff - * a subsequent call to {@link #next next} will return - * an element rather than throwing an exception.) - * - * @return true iff I have more elements - */ - boolean hasNext(); - - /** - * Returns the next element in me. - * - * @return the next element in me - * @throws NoSuchElementException if there is no next element - */ - byte next(); - - /** - * Removes from my underlying collection the last - * element {@link #next returned} by me - * (optional operation). - * - * @throws UnsupportedOperationException if this operation is not supported - * @throws IllegalStateException if {@link #next} has not yet been - * called, or {@link #remove} has already been called since - * the last call to {@link #next}. - */ - void remove(); -} diff --git a/src/java/org/apache/commons/collections/primitives/ByteList.java b/src/java/org/apache/commons/collections/primitives/ByteList.java deleted file mode 100644 index f4d7d681c..000000000 --- a/src/java/org/apache/commons/collections/primitives/ByteList.java +++ /dev/null @@ -1,293 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/ByteList.java,v 1.3 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -/** - * An ordered collection of byte values. - * - * @see org.apache.commons.collections.primitives.adapters.ByteListList - * @see org.apache.commons.collections.primitives.adapters.ListByteList - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public interface ByteList extends ByteCollection { - /** - * Appends the specified element to the end of me - * (optional operation). Returns true - * iff I changed as a result of this call. - *

- * If a collection refuses to add the specified - * element for any reason other than that it already contains - * the element, it must throw an exception (rather than - * simply returning false). This preserves the invariant - * that a collection always contains the specified element after - * this call returns. - * - * @param element the value whose presence within me is to be ensured - * @return true iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException may be thrown if some aspect of the - * specified element prevents it from being added to me - */ - boolean add(byte element); - - /** - * Inserts the specified element at the specified position - * (optional operation). Shifts the element currently - * at that position (if any) and any subsequent elements to the - * right, increasing their indices. - * - * @param index the index at which to insert the element - * @param element the value to insert - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException if some aspect of the specified element - * prevents it from being added to me - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - void add(int index, byte element); - - /** - * Inserts all of the elements in the specified collection into me, - * at the specified position (optional operation). Shifts the - * element currently at that position (if any) and any subsequent - * elements to the right, increasing their indices. The new elements - * will appear in the order that they are returned by the given - * collection's {@link ByteCollection#iterator iterator}. - * - * @param index the index at which to insert the first element from - * the specified collection - * @param collection the {@link ByteCollection ByteCollection} of elements to add - * @return true iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - boolean addAll(int index, ByteCollection collection); - - /** - * Returns true iff that is an ByteList - * that contains the same elements in the same order as me. - * In other words, returns true iff that is - * an ByteList that has the same {@link #size size} as me, - * and for which the elements returned by its - * {@link ByteList#iterator iterator} are equal (==) to - * the corresponding elements within me. - * (This contract ensures that this method works properly across - * different implementations of the ByteList interface.) - * - * @param that the object to compare to me - * @return true iff that is an ByteList - * that contains the same elements in the same order as me - */ - boolean equals(Object that); - - /** - * Returns the value of the element at the specified position - * within me. - * - * @param index the index of the element to return - * @return the value of the element at the specified position - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - byte get(int index); - - /** - * Returns my hash code. - *

- * The hash code of an ByteList is defined to be the - * result of the following calculation: - *

 int hash = 1;
-     * for(ByteIterator iter = iterator(); iter.hasNext(); ) {
-     *   byte value = iter.next();
-     *   hash = 31*hash + (int)(value ^ (value >>> 32));
-     * }
- *

- * This contract ensures that this method is consistent with - * {@link #equals equals} and with the - * {@link java.util.List#hashCode hashCode} - * method of a {@link java.util.List List} of {@link Byte}s. - * - * @return my hash code - */ - int hashCode(); - - /** - * Returns the index of the first occurrence - * of the specified element within me, - * or -1 if I do not contain - * the element. - * - * @param element the element to search for - * @return the smallest index of an element matching the specified value, - * or -1 if no such matching element can be found - */ - int indexOf(byte element); - - /** - * Returns an {@link ByteIterator iterator} over all my elements, - * in the appropriate sequence. - * @return an {@link ByteIterator iterator} over all my elements. - */ - ByteIterator iterator(); - - /** - * Returns the index of the last occurrence - * of the specified element within me, - * or -1 if I do not contain the element. - * - * @param element the element to search for - * @return the largest index of an element matching the specified value, - * or -1 if no such matching element can be found - */ - int lastIndexOf(byte element); - - /** - * Returns a - * {@link ByteListIterator bidirectional iterator} - * over all my elements, in the appropriate sequence. - */ - ByteListIterator listIterator(); - - /** - * Returns a - * {@link ByteListIterator bidirectional iterator} - * over all my elements, in the appropriate sequence, - * starting at the specified position. The - * specified index indicates the first - * element that would be returned by an initial - * call to the - * {@link ByteListIterator#next next} - * method. An initial call to the - * {@link ByteListIterator#previous previous} - * method would return the element with the specified - * index minus one. - * - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - ByteListIterator listIterator(int index); - - /** - * Removes the element at the specified position in - * (optional operation). Any subsequent elements - * are shifted to the left, subtracting one from their - * indices. Returns the element that was removed. - * - * @param index the index of the element to remove - * @return the value of the element that was removed - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - byte removeElementAt(int index); - - /** - * Replaces the element at the specified - * position in me with the specified element - * (optional operation). - * - * @param index the index of the element to change - * @param element the value to be stored at the specified position - * @return the value previously stored at the specified position - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - byte set(int index, byte element); - - /** - * Returns a view of the elements within me - * between the specified fromIndex, inclusive, and - * toIndex, exclusive. The returned ByteList - * is backed by me, so that any changes in - * the returned list are reflected in me, and vice-versa. - * The returned list supports all of the optional operations - * that I support. - *

- * Note that when fromIndex == toIndex, - * the returned list is initially empty, and when - * fromIndex == 0 && toIndex == {@link #size() size()} - * the returned list is my "improper" sublist, containing all my elements. - *

- * The semantics of the returned list become undefined - * if I am structurally modified in any way other than - * via the returned list. - * - * @param fromIndex the smallest index (inclusive) in me that appears in - * the returned list - * @param toIndex the largest index (exclusive) in me that appears in the - * returned list - * @return a view of this list from fromIndex (inclusive) to - * toIndex (exclusive) - * - * @throws IndexOutOfBoundsException if either specified index is out of range - */ - ByteList subList(int fromIndex, int toIndex); - -} diff --git a/src/java/org/apache/commons/collections/primitives/ByteListIterator.java b/src/java/org/apache/commons/collections/primitives/ByteListIterator.java deleted file mode 100644 index 1bc9cb714..000000000 --- a/src/java/org/apache/commons/collections/primitives/ByteListIterator.java +++ /dev/null @@ -1,188 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/ByteListIterator.java,v 1.3 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -/** - * A bi-directional iterator over byte values. - * - * @see org.apache.commons.collections.primitives.adapters.ByteListIteratorListIterator - * @see org.apache.commons.collections.primitives.adapters.ListIteratorByteListIterator - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public interface ByteListIterator extends ByteIterator { - /** - * Inserts the specified element into my underlying collection - * (optional operation). - * The element is inserted immediately before the next element - * that would have been returned by {@link #next}, if any, - * and immediately after the next element that would have been - * returned by {@link #previous}, if any. - *

- * The new element is inserted immediately before the implied - * cursor. A subsequent call to {@link #previous} will return - * the added element, a subsequent call to {@link #next} will - * be unaffected. This call increases by one the value that - * would be returned by a call to {@link #nextIndex} or - * {@link #previousIndex}. - * - * @param element the value to be inserted - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException if some aspect of the specified element - * prevents it from being added - */ - void add(byte element); - - /** - * Returns true iff I have more elements - * when traversed in the forward direction. - * (In other words, returns true iff - * a call to {@link #next} will return an element - * rather than throwing an exception. - * - * @return true iff I have more elements when - * traversed in the forward direction - */ - boolean hasNext(); - - /** - * Returns true iff I have more elements - * when traversed in the reverse direction. - * (In other words, returns true iff - * a call to {@link #previous} will return an element - * rather than throwing an exception. - * - * @return true iff I have more elements when - * traversed in the reverse direction - */ - boolean hasPrevious(); - - /** - * Returns the next element in me when traversed in the - * forward direction. - * - * @return the next element in me - * @throws NoSuchElementException if there is no next element - */ - byte next(); - - /** - * Returns the index of the element that would be returned - * by a subsequent call to {@link #next}, or the number - * of elements in my iteration if I have no next element. - * - * @return the index of the next element in me - */ - int nextIndex(); - - /** - * Returns the next element in me when traversed in the - * reverse direction. - * - * @return the previous element in me - * @throws NoSuchElementException if there is no previous element - */ - byte previous(); - - /** - * Returns the index of the element that would be returned - * by a subsequent call to {@link #previous}, or - * -1 if I have no previous element. - * - * @return the index of the previous element in me - */ - int previousIndex(); - - /** - * Removes from my underlying collection the last - * element returned by {@link #next} or {@link #previous} - * (optional operation). - * - * @throws UnsupportedOperationException if this operation is not - * supported - * @throws IllegalStateException if neither {@link #next} nor - * {@link #previous} has yet been called, or - * {@link #remove} or {@link #add} has already been called since - * the last call to {@link #next} or {@link #previous}. - */ - void remove(); - - /** - * Replaces in my underlying collection the last - * element returned by {@link #next} or {@link #previous} - * with the specified value (optional operation). - * - * @param element the value to replace the last returned element with - * @throws UnsupportedOperationException if this operation is not - * supported - * @throws IllegalStateException if neither {@link #next} nor - * {@link #previous} has yet been called, or - * {@link #remove} or {@link #add} has already been called since - * the last call to {@link #next} or {@link #previous}. - * @throws IllegalArgumentException if some aspect of the specified element - * prevents it from being added - */ - void set(byte element); -} diff --git a/src/java/org/apache/commons/collections/primitives/CharCollection.java b/src/java/org/apache/commons/collections/primitives/CharCollection.java deleted file mode 100644 index 67b72c960..000000000 --- a/src/java/org/apache/commons/collections/primitives/CharCollection.java +++ /dev/null @@ -1,248 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/CharCollection.java,v 1.3 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -/** - * A collection of char values. - * - * @see org.apache.commons.collections.primitives.adapters.CharCollectionCollection - * @see org.apache.commons.collections.primitives.adapters.CollectionCharCollection - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public interface CharCollection { - /** - * Ensures that I contain the specified element - * (optional operation). Returns true - * iff I changed as a result of this call. - *

- * If a collection refuses to add the specified - * element for any reason other than that it already contains - * the element, it must throw an exception (rather than - * simply returning false). This preserves the invariant - * that a collection always contains the specified element after - * this call returns. - * - * @param element the value whose presence within me is to be ensured - * @return true iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException may be thrown if some aspect of the - * specified element prevents it from being added to me - */ - boolean add(char element); - - /** - * {@link #add Adds} all of the elements in the - * specified collection to me (optional operation). - * - * @param c the collection of elements whose presence within me is to - * be ensured - * @return true iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException may be thrown if some aspect of some - * specified element prevents it from being added to me - */ - boolean addAll(CharCollection c); - - /** - * Removes all my elements (optional operation). - * I will be {@link #isEmpty empty} after this - * method successfully returns. - * - * @throws UnsupportedOperationException when this operation is not - * supported - */ - void clear(); - - /** - * Returns true iff I contain - * the specified element. - * - * @param element the value whose presence within me is to be tested - * @return true iff I contain the specified element - */ - boolean contains(char element); - - /** - * Returns true iff I {@link #contains contain} - * all of the elements in the given collection. - * - * @param c the collection of elements whose presence within me is to - * be tested - * @return true iff I contain the all the specified elements - */ - boolean containsAll(CharCollection c); - - /** - * Returns true iff I contain no elements. - * @return true iff I contain no elements. - */ - boolean isEmpty(); - - /** - * Returns an {@link CharIterator iterator} over all my elements. - * This base interface places no constraints on the order - * in which the elements are returned by the returned iterator. - * @return an {@link CharIterator iterator} over all my elements. - */ - CharIterator iterator(); - - /** - * Removes all of my elements that are contained in the - * specified collection (optional operation). - * The behavior of this method is unspecified if - * the given collection is modified while this method - * is executing. Note that this includes the case - * in which the given collection is this collection, - * and it is not empty. - * - * @param c the collection of elements to remove - * @return true iff I contained the at least one of the - * specified elements, in other words, returns true - * iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - */ - boolean removeAll(CharCollection c); - - /** - * Removes a single occurrence of the specified element - * (optional operation). - * - * @param element the element to remove, if present - * @return true iff I contained the specified element, - * in other words, iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - */ - boolean removeElement(char element); - - /** - * Removes all of my elements that are not contained in the - * specified collection (optional operation). - * (In other words, retains only my elements that are - * contained in the specified collection.) - * The behavior of this method is unspecified if - * the given collection is modified while this method - * is executing. - * - * @param c the collection of elements to retain - * @return true iff I changed as a result - * of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - */ - boolean retainAll(CharCollection c); - - /** - * Returns the number of elements I contain. - * @return the number of elements I contain - */ - int size(); - - /** - * Returns an array containing all of my elements. - * The length of the returned array will be equal - * to my {@link #size size}. - *

- * The returned array will be independent of me, - * so that callers may modify that - * returned array without modifying this collection. - *

- * When I guarantee the order in which - * elements are returned by an {@link #iterator iterator}, - * the returned array will contain elements in the - * same order. - * - * @return an array containing all my elements - */ - char[] toArray(); - - /** - * Returns an array containing all of my elements, - * using the given array if it is large - * enough. When the length of the given array is - * larger than the number of elements I contain, - * values outside of my range will be unchanged. - *

- * The returned array will be independent of me, - * so that callers may modify that - * returned array without modifying this collection. - *

- * When I guarantee the order in which - * elements are returned by an {@link #iterator iterator}, - * the returned array will contain elements in the - * same order. - * - * @param a an array that may be used to contain the elements - * @return an array containing all my elements - */ - char[] toArray(char[] a); -} diff --git a/src/java/org/apache/commons/collections/primitives/CharIterator.java b/src/java/org/apache/commons/collections/primitives/CharIterator.java deleted file mode 100644 index 89d67ebdb..000000000 --- a/src/java/org/apache/commons/collections/primitives/CharIterator.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/CharIterator.java,v 1.3 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -/** - * An iterator over char values. - * - * @see org.apache.commons.collections.primitives.adapters.CharIteratorIterator - * @see org.apache.commons.collections.primitives.adapters.IteratorCharIterator - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public interface CharIterator { - /** - * Returns true iff I have more elements. - * (In other words, returns true iff - * a subsequent call to {@link #next next} will return - * an element rather than throwing an exception.) - * - * @return true iff I have more elements - */ - boolean hasNext(); - - /** - * Returns the next element in me. - * - * @return the next element in me - * @throws NoSuchElementException if there is no next element - */ - char next(); - - /** - * Removes from my underlying collection the last - * element {@link #next returned} by me - * (optional operation). - * - * @throws UnsupportedOperationException if this operation is not supported - * @throws IllegalStateException if {@link #next} has not yet been - * called, or {@link #remove} has already been called since - * the last call to {@link #next}. - */ - void remove(); -} diff --git a/src/java/org/apache/commons/collections/primitives/CharList.java b/src/java/org/apache/commons/collections/primitives/CharList.java deleted file mode 100644 index 8300b5fe8..000000000 --- a/src/java/org/apache/commons/collections/primitives/CharList.java +++ /dev/null @@ -1,293 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/CharList.java,v 1.4 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -/** - * An ordered collection of char values. - * - * @see org.apache.commons.collections.primitives.adapters.CharListList - * @see org.apache.commons.collections.primitives.adapters.ListCharList - * - * @since Commons Collections 2.2 - * @version $Revision: 1.4 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public interface CharList extends CharCollection { - /** - * Appends the specified element to the end of me - * (optional operation). Returns true - * iff I changed as a result of this call. - *

- * If a collection refuses to add the specified - * element for any reason other than that it already contains - * the element, it must throw an exception (rather than - * simply returning false). This preserves the invariant - * that a collection always contains the specified element after - * this call returns. - * - * @param element the value whose presence within me is to be ensured - * @return true iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException may be thrown if some aspect of the - * specified element prevents it from being added to me - */ - boolean add(char element); - - /** - * Inserts the specified element at the specified position - * (optional operation). Shifts the element currently - * at that position (if any) and any subsequent elements to the - * right, increasing their indices. - * - * @param index the index at which to insert the element - * @param element the value to insert - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException if some aspect of the specified element - * prevents it from being added to me - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - void add(int index, char element); - - /** - * Inserts all of the elements in the specified collection into me, - * at the specified position (optional operation). Shifts the - * element currently at that position (if any) and any subsequent - * elements to the right, increasing their indices. The new elements - * will appear in the order that they are returned by the given - * collection's {@link CharCollection#iterator iterator}. - * - * @param index the index at which to insert the first element from - * the specified collection - * @param collection the {@link CharCollection CharCollection} of elements to add - * @return true iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - boolean addAll(int index, CharCollection collection); - - /** - * Returns true iff that is an CharList - * that contains the same elements in the same order as me. - * In other words, returns true iff that is - * an CharList that has the same {@link #size size} as me, - * and for which the elements returned by its - * {@link CharList#iterator iterator} are equal (==) to - * the corresponding elements within me. - * (This contract ensures that this method works properly across - * different implementations of the CharList interface.) - * - * @param that the object to compare to me - * @return true iff that is an CharList - * that contains the same elements in the same order as me - */ - boolean equals(Object that); - - /** - * Returns the value of the element at the specified position - * within me. - * - * @param index the index of the element to return - * @return the value of the element at the specified position - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - char get(int index); - - /** - * Returns my hash code. - *

- * The hash code of an CharList is defined to be the - * result of the following calculation: - *

 int hash = 1;
-     * for(CharIterator iter = iterator(); iter.hasNext(); ) {
-     *   char value = iter.next();
-     *   hash = 31*hash + (int)(value ^ (value >>> 32));
-     * }
- *

- * This contract ensures that this method is consistent with - * {@link #equals equals} and with the - * {@link java.util.List#hashCode hashCode} - * method of a {@link java.util.List List} of {@link Character}s. - * - * @return my hash code - */ - int hashCode(); - - /** - * Returns the index of the first occurrence - * of the specified element within me, - * or -1 if I do not contain - * the element. - * - * @param element the element to search for - * @return the smallest index of an element matching the specified value, - * or -1 if no such matching element can be found - */ - int indexOf(char element); - - /** - * Returns an {@link CharIterator iterator} over all my elements, - * in the appropriate sequence. - * @return an {@link CharIterator iterator} over all my elements. - */ - CharIterator iterator(); - - /** - * Returns the index of the last occurrence - * of the specified element within me, - * or -1 if I do not contain the element. - * - * @param element the element to search for - * @return the largest index of an element matching the specified value, - * or -1 if no such matching element can be found - */ - int lastIndexOf(char element); - - /** - * Returns a - * {@link CharListIterator bidirectional iterator} - * over all my elements, in the appropriate sequence. - */ - CharListIterator listIterator(); - - /** - * Returns a - * {@link CharListIterator bidirectional iterator} - * over all my elements, in the appropriate sequence, - * starting at the specified position. The - * specified index indicates the first - * element that would be returned by an initial - * call to the - * {@link CharListIterator#next next} - * method. An initial call to the - * {@link CharListIterator#previous previous} - * method would return the element with the specified - * index minus one. - * - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - CharListIterator listIterator(int index); - - /** - * Removes the element at the specified position in - * (optional operation). Any subsequent elements - * are shifted to the left, subtracting one from their - * indices. Returns the element that was removed. - * - * @param index the index of the element to remove - * @return the value of the element that was removed - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - char removeElementAt(int index); - - /** - * Replaces the element at the specified - * position in me with the specified element - * (optional operation). - * - * @param index the index of the element to change - * @param element the value to be stored at the specified position - * @return the value previously stored at the specified position - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - char set(int index, char element); - - /** - * Returns a view of the elements within me - * between the specified fromIndex, inclusive, and - * toIndex, exclusive. The returned CharList - * is backed by me, so that any changes in - * the returned list are reflected in me, and vice-versa. - * The returned list supports all of the optional operations - * that I support. - *

- * Note that when fromIndex == toIndex, - * the returned list is initially empty, and when - * fromIndex == 0 && toIndex == {@link #size() size()} - * the returned list is my "improper" sublist, containing all my elements. - *

- * The semantics of the returned list become undefined - * if I am structurally modified in any way other than - * via the returned list. - * - * @param fromIndex the smallest index (inclusive) in me that appears in - * the returned list - * @param toIndex the largest index (exclusive) in me that appears in the - * returned list - * @return a view of this list from fromIndex (inclusive) to - * toIndex (exclusive) - * - * @throws IndexOutOfBoundsException if either specified index is out of range - */ - CharList subList(int fromIndex, int toIndex); - -} diff --git a/src/java/org/apache/commons/collections/primitives/CharListIterator.java b/src/java/org/apache/commons/collections/primitives/CharListIterator.java deleted file mode 100644 index 67732df71..000000000 --- a/src/java/org/apache/commons/collections/primitives/CharListIterator.java +++ /dev/null @@ -1,188 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/CharListIterator.java,v 1.3 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -/** - * A bi-directional iterator over char values. - * - * @see org.apache.commons.collections.primitives.adapters.CharListIteratorListIterator - * @see org.apache.commons.collections.primitives.adapters.ListIteratorCharListIterator - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public interface CharListIterator extends CharIterator { - /** - * Inserts the specified element into my underlying collection - * (optional operation). - * The element is inserted immediately before the next element - * that would have been returned by {@link #next}, if any, - * and immediately after the next element that would have been - * returned by {@link #previous}, if any. - *

- * The new element is inserted immediately before the implied - * cursor. A subsequent call to {@link #previous} will return - * the added element, a subsequent call to {@link #next} will - * be unaffected. This call increases by one the value that - * would be returned by a call to {@link #nextIndex} or - * {@link #previousIndex}. - * - * @param element the value to be inserted - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException if some aspect of the specified element - * prevents it from being added - */ - void add(char element); - - /** - * Returns true iff I have more elements - * when traversed in the forward direction. - * (In other words, returns true iff - * a call to {@link #next} will return an element - * rather than throwing an exception. - * - * @return true iff I have more elements when - * traversed in the forward direction - */ - boolean hasNext(); - - /** - * Returns true iff I have more elements - * when traversed in the reverse direction. - * (In other words, returns true iff - * a call to {@link #previous} will return an element - * rather than throwing an exception. - * - * @return true iff I have more elements when - * traversed in the reverse direction - */ - boolean hasPrevious(); - - /** - * Returns the next element in me when traversed in the - * forward direction. - * - * @return the next element in me - * @throws NoSuchElementException if there is no next element - */ - char next(); - - /** - * Returns the index of the element that would be returned - * by a subsequent call to {@link #next}, or the number - * of elements in my iteration if I have no next element. - * - * @return the index of the next element in me - */ - int nextIndex(); - - /** - * Returns the next element in me when traversed in the - * reverse direction. - * - * @return the previous element in me - * @throws NoSuchElementException if there is no previous element - */ - char previous(); - - /** - * Returns the index of the element that would be returned - * by a subsequent call to {@link #previous}, or - * -1 if I have no previous element. - * - * @return the index of the previous element in me - */ - int previousIndex(); - - /** - * Removes from my underlying collection the last - * element returned by {@link #next} or {@link #previous} - * (optional operation). - * - * @throws UnsupportedOperationException if this operation is not - * supported - * @throws IllegalStateException if neither {@link #next} nor - * {@link #previous} has yet been called, or - * {@link #remove} or {@link #add} has already been called since - * the last call to {@link #next} or {@link #previous}. - */ - void remove(); - - /** - * Replaces in my underlying collection the last - * element returned by {@link #next} or {@link #previous} - * with the specified value (optional operation). - * - * @param element the value to replace the last returned element with - * @throws UnsupportedOperationException if this operation is not - * supported - * @throws IllegalStateException if neither {@link #next} nor - * {@link #previous} has yet been called, or - * {@link #remove} or {@link #add} has already been called since - * the last call to {@link #next} or {@link #previous}. - * @throws IllegalArgumentException if some aspect of the specified element - * prevents it from being added - */ - void set(char element); -} diff --git a/src/java/org/apache/commons/collections/primitives/DoubleCollection.java b/src/java/org/apache/commons/collections/primitives/DoubleCollection.java deleted file mode 100644 index 8697faad9..000000000 --- a/src/java/org/apache/commons/collections/primitives/DoubleCollection.java +++ /dev/null @@ -1,248 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/DoubleCollection.java,v 1.3 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -/** - * A collection of double values. - * - * @see org.apache.commons.collections.primitives.adapters.DoubleCollectionCollection - * @see org.apache.commons.collections.primitives.adapters.CollectionDoubleCollection - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public interface DoubleCollection { - /** - * Ensures that I contain the specified element - * (optional operation). Returns true - * iff I changed as a result of this call. - *

- * If a collection refuses to add the specified - * element for any reason other than that it already contains - * the element, it must throw an exception (rather than - * simply returning false). This preserves the invariant - * that a collection always contains the specified element after - * this call returns. - * - * @param element the value whose presence within me is to be ensured - * @return true iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException may be thrown if some aspect of the - * specified element prevents it from being added to me - */ - boolean add(double element); - - /** - * {@link #add Adds} all of the elements in the - * specified collection to me (optional operation). - * - * @param c the collection of elements whose presence within me is to - * be ensured - * @return true iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException may be thrown if some aspect of some - * specified element prevents it from being added to me - */ - boolean addAll(DoubleCollection c); - - /** - * Removes all my elements (optional operation). - * I will be {@link #isEmpty empty} after this - * method successfully returns. - * - * @throws UnsupportedOperationException when this operation is not - * supported - */ - void clear(); - - /** - * Returns true iff I contain - * the specified element. - * - * @param element the value whose presence within me is to be tested - * @return true iff I contain the specified element - */ - boolean contains(double element); - - /** - * Returns true iff I {@link #contains contain} - * all of the elements in the given collection. - * - * @param c the collection of elements whose presence within me is to - * be tested - * @return true iff I contain the all the specified elements - */ - boolean containsAll(DoubleCollection c); - - /** - * Returns true iff I contain no elements. - * @return true iff I contain no elements. - */ - boolean isEmpty(); - - /** - * Returns an {@link DoubleIterator iterator} over all my elements. - * This base interface places no constraints on the order - * in which the elements are returned by the returned iterator. - * @return an {@link DoubleIterator iterator} over all my elements. - */ - DoubleIterator iterator(); - - /** - * Removes all of my elements that are contained in the - * specified collection (optional operation). - * The behavior of this method is unspecified if - * the given collection is modified while this method - * is executing. Note that this includes the case - * in which the given collection is this collection, - * and it is not empty. - * - * @param c the collection of elements to remove - * @return true iff I contained the at least one of the - * specified elements, in other words, returns true - * iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - */ - boolean removeAll(DoubleCollection c); - - /** - * Removes a single occurrence of the specified element - * (optional operation). - * - * @param element the element to remove, if present - * @return true iff I contained the specified element, - * in other words, iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - */ - boolean removeElement(double element); - - /** - * Removes all of my elements that are not contained in the - * specified collection (optional operation). - * (In other words, retains only my elements that are - * contained in the specified collection.) - * The behavior of this method is unspecified if - * the given collection is modified while this method - * is executing. - * - * @param c the collection of elements to retain - * @return true iff I changed as a result - * of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - */ - boolean retainAll(DoubleCollection c); - - /** - * Returns the number of elements I contain. - * @return the number of elements I contain - */ - int size(); - - /** - * Returns an array containing all of my elements. - * The length of the returned array will be equal - * to my {@link #size size}. - *

- * The returned array will be independent of me, - * so that callers may modify that - * returned array without modifying this collection. - *

- * When I guarantee the order in which - * elements are returned by an {@link #iterator iterator}, - * the returned array will contain elements in the - * same order. - * - * @return an array containing all my elements - */ - double[] toArray(); - - /** - * Returns an array containing all of my elements, - * using the given array if it is large - * enough. When the length of the given array is - * larger than the number of elements I contain, - * values outside of my range will be unchanged. - *

- * The returned array will be independent of me, - * so that callers may modify that - * returned array without modifying this collection. - *

- * When I guarantee the order in which - * elements are returned by an {@link #iterator iterator}, - * the returned array will contain elements in the - * same order. - * - * @param a an array that may be used to contain the elements - * @return an array containing all my elements - */ - double[] toArray(double[] a); -} diff --git a/src/java/org/apache/commons/collections/primitives/DoubleIterator.java b/src/java/org/apache/commons/collections/primitives/DoubleIterator.java deleted file mode 100644 index 762c790b7..000000000 --- a/src/java/org/apache/commons/collections/primitives/DoubleIterator.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/DoubleIterator.java,v 1.3 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -/** - * An iterator over double values. - * - * @see org.apache.commons.collections.primitives.adapters.DoubleIteratorIterator - * @see org.apache.commons.collections.primitives.adapters.IteratorDoubleIterator - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public interface DoubleIterator { - /** - * Returns true iff I have more elements. - * (In other words, returns true iff - * a subsequent call to {@link #next next} will return - * an element rather than throwing an exception.) - * - * @return true iff I have more elements - */ - boolean hasNext(); - - /** - * Returns the next element in me. - * - * @return the next element in me - * @throws NoSuchElementException if there is no next element - */ - double next(); - - /** - * Removes from my underlying collection the last - * element {@link #next returned} by me - * (optional operation). - * - * @throws UnsupportedOperationException if this operation is not supported - * @throws IllegalStateException if {@link #next} has not yet been - * called, or {@link #remove} has already been called since - * the last call to {@link #next}. - */ - void remove(); -} diff --git a/src/java/org/apache/commons/collections/primitives/DoubleList.java b/src/java/org/apache/commons/collections/primitives/DoubleList.java deleted file mode 100644 index 1dbf836d2..000000000 --- a/src/java/org/apache/commons/collections/primitives/DoubleList.java +++ /dev/null @@ -1,293 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/DoubleList.java,v 1.3 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -/** - * An ordered collection of double values. - * - * @see org.apache.commons.collections.primitives.adapters.DoubleListList - * @see org.apache.commons.collections.primitives.adapters.ListDoubleList - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public interface DoubleList extends DoubleCollection { - /** - * Appends the specified element to the end of me - * (optional operation). Returns true - * iff I changed as a result of this call. - *

- * If a collection refuses to add the specified - * element for any reason other than that it already contains - * the element, it must throw an exception (rather than - * simply returning false). This preserves the invariant - * that a collection always contains the specified element after - * this call returns. - * - * @param element the value whose presence within me is to be ensured - * @return true iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException may be thrown if some aspect of the - * specified element prevents it from being added to me - */ - boolean add(double element); - - /** - * Inserts the specified element at the specified position - * (optional operation). Shifts the element currently - * at that position (if any) and any subsequent elements to the - * right, increasing their indices. - * - * @param index the index at which to insert the element - * @param element the value to insert - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException if some aspect of the specified element - * prevents it from being added to me - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - void add(int index, double element); - - /** - * Inserts all of the elements in the specified collection into me, - * at the specified position (optional operation). Shifts the - * element currently at that position (if any) and any subsequent - * elements to the right, increasing their indices. The new elements - * will appear in the order that they are returned by the given - * collection's {@link DoubleCollection#iterator iterator}. - * - * @param index the index at which to insert the first element from - * the specified collection - * @param collection the {@link DoubleCollection DoubleCollection} of elements to add - * @return true iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - boolean addAll(int index, DoubleCollection collection); - - /** - * Returns true iff that is an DoubleList - * that contains the same elements in the same order as me. - * In other words, returns true iff that is - * an DoubleList that has the same {@link #size size} as me, - * and for which the elements returned by its - * {@link DoubleList#iterator iterator} are equal (==) to - * the corresponding elements within me. - * (This contract ensures that this method works properly across - * different implementations of the DoubleList interface.) - * - * @param that the object to compare to me - * @return true iff that is an DoubleList - * that contains the same elements in the same order as me - */ - boolean equals(Object that); - - /** - * Returns the value of the element at the specified position - * within me. - * - * @param index the index of the element to return - * @return the value of the element at the specified position - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - double get(int index); - - /** - * Returns my hash code. - *

- * The hash code of an DoubleList is defined to be the - * result of the following calculation: - *

 int hash = 1;
-     * for(DoubleIterator iter = iterator(); iter.hasNext(); ) {
-     *   double value = iter.next();
-     *   hash = 31*hash + (int)(value ^ (value >>> 32));
-     * }
- *

- * This contract ensures that this method is consistent with - * {@link #equals equals} and with the - * {@link java.util.List#hashCode hashCode} - * method of a {@link java.util.List List} of {@link Double}s. - * - * @return my hash code - */ - int hashCode(); - - /** - * Returns the index of the first occurrence - * of the specified element within me, - * or -1 if I do not contain - * the element. - * - * @param element the element to search for - * @return the smallest index of an element matching the specified value, - * or -1 if no such matching element can be found - */ - int indexOf(double element); - - /** - * Returns an {@link DoubleIterator iterator} over all my elements, - * in the appropriate sequence. - * @return an {@link DoubleIterator iterator} over all my elements. - */ - DoubleIterator iterator(); - - /** - * Returns the index of the last occurrence - * of the specified element within me, - * or -1 if I do not contain the element. - * - * @param element the element to search for - * @return the largest index of an element matching the specified value, - * or -1 if no such matching element can be found - */ - int lastIndexOf(double element); - - /** - * Returns a - * {@link DoubleListIterator bidirectional iterator} - * over all my elements, in the appropriate sequence. - */ - DoubleListIterator listIterator(); - - /** - * Returns a - * {@link DoubleListIterator bidirectional iterator} - * over all my elements, in the appropriate sequence, - * starting at the specified position. The - * specified index indicates the first - * element that would be returned by an initial - * call to the - * {@link DoubleListIterator#next next} - * method. An initial call to the - * {@link DoubleListIterator#previous previous} - * method would return the element with the specified - * index minus one. - * - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - DoubleListIterator listIterator(int index); - - /** - * Removes the element at the specified position in - * (optional operation). Any subsequent elements - * are shifted to the left, subtracting one from their - * indices. Returns the element that was removed. - * - * @param index the index of the element to remove - * @return the value of the element that was removed - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - double removeElementAt(int index); - - /** - * Replaces the element at the specified - * position in me with the specified element - * (optional operation). - * - * @param index the index of the element to change - * @param element the value to be stored at the specified position - * @return the value previously stored at the specified position - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - double set(int index, double element); - - /** - * Returns a view of the elements within me - * between the specified fromIndex, inclusive, and - * toIndex, exclusive. The returned DoubleList - * is backed by me, so that any changes in - * the returned list are reflected in me, and vice-versa. - * The returned list supports all of the optional operations - * that I support. - *

- * Note that when fromIndex == toIndex, - * the returned list is initially empty, and when - * fromIndex == 0 && toIndex == {@link #size() size()} - * the returned list is my "improper" sublist, containing all my elements. - *

- * The semantics of the returned list become undefined - * if I am structurally modified in any way other than - * via the returned list. - * - * @param fromIndex the smallest index (inclusive) in me that appears in - * the returned list - * @param toIndex the largest index (exclusive) in me that appears in the - * returned list - * @return a view of this list from fromIndex (inclusive) to - * toIndex (exclusive) - * - * @throws IndexOutOfBoundsException if either specified index is out of range - */ - DoubleList subList(int fromIndex, int toIndex); - -} diff --git a/src/java/org/apache/commons/collections/primitives/DoubleListIterator.java b/src/java/org/apache/commons/collections/primitives/DoubleListIterator.java deleted file mode 100644 index a952c543d..000000000 --- a/src/java/org/apache/commons/collections/primitives/DoubleListIterator.java +++ /dev/null @@ -1,188 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/DoubleListIterator.java,v 1.3 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -/** - * A bi-directional iterator over double values. - * - * @see org.apache.commons.collections.primitives.adapters.DoubleListIteratorListIterator - * @see org.apache.commons.collections.primitives.adapters.ListIteratorDoubleListIterator - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public interface DoubleListIterator extends DoubleIterator { - /** - * Inserts the specified element into my underlying collection - * (optional operation). - * The element is inserted immediately before the next element - * that would have been returned by {@link #next}, if any, - * and immediately after the next element that would have been - * returned by {@link #previous}, if any. - *

- * The new element is inserted immediately before the implied - * cursor. A subsequent call to {@link #previous} will return - * the added element, a subsequent call to {@link #next} will - * be unaffected. This call increases by one the value that - * would be returned by a call to {@link #nextIndex} or - * {@link #previousIndex}. - * - * @param element the value to be inserted - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException if some aspect of the specified element - * prevents it from being added - */ - void add(double element); - - /** - * Returns true iff I have more elements - * when traversed in the forward direction. - * (In other words, returns true iff - * a call to {@link #next} will return an element - * rather than throwing an exception. - * - * @return true iff I have more elements when - * traversed in the forward direction - */ - boolean hasNext(); - - /** - * Returns true iff I have more elements - * when traversed in the reverse direction. - * (In other words, returns true iff - * a call to {@link #previous} will return an element - * rather than throwing an exception. - * - * @return true iff I have more elements when - * traversed in the reverse direction - */ - boolean hasPrevious(); - - /** - * Returns the next element in me when traversed in the - * forward direction. - * - * @return the next element in me - * @throws NoSuchElementException if there is no next element - */ - double next(); - - /** - * Returns the index of the element that would be returned - * by a subsequent call to {@link #next}, or the number - * of elements in my iteration if I have no next element. - * - * @return the index of the next element in me - */ - int nextIndex(); - - /** - * Returns the next element in me when traversed in the - * reverse direction. - * - * @return the previous element in me - * @throws NoSuchElementException if there is no previous element - */ - double previous(); - - /** - * Returns the index of the element that would be returned - * by a subsequent call to {@link #previous}, or - * -1 if I have no previous element. - * - * @return the index of the previous element in me - */ - int previousIndex(); - - /** - * Removes from my underlying collection the last - * element returned by {@link #next} or {@link #previous} - * (optional operation). - * - * @throws UnsupportedOperationException if this operation is not - * supported - * @throws IllegalStateException if neither {@link #next} nor - * {@link #previous} has yet been called, or - * {@link #remove} or {@link #add} has already been called since - * the last call to {@link #next} or {@link #previous}. - */ - void remove(); - - /** - * Replaces in my underlying collection the last - * element returned by {@link #next} or {@link #previous} - * with the specified value (optional operation). - * - * @param element the value to replace the last returned element with - * @throws UnsupportedOperationException if this operation is not - * supported - * @throws IllegalStateException if neither {@link #next} nor - * {@link #previous} has yet been called, or - * {@link #remove} or {@link #add} has already been called since - * the last call to {@link #next} or {@link #previous}. - * @throws IllegalArgumentException if some aspect of the specified element - * prevents it from being added - */ - void set(double element); -} diff --git a/src/java/org/apache/commons/collections/primitives/FloatCollection.java b/src/java/org/apache/commons/collections/primitives/FloatCollection.java deleted file mode 100644 index d9ef64e6a..000000000 --- a/src/java/org/apache/commons/collections/primitives/FloatCollection.java +++ /dev/null @@ -1,248 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/FloatCollection.java,v 1.3 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -/** - * A collection of float values. - * - * @see org.apache.commons.collections.primitives.adapters.FloatCollectionCollection - * @see org.apache.commons.collections.primitives.adapters.CollectionFloatCollection - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public interface FloatCollection { - /** - * Ensures that I contain the specified element - * (optional operation). Returns true - * iff I changed as a result of this call. - *

- * If a collection refuses to add the specified - * element for any reason other than that it already contains - * the element, it must throw an exception (rather than - * simply returning false). This preserves the invariant - * that a collection always contains the specified element after - * this call returns. - * - * @param element the value whose presence within me is to be ensured - * @return true iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException may be thrown if some aspect of the - * specified element prevents it from being added to me - */ - boolean add(float element); - - /** - * {@link #add Adds} all of the elements in the - * specified collection to me (optional operation). - * - * @param c the collection of elements whose presence within me is to - * be ensured - * @return true iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException may be thrown if some aspect of some - * specified element prevents it from being added to me - */ - boolean addAll(FloatCollection c); - - /** - * Removes all my elements (optional operation). - * I will be {@link #isEmpty empty} after this - * method successfully returns. - * - * @throws UnsupportedOperationException when this operation is not - * supported - */ - void clear(); - - /** - * Returns true iff I contain - * the specified element. - * - * @param element the value whose presence within me is to be tested - * @return true iff I contain the specified element - */ - boolean contains(float element); - - /** - * Returns true iff I {@link #contains contain} - * all of the elements in the given collection. - * - * @param c the collection of elements whose presence within me is to - * be tested - * @return true iff I contain the all the specified elements - */ - boolean containsAll(FloatCollection c); - - /** - * Returns true iff I contain no elements. - * @return true iff I contain no elements. - */ - boolean isEmpty(); - - /** - * Returns an {@link FloatIterator iterator} over all my elements. - * This base interface places no constraints on the order - * in which the elements are returned by the returned iterator. - * @return an {@link FloatIterator iterator} over all my elements. - */ - FloatIterator iterator(); - - /** - * Removes all of my elements that are contained in the - * specified collection (optional operation). - * The behavior of this method is unspecified if - * the given collection is modified while this method - * is executing. Note that this includes the case - * in which the given collection is this collection, - * and it is not empty. - * - * @param c the collection of elements to remove - * @return true iff I contained the at least one of the - * specified elements, in other words, returns true - * iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - */ - boolean removeAll(FloatCollection c); - - /** - * Removes a single occurrence of the specified element - * (optional operation). - * - * @param element the element to remove, if present - * @return true iff I contained the specified element, - * in other words, iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - */ - boolean removeElement(float element); - - /** - * Removes all of my elements that are not contained in the - * specified collection (optional operation). - * (In other words, retains only my elements that are - * contained in the specified collection.) - * The behavior of this method is unspecified if - * the given collection is modified while this method - * is executing. - * - * @param c the collection of elements to retain - * @return true iff I changed as a result - * of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - */ - boolean retainAll(FloatCollection c); - - /** - * Returns the number of elements I contain. - * @return the number of elements I contain - */ - int size(); - - /** - * Returns an array containing all of my elements. - * The length of the returned array will be equal - * to my {@link #size size}. - *

- * The returned array will be independent of me, - * so that callers may modify that - * returned array without modifying this collection. - *

- * When I guarantee the order in which - * elements are returned by an {@link #iterator iterator}, - * the returned array will contain elements in the - * same order. - * - * @return an array containing all my elements - */ - float[] toArray(); - - /** - * Returns an array containing all of my elements, - * using the given array if it is large - * enough. When the length of the given array is - * larger than the number of elements I contain, - * values outside of my range will be unchanged. - *

- * The returned array will be independent of me, - * so that callers may modify that - * returned array without modifying this collection. - *

- * When I guarantee the order in which - * elements are returned by an {@link #iterator iterator}, - * the returned array will contain elements in the - * same order. - * - * @param a an array that may be used to contain the elements - * @return an array containing all my elements - */ - float[] toArray(float[] a); -} diff --git a/src/java/org/apache/commons/collections/primitives/FloatIterator.java b/src/java/org/apache/commons/collections/primitives/FloatIterator.java deleted file mode 100644 index c8a2de36a..000000000 --- a/src/java/org/apache/commons/collections/primitives/FloatIterator.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/FloatIterator.java,v 1.3 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -/** - * An iterator over float values. - * - * @see org.apache.commons.collections.primitives.adapters.FloatIteratorIterator - * @see org.apache.commons.collections.primitives.adapters.IteratorFloatIterator - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public interface FloatIterator { - /** - * Returns true iff I have more elements. - * (In other words, returns true iff - * a subsequent call to {@link #next next} will return - * an element rather than throwing an exception.) - * - * @return true iff I have more elements - */ - boolean hasNext(); - - /** - * Returns the next element in me. - * - * @return the next element in me - * @throws NoSuchElementException if there is no next element - */ - float next(); - - /** - * Removes from my underlying collection the last - * element {@link #next returned} by me - * (optional operation). - * - * @throws UnsupportedOperationException if this operation is not supported - * @throws IllegalStateException if {@link #next} has not yet been - * called, or {@link #remove} has already been called since - * the last call to {@link #next}. - */ - void remove(); -} diff --git a/src/java/org/apache/commons/collections/primitives/FloatList.java b/src/java/org/apache/commons/collections/primitives/FloatList.java deleted file mode 100644 index 0e9dbb024..000000000 --- a/src/java/org/apache/commons/collections/primitives/FloatList.java +++ /dev/null @@ -1,293 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/FloatList.java,v 1.3 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -/** - * An ordered collection of float values. - * - * @see org.apache.commons.collections.primitives.adapters.FloatListList - * @see org.apache.commons.collections.primitives.adapters.ListFloatList - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public interface FloatList extends FloatCollection { - /** - * Appends the specified element to the end of me - * (optional operation). Returns true - * iff I changed as a result of this call. - *

- * If a collection refuses to add the specified - * element for any reason other than that it already contains - * the element, it must throw an exception (rather than - * simply returning false). This preserves the invariant - * that a collection always contains the specified element after - * this call returns. - * - * @param element the value whose presence within me is to be ensured - * @return true iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException may be thrown if some aspect of the - * specified element prevents it from being added to me - */ - boolean add(float element); - - /** - * Inserts the specified element at the specified position - * (optional operation). Shifts the element currently - * at that position (if any) and any subsequent elements to the - * right, increasing their indices. - * - * @param index the index at which to insert the element - * @param element the value to insert - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException if some aspect of the specified element - * prevents it from being added to me - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - void add(int index, float element); - - /** - * Inserts all of the elements in the specified collection into me, - * at the specified position (optional operation). Shifts the - * element currently at that position (if any) and any subsequent - * elements to the right, increasing their indices. The new elements - * will appear in the order that they are returned by the given - * collection's {@link FloatCollection#iterator iterator}. - * - * @param index the index at which to insert the first element from - * the specified collection - * @param collection the {@link FloatCollection FloatCollection} of elements to add - * @return true iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - boolean addAll(int index, FloatCollection collection); - - /** - * Returns true iff that is an FloatList - * that contains the same elements in the same order as me. - * In other words, returns true iff that is - * an FloatList that has the same {@link #size size} as me, - * and for which the elements returned by its - * {@link FloatList#iterator iterator} are equal (==) to - * the corresponding elements within me. - * (This contract ensures that this method works properly across - * different implementations of the FloatList interface.) - * - * @param that the object to compare to me - * @return true iff that is an FloatList - * that contains the same elements in the same order as me - */ - boolean equals(Object that); - - /** - * Returns the value of the element at the specified position - * within me. - * - * @param index the index of the element to return - * @return the value of the element at the specified position - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - float get(int index); - - /** - * Returns my hash code. - *

- * The hash code of an FloatList is defined to be the - * result of the following calculation: - *

 int hash = 1;
-     * for(FloatIterator iter = iterator(); iter.hasNext(); ) {
-     *   float value = iter.next();
-     *   hash = 31*hash + (int)(value ^ (value >>> 32));
-     * }
- *

- * This contract ensures that this method is consistent with - * {@link #equals equals} and with the - * {@link java.util.List#hashCode hashCode} - * method of a {@link java.util.List List} of {@link Float}s. - * - * @return my hash code - */ - int hashCode(); - - /** - * Returns the index of the first occurrence - * of the specified element within me, - * or -1 if I do not contain - * the element. - * - * @param element the element to search for - * @return the smallest index of an element matching the specified value, - * or -1 if no such matching element can be found - */ - int indexOf(float element); - - /** - * Returns an {@link FloatIterator iterator} over all my elements, - * in the appropriate sequence. - * @return an {@link FloatIterator iterator} over all my elements. - */ - FloatIterator iterator(); - - /** - * Returns the index of the last occurrence - * of the specified element within me, - * or -1 if I do not contain the element. - * - * @param element the element to search for - * @return the largest index of an element matching the specified value, - * or -1 if no such matching element can be found - */ - int lastIndexOf(float element); - - /** - * Returns a - * {@link FloatListIterator bidirectional iterator} - * over all my elements, in the appropriate sequence. - */ - FloatListIterator listIterator(); - - /** - * Returns a - * {@link FloatListIterator bidirectional iterator} - * over all my elements, in the appropriate sequence, - * starting at the specified position. The - * specified index indicates the first - * element that would be returned by an initial - * call to the - * {@link FloatListIterator#next next} - * method. An initial call to the - * {@link FloatListIterator#previous previous} - * method would return the element with the specified - * index minus one. - * - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - FloatListIterator listIterator(int index); - - /** - * Removes the element at the specified position in - * (optional operation). Any subsequent elements - * are shifted to the left, subtracting one from their - * indices. Returns the element that was removed. - * - * @param index the index of the element to remove - * @return the value of the element that was removed - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - float removeElementAt(int index); - - /** - * Replaces the element at the specified - * position in me with the specified element - * (optional operation). - * - * @param index the index of the element to change - * @param element the value to be stored at the specified position - * @return the value previously stored at the specified position - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - float set(int index, float element); - - /** - * Returns a view of the elements within me - * between the specified fromIndex, inclusive, and - * toIndex, exclusive. The returned FloatList - * is backed by me, so that any changes in - * the returned list are reflected in me, and vice-versa. - * The returned list supports all of the optional operations - * that I support. - *

- * Note that when fromIndex == toIndex, - * the returned list is initially empty, and when - * fromIndex == 0 && toIndex == {@link #size() size()} - * the returned list is my "improper" sublist, containing all my elements. - *

- * The semantics of the returned list become undefined - * if I am structurally modified in any way other than - * via the returned list. - * - * @param fromIndex the smallest index (inclusive) in me that appears in - * the returned list - * @param toIndex the largest index (exclusive) in me that appears in the - * returned list - * @return a view of this list from fromIndex (inclusive) to - * toIndex (exclusive) - * - * @throws IndexOutOfBoundsException if either specified index is out of range - */ - FloatList subList(int fromIndex, int toIndex); - -} diff --git a/src/java/org/apache/commons/collections/primitives/FloatListIterator.java b/src/java/org/apache/commons/collections/primitives/FloatListIterator.java deleted file mode 100644 index 9d822722f..000000000 --- a/src/java/org/apache/commons/collections/primitives/FloatListIterator.java +++ /dev/null @@ -1,188 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/FloatListIterator.java,v 1.3 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -/** - * A bi-directional iterator over float values. - * - * @see org.apache.commons.collections.primitives.adapters.FloatListIteratorListIterator - * @see org.apache.commons.collections.primitives.adapters.ListIteratorFloatListIterator - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public interface FloatListIterator extends FloatIterator { - /** - * Inserts the specified element into my underlying collection - * (optional operation). - * The element is inserted immediately before the next element - * that would have been returned by {@link #next}, if any, - * and immediately after the next element that would have been - * returned by {@link #previous}, if any. - *

- * The new element is inserted immediately before the implied - * cursor. A subsequent call to {@link #previous} will return - * the added element, a subsequent call to {@link #next} will - * be unaffected. This call increases by one the value that - * would be returned by a call to {@link #nextIndex} or - * {@link #previousIndex}. - * - * @param element the value to be inserted - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException if some aspect of the specified element - * prevents it from being added - */ - void add(float element); - - /** - * Returns true iff I have more elements - * when traversed in the forward direction. - * (In other words, returns true iff - * a call to {@link #next} will return an element - * rather than throwing an exception. - * - * @return true iff I have more elements when - * traversed in the forward direction - */ - boolean hasNext(); - - /** - * Returns true iff I have more elements - * when traversed in the reverse direction. - * (In other words, returns true iff - * a call to {@link #previous} will return an element - * rather than throwing an exception. - * - * @return true iff I have more elements when - * traversed in the reverse direction - */ - boolean hasPrevious(); - - /** - * Returns the next element in me when traversed in the - * forward direction. - * - * @return the next element in me - * @throws NoSuchElementException if there is no next element - */ - float next(); - - /** - * Returns the index of the element that would be returned - * by a subsequent call to {@link #next}, or the number - * of elements in my iteration if I have no next element. - * - * @return the index of the next element in me - */ - int nextIndex(); - - /** - * Returns the next element in me when traversed in the - * reverse direction. - * - * @return the previous element in me - * @throws NoSuchElementException if there is no previous element - */ - float previous(); - - /** - * Returns the index of the element that would be returned - * by a subsequent call to {@link #previous}, or - * -1 if I have no previous element. - * - * @return the index of the previous element in me - */ - int previousIndex(); - - /** - * Removes from my underlying collection the last - * element returned by {@link #next} or {@link #previous} - * (optional operation). - * - * @throws UnsupportedOperationException if this operation is not - * supported - * @throws IllegalStateException if neither {@link #next} nor - * {@link #previous} has yet been called, or - * {@link #remove} or {@link #add} has already been called since - * the last call to {@link #next} or {@link #previous}. - */ - void remove(); - - /** - * Replaces in my underlying collection the last - * element returned by {@link #next} or {@link #previous} - * with the specified value (optional operation). - * - * @param element the value to replace the last returned element with - * @throws UnsupportedOperationException if this operation is not - * supported - * @throws IllegalStateException if neither {@link #next} nor - * {@link #previous} has yet been called, or - * {@link #remove} or {@link #add} has already been called since - * the last call to {@link #next} or {@link #previous}. - * @throws IllegalArgumentException if some aspect of the specified element - * prevents it from being added - */ - void set(float element); -} diff --git a/src/java/org/apache/commons/collections/primitives/IntCollection.java b/src/java/org/apache/commons/collections/primitives/IntCollection.java deleted file mode 100644 index 025bfa342..000000000 --- a/src/java/org/apache/commons/collections/primitives/IntCollection.java +++ /dev/null @@ -1,248 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/IntCollection.java,v 1.7 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -/** - * A collection of int values. - * - * @see org.apache.commons.collections.primitives.adapters.IntCollectionCollection - * @see org.apache.commons.collections.primitives.adapters.CollectionIntCollection - * - * @since Commons Collections 2.2 - * @version $Revision: 1.7 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public interface IntCollection { - /** - * Ensures that I contain the specified element - * (optional operation). Returns true - * iff I changed as a result of this call. - *

- * If a collection refuses to add the specified - * element for any reason other than that it already contains - * the element, it must throw an exception (rather than - * simply returning false). This preserves the invariant - * that a collection always contains the specified element after - * this call returns. - * - * @param element the value whose presence within me is to be ensured - * @return true iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException may be thrown if some aspect of the - * specified element prevents it from being added to me - */ - boolean add(int element); - - /** - * {@link #add Adds} all of the elements in the - * specified collection to me (optional operation). - * - * @param c the collection of elements whose presence within me is to - * be ensured - * @return true iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException may be thrown if some aspect of some - * specified element prevents it from being added to me - */ - boolean addAll(IntCollection c); - - /** - * Removes all my elements (optional operation). - * I will be {@link #isEmpty empty} after this - * method successfully returns. - * - * @throws UnsupportedOperationException when this operation is not - * supported - */ - void clear(); - - /** - * Returns true iff I contain - * the specified element. - * - * @param element the value whose presence within me is to be tested - * @return true iff I contain the specified element - */ - boolean contains(int element); - - /** - * Returns true iff I {@link #contains contain} - * all of the elements in the given collection. - * - * @param c the collection of elements whose presence within me is to - * be tested - * @return true iff I contain the all the specified elements - */ - boolean containsAll(IntCollection c); - - /** - * Returns true iff I contain no elements. - * @return true iff I contain no elements. - */ - boolean isEmpty(); - - /** - * Returns an {@link IntIterator iterator} over all my elements. - * This base interface places no constraints on the order - * in which the elements are returned by the returned iterator. - * @return an {@link IntIterator iterator} over all my elements. - */ - IntIterator iterator(); - - /** - * Removes all of my elements that are contained in the - * specified collection (optional operation). - * The behavior of this method is unspecified if - * the given collection is modified while this method - * is executing. Note that this includes the case - * in which the given collection is this collection, - * and it is not empty. - * - * @param c the collection of elements to remove - * @return true iff I contained the at least one of the - * specified elements, in other words, returns true - * iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - */ - boolean removeAll(IntCollection c); - - /** - * Removes a single occurrence of the specified element - * (optional operation). - * - * @param element the element to remove, if present - * @return true iff I contained the specified element, - * in other words, iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - */ - boolean removeElement(int element); - - /** - * Removes all of my elements that are not contained in the - * specified collection (optional operation). - * (In other words, retains only my elements that are - * contained in the specified collection.) - * The behavior of this method is unspecified if - * the given collection is modified while this method - * is executing. - * - * @param c the collection of elements to retain - * @return true iff I changed as a result - * of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - */ - boolean retainAll(IntCollection c); - - /** - * Returns the number of elements I contain. - * @return the number of elements I contain - */ - int size(); - - /** - * Returns an array containing all of my elements. - * The length of the returned array will be equal - * to my {@link #size size}. - *

- * The returned array will be independent of me, - * so that callers may modify that - * returned array without modifying this collection. - *

- * When I guarantee the order in which - * elements are returned by an {@link #iterator iterator}, - * the returned array will contain elements in the - * same order. - * - * @return an array containing all my elements - */ - int[] toArray(); - - /** - * Returns an array containing all of my elements, - * using the given array if it is large - * enough. When the length of the given array is - * larger than the number of elements I contain, - * values outside of my range will be unchanged. - *

- * The returned array will be independent of me, - * so that callers may modify that - * returned array without modifying this collection. - *

- * When I guarantee the order in which - * elements are returned by an {@link #iterator iterator}, - * the returned array will contain elements in the - * same order. - * - * @param a an array that may be used to contain the elements - * @return an array containing all my elements - */ - int[] toArray(int[] a); -} diff --git a/src/java/org/apache/commons/collections/primitives/IntCollections.java b/src/java/org/apache/commons/collections/primitives/IntCollections.java deleted file mode 100644 index fbd820582..000000000 --- a/src/java/org/apache/commons/collections/primitives/IntCollections.java +++ /dev/null @@ -1,195 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/IntCollections.java,v 1.5 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -import org.apache.commons.collections.primitives.decorators.UnmodifiableIntIterator; -import org.apache.commons.collections.primitives.decorators.UnmodifiableIntList; -import org.apache.commons.collections.primitives.decorators.UnmodifiableIntListIterator; - -/** - * This class consists exclusively of static methods that operate on or - * return IntCollections. - *

- * The methods of this class all throw a NullPointerException is the - * provided collections are null. - * - * @version $Revision: 1.5 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public final class IntCollections { - - /** - * Returns an unmodifiable IntList containing only the specified element. - * @param value the single value - * @return an unmodifiable IntList containing only the specified element. - */ - public static IntList singletonIntList(int value) { - // TODO: a specialized implementation of IntList may be more performant - IntList list = new ArrayIntList(1); - list.add(value); - return UnmodifiableIntList.wrap(list); - } - - /** - * Returns an unmodifiable IntIterator containing only the specified element. - * @param value the single value - * @return an unmodifiable IntIterator containing only the specified element. - */ - public static IntIterator singletonIntIterator(int value) { - return singletonIntList(value).iterator(); - } - - /** - * Returns an unmodifiable IntListIterator containing only the specified element. - * @param value the single value - * @return an unmodifiable IntListIterator containing only the specified element. - */ - public static IntListIterator singletonIntListIterator(int value) { - return singletonIntList(value).listIterator(); - } - - /** - * Returns an unmodifiable version of the given non-null IntList. - * @param list the non-null IntList to wrap in an unmodifiable decorator - * @return an unmodifiable version of the given non-null IntList - * @throws NullPointerException if the given IntList is null - * @see org.apache.commons.collections.primitives.decorators.UnmodifiableIntList#wrap - */ - public static IntList unmodifiableIntList(IntList list) throws NullPointerException { - if(null == list) { - throw new NullPointerException(); - } - return UnmodifiableIntList.wrap(list); - } - - /** - * Returns an unmodifiable version of the given non-null IntIterator. - * @param iter the non-null IntIterator to wrap in an unmodifiable decorator - * @return an unmodifiable version of the given non-null IntIterator - * @throws NullPointerException if the given IntIterator is null - * @see org.apache.commons.collections.primitives.decorators.UnmodifiableIntIterator#wrap - */ - public static IntIterator unmodifiableIntIterator(IntIterator iter) { - if(null == iter) { - throw new NullPointerException(); - } - return UnmodifiableIntIterator.wrap(iter); - } - - /** - * Returns an unmodifiable version of the given non-null IntListIterator. - * @param iter the non-null IntListIterator to wrap in an unmodifiable decorator - * @return an unmodifiable version of the given non-null IntListIterator - * @throws NullPointerException if the given IntListIterator is null - * @see org.apache.commons.collections.primitives.decorators.UnmodifiableIntListIterator#wrap - */ - public static IntListIterator unmodifiableIntListIterator(IntListIterator iter) { - if(null == iter) { - throw new NullPointerException(); - } - return UnmodifiableIntListIterator.wrap(iter); - } - - /** - * Returns an unmodifiable, empty IntList. - * @return an unmodifiable, empty IntList. - * @see #EMPTY_INT_LIST - */ - public static IntList getEmptyIntList() { - return EMPTY_INT_LIST; - } - - /** - * Returns an unmodifiable, empty IntIterator - * @return an unmodifiable, empty IntIterator. - * @see #EMPTY_INT_ITERATOR - */ - public static IntIterator getEmptyIntIterator() { - return EMPTY_INT_ITERATOR; - } - - /** - * Returns an unmodifiable, empty IntListIterator - * @return an unmodifiable, empty IntListIterator. - * @see #EMPTY_INT_LIST_ITERATOR - */ - public static IntListIterator getEmptyIntListIterator() { - return EMPTY_INT_LIST_ITERATOR; - } - - /** - * An unmodifiable, empty IntList - * @see #getEmptyIntList - */ - public static final IntList EMPTY_INT_LIST = unmodifiableIntList(new ArrayIntList(0)); - - /** - * An unmodifiable, empty IntIterator - * @see #getEmptyIntIterator - */ - public static final IntIterator EMPTY_INT_ITERATOR = unmodifiableIntIterator(EMPTY_INT_LIST.iterator()); - - /** - * An unmodifiable, empty IntListIterator - * @see #getEmptyIntListIterator - */ - public static final IntListIterator EMPTY_INT_LIST_ITERATOR = unmodifiableIntListIterator(EMPTY_INT_LIST.listIterator()); -} diff --git a/src/java/org/apache/commons/collections/primitives/IntIterator.java b/src/java/org/apache/commons/collections/primitives/IntIterator.java deleted file mode 100644 index ba7726460..000000000 --- a/src/java/org/apache/commons/collections/primitives/IntIterator.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/IntIterator.java,v 1.7 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -/** - * An iterator over int values. - * - * @see org.apache.commons.collections.primitives.adapters.IntIteratorIterator - * @see org.apache.commons.collections.primitives.adapters.IteratorIntIterator - * - * @since Commons Collections 2.2 - * @version $Revision: 1.7 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public interface IntIterator { - /** - * Returns true iff I have more elements. - * (In other words, returns true iff - * a subsequent call to {@link #next next} will return - * an element rather than throwing an exception.) - * - * @return true iff I have more elements - */ - boolean hasNext(); - - /** - * Returns the next element in me. - * - * @return the next element in me - * @throws NoSuchElementException if there is no next element - */ - int next(); - - /** - * Removes from my underlying collection the last - * element {@link #next returned} by me - * (optional operation). - * - * @throws UnsupportedOperationException if this operation is not supported - * @throws IllegalStateException if {@link #next} has not yet been - * called, or {@link #remove} has already been called since - * the last call to {@link #next}. - */ - void remove(); -} diff --git a/src/java/org/apache/commons/collections/primitives/IntList.java b/src/java/org/apache/commons/collections/primitives/IntList.java deleted file mode 100644 index fee9b251e..000000000 --- a/src/java/org/apache/commons/collections/primitives/IntList.java +++ /dev/null @@ -1,292 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/IntList.java,v 1.15 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -/** - * An ordered collection of int values. - * - * @see org.apache.commons.collections.primitives.adapters.IntListList - * @see org.apache.commons.collections.primitives.adapters.ListIntList - * - * @since Commons Collections 2.2 - * @version $Revision: 1.15 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public interface IntList extends IntCollection { - /** - * Appends the specified element to the end of me - * (optional operation). Returns true - * iff I changed as a result of this call. - *

- * If a collection refuses to add the specified - * element for any reason other than that it already contains - * the element, it must throw an exception (rather than - * simply returning false). This preserves the invariant - * that a collection always contains the specified element after - * this call returns. - * - * @param element the value whose presence within me is to be ensured - * @return true iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException may be thrown if some aspect of the - * specified element prevents it from being added to me - */ - boolean add(int element); - - /** - * Inserts the specified element at the specified position - * (optional operation). Shifts the element currently - * at that position (if any) and any subsequent elements to the - * right, increasing their indices. - * - * @param index the index at which to insert the element - * @param element the value to insert - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException if some aspect of the specified element - * prevents it from being added to me - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - void add(int index, int element); - - /** - * Inserts all of the elements in the specified collection into me, - * at the specified position (optional operation). Shifts the - * element currently at that position (if any) and any subsequent - * elements to the right, increasing their indices. The new elements - * will appear in the order that they are returned by the given - * collection's {@link IntCollection#iterator iterator}. - * - * @param index the index at which to insert the first element from - * the specified collection - * @param collection the {@link IntCollection IntCollection} of elements to add - * @return true iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - boolean addAll(int index, IntCollection collection); - - /** - * Returns true iff that is an IntList - * that contains the same elements in the same order as me. - * In other words, returns true iff that is - * an IntList that has the same {@link #size size} as me, - * and for which the elements returned by its - * {@link IntList#iterator iterator} are equal (==) to - * the corresponding elements within me. - * (This contract ensures that this method works properly across - * different implementations of the IntList interface.) - * - * @param that the object to compare to me - * @return true iff that is an IntList - * that contains the same elements in the same order as me - */ - boolean equals(Object that); - - /** - * Returns the value of the element at the specified position - * within me. - * - * @param index the index of the element to return - * @return the value of the element at the specified position - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - int get(int index); - - /** - * Returns my hash code. - *

- * The hash code of an IntList is defined to be the - * result of the following calculation: - *

 int hash = 1;
-     * for(IntIterator iter = iterator(); iter.hasNext(); ) {
-     *   hash = 31*hash + iter.next();
-     * }
- *

- * This contract ensures that this method is consistent with - * {@link #equals equals} and with the - * {@link java.util.List#hashCode hashCode} - * method of a {@link java.util.List List} of {@link Integer}s. - * - * @return my hash code - */ - int hashCode(); - - /** - * Returns the index of the first occurrence - * of the specified element within me, - * or -1 if I do not contain - * the element. - * - * @param element the element to search for - * @return the smallest index of an element matching the specified value, - * or -1 if no such matching element can be found - */ - int indexOf(int element); - - /** - * Returns an {@link IntIterator iterator} over all my elements, - * in the appropriate sequence. - * @return an {@link IntIterator iterator} over all my elements. - */ - IntIterator iterator(); - - /** - * Returns the index of the last occurrence - * of the specified element within me, - * or -1 if I do not contain the element. - * - * @param element the element to search for - * @return the largest index of an element matching the specified value, - * or -1 if no such matching element can be found - */ - int lastIndexOf(int element); - - /** - * Returns a - * {@link IntListIterator bidirectional iterator} - * over all my elements, in the appropriate sequence. - */ - IntListIterator listIterator(); - - /** - * Returns a - * {@link IntListIterator bidirectional iterator} - * over all my elements, in the appropriate sequence, - * starting at the specified position. The - * specified index indicates the first - * element that would be returned by an initial - * call to the - * {@link IntListIterator#next next} - * method. An initial call to the - * {@link IntListIterator#previous previous} - * method would return the element with the specified - * index minus one. - * - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - IntListIterator listIterator(int index); - - /** - * Removes the element at the specified position in - * (optional operation). Any subsequent elements - * are shifted to the left, subtracting one from their - * indices. Returns the element that was removed. - * - * @param index the index of the element to remove - * @return the value of the element that was removed - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - int removeElementAt(int index); - - /** - * Replaces the element at the specified - * position in me with the specified element - * (optional operation). - * - * @param index the index of the element to change - * @param element the value to be stored at the specified position - * @return the value previously stored at the specified position - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - int set(int index, int element); - - /** - * Returns a view of the elements within me - * between the specified fromIndex, inclusive, and - * toIndex, exclusive. The returned IntList - * is backed by me, so that any changes in - * the returned list are reflected in me, and vice-versa. - * The returned list supports all of the optional operations - * that I support. - *

- * Note that when fromIndex == toIndex, - * the returned list is initially empty, and when - * fromIndex == 0 && toIndex == {@link #size() size()} - * the returned list is my "improper" sublist, containing all my elements. - *

- * The semantics of the returned list become undefined - * if I am structurally modified in any way other than - * via the returned list. - * - * @param fromIndex the smallest index (inclusive) in me that appears in - * the returned list - * @param toIndex the largest index (exclusive) in me that appears in the - * returned list - * @return a view of this list from fromIndex (inclusive) to - * toIndex (exclusive) - * - * @throws IndexOutOfBoundsException if either specified index is out of range - */ - IntList subList(int fromIndex, int toIndex); - -} diff --git a/src/java/org/apache/commons/collections/primitives/IntListIterator.java b/src/java/org/apache/commons/collections/primitives/IntListIterator.java deleted file mode 100644 index fc8042f27..000000000 --- a/src/java/org/apache/commons/collections/primitives/IntListIterator.java +++ /dev/null @@ -1,188 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/IntListIterator.java,v 1.8 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -/** - * A bi-directional iterator over int values. - * - * @see org.apache.commons.collections.primitives.adapters.IntListIteratorListIterator - * @see org.apache.commons.collections.primitives.adapters.ListIteratorIntListIterator - * - * @since Commons Collections 2.2 - * @version $Revision: 1.8 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public interface IntListIterator extends IntIterator { - /** - * Inserts the specified element into my underlying collection - * (optional operation). - * The element is inserted immediately before the next element - * that would have been returned by {@link #next}, if any, - * and immediately after the next element that would have been - * returned by {@link #previous}, if any. - *

- * The new element is inserted immediately before the implied - * cursor. A subsequent call to {@link #previous} will return - * the added element, a subsequent call to {@link #next} will - * be unaffected. This call increases by one the value that - * would be returned by a call to {@link #nextIndex} or - * {@link #previousIndex}. - * - * @param element the value to be inserted - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException if some aspect of the specified element - * prevents it from being added - */ - void add(int element); - - /** - * Returns true iff I have more elements - * when traversed in the forward direction. - * (In other words, returns true iff - * a call to {@link #next} will return an element - * rather than throwing an exception. - * - * @return true iff I have more elements when - * traversed in the forward direction - */ - boolean hasNext(); - - /** - * Returns true iff I have more elements - * when traversed in the reverse direction. - * (In other words, returns true iff - * a call to {@link #previous} will return an element - * rather than throwing an exception. - * - * @return true iff I have more elements when - * traversed in the reverse direction - */ - boolean hasPrevious(); - - /** - * Returns the next element in me when traversed in the - * forward direction. - * - * @return the next element in me - * @throws NoSuchElementException if there is no next element - */ - int next(); - - /** - * Returns the index of the element that would be returned - * by a subsequent call to {@link #next}, or the number - * of elements in my iteration if I have no next element. - * - * @return the index of the next element in me - */ - int nextIndex(); - - /** - * Returns the next element in me when traversed in the - * reverse direction. - * - * @return the previous element in me - * @throws NoSuchElementException if there is no previous element - */ - int previous(); - - /** - * Returns the index of the element that would be returned - * by a subsequent call to {@link #previous}, or - * -1 if I have no previous element. - * - * @return the index of the previous element in me - */ - int previousIndex(); - - /** - * Removes from my underlying collection the last - * element returned by {@link #next} or {@link #previous} - * (optional operation). - * - * @throws UnsupportedOperationException if this operation is not - * supported - * @throws IllegalStateException if neither {@link #next} nor - * {@link #previous} has yet been called, or - * {@link #remove} or {@link #add} has already been called since - * the last call to {@link #next} or {@link #previous}. - */ - void remove(); - - /** - * Replaces in my underlying collection the last - * element returned by {@link #next} or {@link #previous} - * with the specified value (optional operation). - * - * @param element the value to replace the last returned element with - * @throws UnsupportedOperationException if this operation is not - * supported - * @throws IllegalStateException if neither {@link #next} nor - * {@link #previous} has yet been called, or - * {@link #remove} or {@link #add} has already been called since - * the last call to {@link #next} or {@link #previous}. - * @throws IllegalArgumentException if some aspect of the specified element - * prevents it from being added - */ - void set(int element); -} diff --git a/src/java/org/apache/commons/collections/primitives/LongCollection.java b/src/java/org/apache/commons/collections/primitives/LongCollection.java deleted file mode 100644 index 823450ef2..000000000 --- a/src/java/org/apache/commons/collections/primitives/LongCollection.java +++ /dev/null @@ -1,248 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/LongCollection.java,v 1.3 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -/** - * A collection of long values. - * - * @see org.apache.commons.collections.primitives.adapters.LongCollectionCollection - * @see org.apache.commons.collections.primitives.adapters.CollectionLongCollection - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public interface LongCollection { - /** - * Ensures that I contain the specified element - * (optional operation). Returns true - * iff I changed as a result of this call. - *

- * If a collection refuses to add the specified - * element for any reason other than that it already contains - * the element, it must throw an exception (rather than - * simply returning false). This preserves the invariant - * that a collection always contains the specified element after - * this call returns. - * - * @param element the value whose presence within me is to be ensured - * @return true iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException may be thrown if some aspect of the - * specified element prevents it from being added to me - */ - boolean add(long element); - - /** - * {@link #add Adds} all of the elements in the - * specified collection to me (optional operation). - * - * @param c the collection of elements whose presence within me is to - * be ensured - * @return true iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException may be thrown if some aspect of some - * specified element prevents it from being added to me - */ - boolean addAll(LongCollection c); - - /** - * Removes all my elements (optional operation). - * I will be {@link #isEmpty empty} after this - * method successfully returns. - * - * @throws UnsupportedOperationException when this operation is not - * supported - */ - void clear(); - - /** - * Returns true iff I contain - * the specified element. - * - * @param element the value whose presence within me is to be tested - * @return true iff I contain the specified element - */ - boolean contains(long element); - - /** - * Returns true iff I {@link #contains contain} - * all of the elements in the given collection. - * - * @param c the collection of elements whose presence within me is to - * be tested - * @return true iff I contain the all the specified elements - */ - boolean containsAll(LongCollection c); - - /** - * Returns true iff I contain no elements. - * @return true iff I contain no elements. - */ - boolean isEmpty(); - - /** - * Returns an {@link LongIterator iterator} over all my elements. - * This base interface places no constraints on the order - * in which the elements are returned by the returned iterator. - * @return an {@link LongIterator iterator} over all my elements. - */ - LongIterator iterator(); - - /** - * Removes all of my elements that are contained in the - * specified collection (optional operation). - * The behavior of this method is unspecified if - * the given collection is modified while this method - * is executing. Note that this includes the case - * in which the given collection is this collection, - * and it is not empty. - * - * @param c the collection of elements to remove - * @return true iff I contained the at least one of the - * specified elements, in other words, returns true - * iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - */ - boolean removeAll(LongCollection c); - - /** - * Removes a single occurrence of the specified element - * (optional operation). - * - * @param element the element to remove, if present - * @return true iff I contained the specified element, - * in other words, iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - */ - boolean removeElement(long element); - - /** - * Removes all of my elements that are not contained in the - * specified collection (optional operation). - * (In other words, retains only my elements that are - * contained in the specified collection.) - * The behavior of this method is unspecified if - * the given collection is modified while this method - * is executing. - * - * @param c the collection of elements to retain - * @return true iff I changed as a result - * of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - */ - boolean retainAll(LongCollection c); - - /** - * Returns the number of elements I contain. - * @return the number of elements I contain - */ - int size(); - - /** - * Returns an array containing all of my elements. - * The length of the returned array will be equal - * to my {@link #size size}. - *

- * The returned array will be independent of me, - * so that callers may modify that - * returned array without modifying this collection. - *

- * When I guarantee the order in which - * elements are returned by an {@link #iterator iterator}, - * the returned array will contain elements in the - * same order. - * - * @return an array containing all my elements - */ - long[] toArray(); - - /** - * Returns an array containing all of my elements, - * using the given array if it is large - * enough. When the length of the given array is - * larger than the number of elements I contain, - * values outside of my range will be unchanged. - *

- * The returned array will be independent of me, - * so that callers may modify that - * returned array without modifying this collection. - *

- * When I guarantee the order in which - * elements are returned by an {@link #iterator iterator}, - * the returned array will contain elements in the - * same order. - * - * @param a an array that may be used to contain the elements - * @return an array containing all my elements - */ - long[] toArray(long[] a); -} diff --git a/src/java/org/apache/commons/collections/primitives/LongIterator.java b/src/java/org/apache/commons/collections/primitives/LongIterator.java deleted file mode 100644 index ca754fd0d..000000000 --- a/src/java/org/apache/commons/collections/primitives/LongIterator.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/LongIterator.java,v 1.3 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -/** - * An iterator over long values. - * - * @see org.apache.commons.collections.primitives.adapters.LongIteratorIterator - * @see org.apache.commons.collections.primitives.adapters.IteratorLongIterator - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public interface LongIterator { - /** - * Returns true iff I have more elements. - * (In other words, returns true iff - * a subsequent call to {@link #next next} will return - * an element rather than throwing an exception.) - * - * @return true iff I have more elements - */ - boolean hasNext(); - - /** - * Returns the next element in me. - * - * @return the next element in me - * @throws NoSuchElementException if there is no next element - */ - long next(); - - /** - * Removes from my underlying collection the last - * element {@link #next returned} by me - * (optional operation). - * - * @throws UnsupportedOperationException if this operation is not supported - * @throws IllegalStateException if {@link #next} has not yet been - * called, or {@link #remove} has already been called since - * the last call to {@link #next}. - */ - void remove(); -} diff --git a/src/java/org/apache/commons/collections/primitives/LongList.java b/src/java/org/apache/commons/collections/primitives/LongList.java deleted file mode 100644 index 91125583a..000000000 --- a/src/java/org/apache/commons/collections/primitives/LongList.java +++ /dev/null @@ -1,293 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/LongList.java,v 1.3 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -/** - * An ordered collection of long values. - * - * @see org.apache.commons.collections.primitives.adapters.LongListList - * @see org.apache.commons.collections.primitives.adapters.ListLongList - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public interface LongList extends LongCollection { - /** - * Appends the specified element to the end of me - * (optional operation). Returns true - * iff I changed as a result of this call. - *

- * If a collection refuses to add the specified - * element for any reason other than that it already contains - * the element, it must throw an exception (rather than - * simply returning false). This preserves the invariant - * that a collection always contains the specified element after - * this call returns. - * - * @param element the value whose presence within me is to be ensured - * @return true iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException may be thrown if some aspect of the - * specified element prevents it from being added to me - */ - boolean add(long element); - - /** - * Inserts the specified element at the specified position - * (optional operation). Shifts the element currently - * at that position (if any) and any subsequent elements to the - * right, increasing their indices. - * - * @param index the index at which to insert the element - * @param element the value to insert - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException if some aspect of the specified element - * prevents it from being added to me - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - void add(int index, long element); - - /** - * Inserts all of the elements in the specified collection into me, - * at the specified position (optional operation). Shifts the - * element currently at that position (if any) and any subsequent - * elements to the right, increasing their indices. The new elements - * will appear in the order that they are returned by the given - * collection's {@link LongCollection#iterator iterator}. - * - * @param index the index at which to insert the first element from - * the specified collection - * @param collection the {@link LongCollection LongCollection} of elements to add - * @return true iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - boolean addAll(int index, LongCollection collection); - - /** - * Returns true iff that is an LongList - * that contains the same elements in the same order as me. - * In other words, returns true iff that is - * an LongList that has the same {@link #size size} as me, - * and for which the elements returned by its - * {@link LongList#iterator iterator} are equal (==) to - * the corresponding elements within me. - * (This contract ensures that this method works properly across - * different implementations of the LongList interface.) - * - * @param that the object to compare to me - * @return true iff that is an LongList - * that contains the same elements in the same order as me - */ - boolean equals(Object that); - - /** - * Returns the value of the element at the specified position - * within me. - * - * @param index the index of the element to return - * @return the value of the element at the specified position - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - long get(int index); - - /** - * Returns my hash code. - *

- * The hash code of an LongList is defined to be the - * result of the following calculation: - *

 int hash = 1;
-     * for(LongIterator iter = iterator(); iter.hasNext(); ) {
-     *   long value = iter.next();
-     *   hash = 31*hash + (int)(value ^ (value >>> 32));
-     * }
- *

- * This contract ensures that this method is consistent with - * {@link #equals equals} and with the - * {@link java.util.List#hashCode hashCode} - * method of a {@link java.util.List List} of {@link Long}s. - * - * @return my hash code - */ - int hashCode(); - - /** - * Returns the index of the first occurrence - * of the specified element within me, - * or -1 if I do not contain - * the element. - * - * @param element the element to search for - * @return the smallest index of an element matching the specified value, - * or -1 if no such matching element can be found - */ - int indexOf(long element); - - /** - * Returns an {@link LongIterator iterator} over all my elements, - * in the appropriate sequence. - * @return an {@link LongIterator iterator} over all my elements. - */ - LongIterator iterator(); - - /** - * Returns the index of the last occurrence - * of the specified element within me, - * or -1 if I do not contain the element. - * - * @param element the element to search for - * @return the largest index of an element matching the specified value, - * or -1 if no such matching element can be found - */ - int lastIndexOf(long element); - - /** - * Returns a - * {@link LongListIterator bidirectional iterator} - * over all my elements, in the appropriate sequence. - */ - LongListIterator listIterator(); - - /** - * Returns a - * {@link LongListIterator bidirectional iterator} - * over all my elements, in the appropriate sequence, - * starting at the specified position. The - * specified index indicates the first - * element that would be returned by an initial - * call to the - * {@link LongListIterator#next next} - * method. An initial call to the - * {@link LongListIterator#previous previous} - * method would return the element with the specified - * index minus one. - * - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - LongListIterator listIterator(int index); - - /** - * Removes the element at the specified position in - * (optional operation). Any subsequent elements - * are shifted to the left, subtracting one from their - * indices. Returns the element that was removed. - * - * @param index the index of the element to remove - * @return the value of the element that was removed - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - long removeElementAt(int index); - - /** - * Replaces the element at the specified - * position in me with the specified element - * (optional operation). - * - * @param index the index of the element to change - * @param element the value to be stored at the specified position - * @return the value previously stored at the specified position - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - long set(int index, long element); - - /** - * Returns a view of the elements within me - * between the specified fromIndex, inclusive, and - * toIndex, exclusive. The returned LongList - * is backed by me, so that any changes in - * the returned list are reflected in me, and vice-versa. - * The returned list supports all of the optional operations - * that I support. - *

- * Note that when fromIndex == toIndex, - * the returned list is initially empty, and when - * fromIndex == 0 && toIndex == {@link #size() size()} - * the returned list is my "improper" sublist, containing all my elements. - *

- * The semantics of the returned list become undefined - * if I am structurally modified in any way other than - * via the returned list. - * - * @param fromIndex the smallest index (inclusive) in me that appears in - * the returned list - * @param toIndex the largest index (exclusive) in me that appears in the - * returned list - * @return a view of this list from fromIndex (inclusive) to - * toIndex (exclusive) - * - * @throws IndexOutOfBoundsException if either specified index is out of range - */ - LongList subList(int fromIndex, int toIndex); - -} diff --git a/src/java/org/apache/commons/collections/primitives/LongListIterator.java b/src/java/org/apache/commons/collections/primitives/LongListIterator.java deleted file mode 100644 index 532492a5a..000000000 --- a/src/java/org/apache/commons/collections/primitives/LongListIterator.java +++ /dev/null @@ -1,188 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/LongListIterator.java,v 1.3 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -/** - * A bi-directional iterator over long values. - * - * @see org.apache.commons.collections.primitives.adapters.LongListIteratorListIterator - * @see org.apache.commons.collections.primitives.adapters.ListIteratorLongListIterator - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public interface LongListIterator extends LongIterator { - /** - * Inserts the specified element into my underlying collection - * (optional operation). - * The element is inserted immediately before the next element - * that would have been returned by {@link #next}, if any, - * and immediately after the next element that would have been - * returned by {@link #previous}, if any. - *

- * The new element is inserted immediately before the implied - * cursor. A subsequent call to {@link #previous} will return - * the added element, a subsequent call to {@link #next} will - * be unaffected. This call increases by one the value that - * would be returned by a call to {@link #nextIndex} or - * {@link #previousIndex}. - * - * @param element the value to be inserted - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException if some aspect of the specified element - * prevents it from being added - */ - void add(long element); - - /** - * Returns true iff I have more elements - * when traversed in the forward direction. - * (In other words, returns true iff - * a call to {@link #next} will return an element - * rather than throwing an exception. - * - * @return true iff I have more elements when - * traversed in the forward direction - */ - boolean hasNext(); - - /** - * Returns true iff I have more elements - * when traversed in the reverse direction. - * (In other words, returns true iff - * a call to {@link #previous} will return an element - * rather than throwing an exception. - * - * @return true iff I have more elements when - * traversed in the reverse direction - */ - boolean hasPrevious(); - - /** - * Returns the next element in me when traversed in the - * forward direction. - * - * @return the next element in me - * @throws NoSuchElementException if there is no next element - */ - long next(); - - /** - * Returns the index of the element that would be returned - * by a subsequent call to {@link #next}, or the number - * of elements in my iteration if I have no next element. - * - * @return the index of the next element in me - */ - int nextIndex(); - - /** - * Returns the next element in me when traversed in the - * reverse direction. - * - * @return the previous element in me - * @throws NoSuchElementException if there is no previous element - */ - long previous(); - - /** - * Returns the index of the element that would be returned - * by a subsequent call to {@link #previous}, or - * -1 if I have no previous element. - * - * @return the index of the previous element in me - */ - int previousIndex(); - - /** - * Removes from my underlying collection the last - * element returned by {@link #next} or {@link #previous} - * (optional operation). - * - * @throws UnsupportedOperationException if this operation is not - * supported - * @throws IllegalStateException if neither {@link #next} nor - * {@link #previous} has yet been called, or - * {@link #remove} or {@link #add} has already been called since - * the last call to {@link #next} or {@link #previous}. - */ - void remove(); - - /** - * Replaces in my underlying collection the last - * element returned by {@link #next} or {@link #previous} - * with the specified value (optional operation). - * - * @param element the value to replace the last returned element with - * @throws UnsupportedOperationException if this operation is not - * supported - * @throws IllegalStateException if neither {@link #next} nor - * {@link #previous} has yet been called, or - * {@link #remove} or {@link #add} has already been called since - * the last call to {@link #next} or {@link #previous}. - * @throws IllegalArgumentException if some aspect of the specified element - * prevents it from being added - */ - void set(long element); -} diff --git a/src/java/org/apache/commons/collections/primitives/RandomAccessByteList.java b/src/java/org/apache/commons/collections/primitives/RandomAccessByteList.java deleted file mode 100644 index 2e769c0ff..000000000 --- a/src/java/org/apache/commons/collections/primitives/RandomAccessByteList.java +++ /dev/null @@ -1,431 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/RandomAccessByteList.java,v 1.3 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -import java.util.ConcurrentModificationException; -import java.util.NoSuchElementException; - -/** - * Abstract base class for {@link ByteList}s backed - * by random access structures like arrays. - *

- * Read-only subclasses must override {@link #get} - * and {@link #size}. Mutable subclasses - * should also override {@link #set}. Variably-sized - * subclasses should also override {@link #add} - * and {@link #removeElementAt}. All other methods - * have at least some base implementation derived from - * these. Subclasses may choose to override these methods - * to provide a more efficient implementation. - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public abstract class RandomAccessByteList extends AbstractByteCollection implements ByteList { - - // constructors - //------------------------------------------------------------------------- - - /** Constructs an empty list. */ - protected RandomAccessByteList() { - } - - // fully abstract methods - //------------------------------------------------------------------------- - - public abstract byte get(int index); - public abstract int size(); - - // unsupported in base - //------------------------------------------------------------------------- - - /** - * Unsupported in this implementation. - * @throws UnsupportedOperationException since this method is not supported - */ - public byte removeElementAt(int index) { - throw new UnsupportedOperationException(); - } - - /** - * Unsupported in this implementation. - * @throws UnsupportedOperationException since this method is not supported - */ - public byte set(int index, byte element) { - throw new UnsupportedOperationException(); - } - - /** - * Unsupported in this implementation. - * @throws UnsupportedOperationException since this method is not supported - */ - public void add(int index, byte element) { - throw new UnsupportedOperationException(); - } - - //------------------------------------------------------------------------- - - // javadocs here are inherited - - public boolean add(byte element) { - add(size(),element); - return true; - } - - public boolean addAll(int index, ByteCollection collection) { - boolean modified = false; - for(ByteIterator iter = collection.iterator(); iter.hasNext(); ) { - add(index++,iter.next()); - modified = true; - } - return modified; - } - - public int indexOf(byte element) { - int i = 0; - for(ByteIterator iter = iterator(); iter.hasNext(); ) { - if(iter.next() == element) { - return i; - } else { - i++; - } - } - return -1; - } - - public int lastIndexOf(byte element) { - for(ByteListIterator iter = listIterator(size()); iter.hasPrevious(); ) { - if(iter.previous() == element) { - return iter.nextIndex(); - } - } - return -1; - } - - public ByteIterator iterator() { - return listIterator(); - } - - public ByteListIterator listIterator() { - return listIterator(0); - } - - public ByteListIterator listIterator(int index) { - return new RandomAccessByteListIterator(this,index); - } - - public ByteList subList(int fromIndex, int toIndex) { - return new RandomAccessByteSubList(this,fromIndex,toIndex); - } - - public boolean equals(Object that) { - if(this == that) { - return true; - } else if(that instanceof ByteList) { - ByteList thatList = (ByteList)that; - if(size() != thatList.size()) { - return false; - } - for(ByteIterator thatIter = thatList.iterator(), thisIter = iterator(); thisIter.hasNext();) { - if(thisIter.next() != thatIter.next()) { - return false; - } - } - return true; - } else { - return false; - } - } - - public int hashCode() { - int hash = 1; - for(ByteIterator iter = iterator(); iter.hasNext(); ) { - hash = 31*hash + ((int)(iter.next())); - } - return hash; - } - - public String toString() { - StringBuffer buf = new StringBuffer(); - buf.append("["); - for(ByteIterator iter = iterator(); iter.hasNext();) { - buf.append(iter.next()); - if(iter.hasNext()) { - buf.append(", "); - } - } - buf.append("]"); - return buf.toString(); - } - - // protected utilities - //------------------------------------------------------------------------- - - /** Get my count of structural modifications. */ - protected int getModCount() { - return _modCount; - } - - /** Increment my count of structural modifications. */ - protected void incrModCount() { - _modCount++; - } - - // attributes - //------------------------------------------------------------------------- - - private int _modCount = 0; - - // inner classes - //------------------------------------------------------------------------- - - private static class ComodChecker { - ComodChecker(RandomAccessByteList source) { - _source = source; - resyncModCount(); - } - - protected RandomAccessByteList getList() { - return _source; - } - - protected void assertNotComodified() throws ConcurrentModificationException { - if(_expectedModCount != getList().getModCount()) { - throw new ConcurrentModificationException(); - } - } - - protected void resyncModCount() { - _expectedModCount = getList().getModCount(); - } - - private RandomAccessByteList _source = null; - private int _expectedModCount = -1; - } - - protected static class RandomAccessByteListIterator extends ComodChecker implements ByteListIterator { - RandomAccessByteListIterator(RandomAccessByteList list, int index) { - super(list); - if(index < 0 || index > getList().size()) { - throw new IndexOutOfBoundsException("Index " + index + " not in [0," + getList().size() + ")"); - } else { - _nextIndex = index; - resyncModCount(); - } - } - - public boolean hasNext() { - assertNotComodified(); - return _nextIndex < getList().size(); - } - - public boolean hasPrevious() { - assertNotComodified(); - return _nextIndex > 0; - } - - public int nextIndex() { - assertNotComodified(); - return _nextIndex; - } - - public int previousIndex() { - assertNotComodified(); - return _nextIndex - 1; - } - - public byte next() { - assertNotComodified(); - if(!hasNext()) { - throw new NoSuchElementException(); - } else { - byte val = getList().get(_nextIndex); - _lastReturnedIndex = _nextIndex; - _nextIndex++; - return val; - } - } - - public byte previous() { - assertNotComodified(); - if(!hasPrevious()) { - throw new NoSuchElementException(); - } else { - byte val = getList().get(_nextIndex-1); - _lastReturnedIndex = _nextIndex-1; - _nextIndex--; - return val; - } - } - - public void add(byte value) { - assertNotComodified(); - getList().add(_nextIndex,value); - _nextIndex++; - _lastReturnedIndex = -1; - resyncModCount(); - } - - public void remove() { - assertNotComodified(); - if(-1 == _lastReturnedIndex) { - throw new IllegalStateException(); - } else { - getList().removeElementAt(_lastReturnedIndex); - _lastReturnedIndex = -1; - _nextIndex--; - resyncModCount(); - } - } - - public void set(byte value) { - assertNotComodified(); - if(-1 == _lastReturnedIndex) { - throw new IllegalStateException(); - } else { - getList().set(_lastReturnedIndex,value); - resyncModCount(); - } - } - - private int _nextIndex = 0; - private int _lastReturnedIndex = -1; - } - - protected static class RandomAccessByteSubList extends RandomAccessByteList implements ByteList { - RandomAccessByteSubList(RandomAccessByteList list, int fromIndex, int toIndex) { - if(fromIndex < 0 || toIndex > list.size()) { - throw new IndexOutOfBoundsException(); - } else if(fromIndex > toIndex) { - throw new IllegalArgumentException(); - } else { - _list = list; - _offset = fromIndex; - _limit = toIndex - fromIndex; - _comod = new ComodChecker(list); - _comod.resyncModCount(); - } - } - - public byte get(int index) { - checkRange(index); - _comod.assertNotComodified(); - return _list.get(toUnderlyingIndex(index)); - } - - public byte removeElementAt(int index) { - checkRange(index); - _comod.assertNotComodified(); - byte val = _list.removeElementAt(toUnderlyingIndex(index)); - _limit--; - _comod.resyncModCount(); - incrModCount(); - return val; - } - - public byte set(int index, byte element) { - checkRange(index); - _comod.assertNotComodified(); - byte val = _list.set(toUnderlyingIndex(index),element); - incrModCount(); - _comod.resyncModCount(); - return val; - } - - public void add(int index, byte element) { - checkRangeIncludingEndpoint(index); - _comod.assertNotComodified(); - _list.add(toUnderlyingIndex(index),element); - _limit++; - _comod.resyncModCount(); - incrModCount(); - } - - public int size() { - _comod.assertNotComodified(); - return _limit; - } - - private void checkRange(int index) { - if(index < 0 || index >= size()) { - throw new IndexOutOfBoundsException("index " + index + " not in [0," + size() + ")"); - } - } - - private void checkRangeIncludingEndpoint(int index) { - if(index < 0 || index > size()) { - throw new IndexOutOfBoundsException("index " + index + " not in [0," + size() + "]"); - } - } - - private int toUnderlyingIndex(int index) { - return (index + _offset); - } - - private int _offset = 0; - private int _limit = 0; - private RandomAccessByteList _list = null; - private ComodChecker _comod = null; - - } -} - diff --git a/src/java/org/apache/commons/collections/primitives/RandomAccessCharList.java b/src/java/org/apache/commons/collections/primitives/RandomAccessCharList.java deleted file mode 100644 index 966b4f209..000000000 --- a/src/java/org/apache/commons/collections/primitives/RandomAccessCharList.java +++ /dev/null @@ -1,423 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/RandomAccessCharList.java,v 1.4 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -import java.util.ConcurrentModificationException; -import java.util.NoSuchElementException; - -/** - * Abstract base class for {@link CharList}s backed - * by random access structures like arrays. - *

- * Read-only subclasses must override {@link #get} - * and {@link #size}. Mutable subclasses - * should also override {@link #set}. Variably-sized - * subclasses should also override {@link #add} - * and {@link #removeElementAt}. All other methods - * have at least some base implementation derived from - * these. Subclasses may choose to override these methods - * to provide a more efficient implementation. - * - * @since Commons Collections 2.2 - * @version $Revision: 1.4 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public abstract class RandomAccessCharList extends AbstractCharCollection implements CharList { - - // constructors - //------------------------------------------------------------------------- - - /** Constructs an empty list. */ - protected RandomAccessCharList() { - } - - // fully abstract methods - //------------------------------------------------------------------------- - - public abstract char get(int index); - public abstract int size(); - - // unsupported in base - //------------------------------------------------------------------------- - - /** - * Unsupported in this implementation. - * @throws UnsupportedOperationException since this method is not supported - */ - public char removeElementAt(int index) { - throw new UnsupportedOperationException(); - } - - /** - * Unsupported in this implementation. - * @throws UnsupportedOperationException since this method is not supported - */ - public char set(int index, char element) { - throw new UnsupportedOperationException(); - } - - /** - * Unsupported in this implementation. - * @throws UnsupportedOperationException since this method is not supported - */ - public void add(int index, char element) { - throw new UnsupportedOperationException(); - } - - //------------------------------------------------------------------------- - - // javadocs here are inherited - - public boolean add(char element) { - add(size(),element); - return true; - } - - public boolean addAll(int index, CharCollection collection) { - boolean modified = false; - for(CharIterator iter = collection.iterator(); iter.hasNext(); ) { - add(index++,iter.next()); - modified = true; - } - return modified; - } - - public int indexOf(char element) { - int i = 0; - for(CharIterator iter = iterator(); iter.hasNext(); ) { - if(iter.next() == element) { - return i; - } else { - i++; - } - } - return -1; - } - - public int lastIndexOf(char element) { - for(CharListIterator iter = listIterator(size()); iter.hasPrevious(); ) { - if(iter.previous() == element) { - return iter.nextIndex(); - } - } - return -1; - } - - public CharIterator iterator() { - return listIterator(); - } - - public CharListIterator listIterator() { - return listIterator(0); - } - - public CharListIterator listIterator(int index) { - return new RandomAccessCharListIterator(this,index); - } - - public CharList subList(int fromIndex, int toIndex) { - return new RandomAccessCharSubList(this,fromIndex,toIndex); - } - - public boolean equals(Object that) { - if(this == that) { - return true; - } else if(that instanceof CharList) { - CharList thatList = (CharList)that; - if(size() != thatList.size()) { - return false; - } - for(CharIterator thatIter = thatList.iterator(), thisIter = iterator(); thisIter.hasNext();) { - if(thisIter.next() != thatIter.next()) { - return false; - } - } - return true; - } else { - return false; - } - } - - public int hashCode() { - int hash = 1; - for(CharIterator iter = iterator(); iter.hasNext(); ) { - hash = 31*hash + ((int)(iter.next())); - } - return hash; - } - - public String toString() { - // could cache these like StringBuffer does - return new String(toArray()); - } - - // protected utilities - //------------------------------------------------------------------------- - - /** Get my count of structural modifications. */ - protected int getModCount() { - return _modCount; - } - - /** Increment my count of structural modifications. */ - protected void incrModCount() { - _modCount++; - } - - // attributes - //------------------------------------------------------------------------- - - private int _modCount = 0; - - // inner classes - //------------------------------------------------------------------------- - - private static class ComodChecker { - ComodChecker(RandomAccessCharList source) { - _source = source; - resyncModCount(); - } - - protected RandomAccessCharList getList() { - return _source; - } - - protected void assertNotComodified() throws ConcurrentModificationException { - if(_expectedModCount != getList().getModCount()) { - throw new ConcurrentModificationException(); - } - } - - protected void resyncModCount() { - _expectedModCount = getList().getModCount(); - } - - private RandomAccessCharList _source = null; - private int _expectedModCount = -1; - } - - protected static class RandomAccessCharListIterator extends ComodChecker implements CharListIterator { - RandomAccessCharListIterator(RandomAccessCharList list, int index) { - super(list); - if(index < 0 || index > getList().size()) { - throw new IndexOutOfBoundsException("Index " + index + " not in [0," + getList().size() + ")"); - } else { - _nextIndex = index; - resyncModCount(); - } - } - - public boolean hasNext() { - assertNotComodified(); - return _nextIndex < getList().size(); - } - - public boolean hasPrevious() { - assertNotComodified(); - return _nextIndex > 0; - } - - public int nextIndex() { - assertNotComodified(); - return _nextIndex; - } - - public int previousIndex() { - assertNotComodified(); - return _nextIndex - 1; - } - - public char next() { - assertNotComodified(); - if(!hasNext()) { - throw new NoSuchElementException(); - } else { - char val = getList().get(_nextIndex); - _lastReturnedIndex = _nextIndex; - _nextIndex++; - return val; - } - } - - public char previous() { - assertNotComodified(); - if(!hasPrevious()) { - throw new NoSuchElementException(); - } else { - char val = getList().get(_nextIndex-1); - _lastReturnedIndex = _nextIndex-1; - _nextIndex--; - return val; - } - } - - public void add(char value) { - assertNotComodified(); - getList().add(_nextIndex,value); - _nextIndex++; - _lastReturnedIndex = -1; - resyncModCount(); - } - - public void remove() { - assertNotComodified(); - if(-1 == _lastReturnedIndex) { - throw new IllegalStateException(); - } else { - getList().removeElementAt(_lastReturnedIndex); - _lastReturnedIndex = -1; - _nextIndex--; - resyncModCount(); - } - } - - public void set(char value) { - assertNotComodified(); - if(-1 == _lastReturnedIndex) { - throw new IllegalStateException(); - } else { - getList().set(_lastReturnedIndex,value); - resyncModCount(); - } - } - - private int _nextIndex = 0; - private int _lastReturnedIndex = -1; - } - - protected static class RandomAccessCharSubList extends RandomAccessCharList implements CharList { - RandomAccessCharSubList(RandomAccessCharList list, int fromIndex, int toIndex) { - if(fromIndex < 0 || toIndex > list.size()) { - throw new IndexOutOfBoundsException(); - } else if(fromIndex > toIndex) { - throw new IllegalArgumentException(); - } else { - _list = list; - _offset = fromIndex; - _limit = toIndex - fromIndex; - _comod = new ComodChecker(list); - _comod.resyncModCount(); - } - } - - public char get(int index) { - checkRange(index); - _comod.assertNotComodified(); - return _list.get(toUnderlyingIndex(index)); - } - - public char removeElementAt(int index) { - checkRange(index); - _comod.assertNotComodified(); - char val = _list.removeElementAt(toUnderlyingIndex(index)); - _limit--; - _comod.resyncModCount(); - incrModCount(); - return val; - } - - public char set(int index, char element) { - checkRange(index); - _comod.assertNotComodified(); - char val = _list.set(toUnderlyingIndex(index),element); - incrModCount(); - _comod.resyncModCount(); - return val; - } - - public void add(int index, char element) { - checkRangeIncludingEndpoint(index); - _comod.assertNotComodified(); - _list.add(toUnderlyingIndex(index),element); - _limit++; - _comod.resyncModCount(); - incrModCount(); - } - - public int size() { - _comod.assertNotComodified(); - return _limit; - } - - private void checkRange(int index) { - if(index < 0 || index >= size()) { - throw new IndexOutOfBoundsException("index " + index + " not in [0," + size() + ")"); - } - } - - private void checkRangeIncludingEndpoint(int index) { - if(index < 0 || index > size()) { - throw new IndexOutOfBoundsException("index " + index + " not in [0," + size() + "]"); - } - } - - private int toUnderlyingIndex(int index) { - return (index + _offset); - } - - private int _offset = 0; - private int _limit = 0; - private RandomAccessCharList _list = null; - private ComodChecker _comod = null; - - } -} - diff --git a/src/java/org/apache/commons/collections/primitives/RandomAccessDoubleList.java b/src/java/org/apache/commons/collections/primitives/RandomAccessDoubleList.java deleted file mode 100644 index 5b5b7df6c..000000000 --- a/src/java/org/apache/commons/collections/primitives/RandomAccessDoubleList.java +++ /dev/null @@ -1,432 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/RandomAccessDoubleList.java,v 1.3 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -import java.util.ConcurrentModificationException; -import java.util.NoSuchElementException; - -/** - * Abstract base class for {@link DoubleList}s backed - * by random access structures like arrays. - *

- * Read-only subclasses must override {@link #get} - * and {@link #size}. Mutable subclasses - * should also override {@link #set}. Variably-sized - * subclasses should also override {@link #add} - * and {@link #removeElementAt}. All other methods - * have at least some base implementation derived from - * these. Subclasses may choose to override these methods - * to provide a more efficient implementation. - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public abstract class RandomAccessDoubleList extends AbstractDoubleCollection implements DoubleList { - - // constructors - //------------------------------------------------------------------------- - - /** Constructs an empty list. */ - protected RandomAccessDoubleList() { - } - - // fully abstract methods - //------------------------------------------------------------------------- - - public abstract double get(int index); - public abstract int size(); - - // unsupported in base - //------------------------------------------------------------------------- - - /** - * Unsupported in this implementation. - * @throws UnsupportedOperationException since this method is not supported - */ - public double removeElementAt(int index) { - throw new UnsupportedOperationException(); - } - - /** - * Unsupported in this implementation. - * @throws UnsupportedOperationException since this method is not supported - */ - public double set(int index, double element) { - throw new UnsupportedOperationException(); - } - - /** - * Unsupported in this implementation. - * @throws UnsupportedOperationException since this method is not supported - */ - public void add(int index, double element) { - throw new UnsupportedOperationException(); - } - - //------------------------------------------------------------------------- - - // javadocs here are inherited - - public boolean add(double element) { - add(size(),element); - return true; - } - - public boolean addAll(int index, DoubleCollection collection) { - boolean modified = false; - for(DoubleIterator iter = collection.iterator(); iter.hasNext(); ) { - add(index++,iter.next()); - modified = true; - } - return modified; - } - - public int indexOf(double element) { - int i = 0; - for(DoubleIterator iter = iterator(); iter.hasNext(); ) { - if(iter.next() == element) { - return i; - } else { - i++; - } - } - return -1; - } - - public int lastIndexOf(double element) { - for(DoubleListIterator iter = listIterator(size()); iter.hasPrevious(); ) { - if(iter.previous() == element) { - return iter.nextIndex(); - } - } - return -1; - } - - public DoubleIterator iterator() { - return listIterator(); - } - - public DoubleListIterator listIterator() { - return listIterator(0); - } - - public DoubleListIterator listIterator(int index) { - return new RandomAccessDoubleListIterator(this,index); - } - - public DoubleList subList(int fromIndex, int toIndex) { - return new RandomAccessDoubleSubList(this,fromIndex,toIndex); - } - - public boolean equals(Object that) { - if(this == that) { - return true; - } else if(that instanceof DoubleList) { - DoubleList thatList = (DoubleList)that; - if(size() != thatList.size()) { - return false; - } - for(DoubleIterator thatIter = thatList.iterator(), thisIter = iterator(); thisIter.hasNext();) { - if(thisIter.next() != thatIter.next()) { - return false; - } - } - return true; - } else { - return false; - } - } - - public int hashCode() { - int hash = 1; - for(DoubleIterator iter = iterator(); iter.hasNext(); ) { - long bits = Double.doubleToLongBits(iter.next()); - hash = 31*hash + ((int)(bits ^ (bits >>> 32))); - } - return hash; - } - - public String toString() { - StringBuffer buf = new StringBuffer(); - buf.append("["); - for(DoubleIterator iter = iterator(); iter.hasNext();) { - buf.append(iter.next()); - if(iter.hasNext()) { - buf.append(", "); - } - } - buf.append("]"); - return buf.toString(); - } - - // protected utilities - //------------------------------------------------------------------------- - - /** Get my count of structural modifications. */ - protected int getModCount() { - return _modCount; - } - - /** Increment my count of structural modifications. */ - protected void incrModCount() { - _modCount++; - } - - // attributes - //------------------------------------------------------------------------- - - private int _modCount = 0; - - // inner classes - //------------------------------------------------------------------------- - - private static class ComodChecker { - ComodChecker(RandomAccessDoubleList source) { - _source = source; - resyncModCount(); - } - - protected RandomAccessDoubleList getList() { - return _source; - } - - protected void assertNotComodified() throws ConcurrentModificationException { - if(_expectedModCount != getList().getModCount()) { - throw new ConcurrentModificationException(); - } - } - - protected void resyncModCount() { - _expectedModCount = getList().getModCount(); - } - - private RandomAccessDoubleList _source = null; - private int _expectedModCount = -1; - } - - protected static class RandomAccessDoubleListIterator extends ComodChecker implements DoubleListIterator { - RandomAccessDoubleListIterator(RandomAccessDoubleList list, int index) { - super(list); - if(index < 0 || index > getList().size()) { - throw new IndexOutOfBoundsException("Index " + index + " not in [0," + getList().size() + ")"); - } else { - _nextIndex = index; - resyncModCount(); - } - } - - public boolean hasNext() { - assertNotComodified(); - return _nextIndex < getList().size(); - } - - public boolean hasPrevious() { - assertNotComodified(); - return _nextIndex > 0; - } - - public int nextIndex() { - assertNotComodified(); - return _nextIndex; - } - - public int previousIndex() { - assertNotComodified(); - return _nextIndex - 1; - } - - public double next() { - assertNotComodified(); - if(!hasNext()) { - throw new NoSuchElementException(); - } else { - double val = getList().get(_nextIndex); - _lastReturnedIndex = _nextIndex; - _nextIndex++; - return val; - } - } - - public double previous() { - assertNotComodified(); - if(!hasPrevious()) { - throw new NoSuchElementException(); - } else { - double val = getList().get(_nextIndex-1); - _lastReturnedIndex = _nextIndex-1; - _nextIndex--; - return val; - } - } - - public void add(double value) { - assertNotComodified(); - getList().add(_nextIndex,value); - _nextIndex++; - _lastReturnedIndex = -1; - resyncModCount(); - } - - public void remove() { - assertNotComodified(); - if(-1 == _lastReturnedIndex) { - throw new IllegalStateException(); - } else { - getList().removeElementAt(_lastReturnedIndex); - _lastReturnedIndex = -1; - _nextIndex--; - resyncModCount(); - } - } - - public void set(double value) { - assertNotComodified(); - if(-1 == _lastReturnedIndex) { - throw new IllegalStateException(); - } else { - getList().set(_lastReturnedIndex,value); - resyncModCount(); - } - } - - private int _nextIndex = 0; - private int _lastReturnedIndex = -1; - } - - protected static class RandomAccessDoubleSubList extends RandomAccessDoubleList implements DoubleList { - RandomAccessDoubleSubList(RandomAccessDoubleList list, int fromIndex, int toIndex) { - if(fromIndex < 0 || toIndex > list.size()) { - throw new IndexOutOfBoundsException(); - } else if(fromIndex > toIndex) { - throw new IllegalArgumentException(); - } else { - _list = list; - _offset = fromIndex; - _limit = toIndex - fromIndex; - _comod = new ComodChecker(list); - _comod.resyncModCount(); - } - } - - public double get(int index) { - checkRange(index); - _comod.assertNotComodified(); - return _list.get(toUnderlyingIndex(index)); - } - - public double removeElementAt(int index) { - checkRange(index); - _comod.assertNotComodified(); - double val = _list.removeElementAt(toUnderlyingIndex(index)); - _limit--; - _comod.resyncModCount(); - incrModCount(); - return val; - } - - public double set(int index, double element) { - checkRange(index); - _comod.assertNotComodified(); - double val = _list.set(toUnderlyingIndex(index),element); - incrModCount(); - _comod.resyncModCount(); - return val; - } - - public void add(int index, double element) { - checkRangeIncludingEndpoint(index); - _comod.assertNotComodified(); - _list.add(toUnderlyingIndex(index),element); - _limit++; - _comod.resyncModCount(); - incrModCount(); - } - - public int size() { - _comod.assertNotComodified(); - return _limit; - } - - private void checkRange(int index) { - if(index < 0 || index >= size()) { - throw new IndexOutOfBoundsException("index " + index + " not in [0," + size() + ")"); - } - } - - private void checkRangeIncludingEndpoint(int index) { - if(index < 0 || index > size()) { - throw new IndexOutOfBoundsException("index " + index + " not in [0," + size() + "]"); - } - } - - private int toUnderlyingIndex(int index) { - return (index + _offset); - } - - private int _offset = 0; - private int _limit = 0; - private RandomAccessDoubleList _list = null; - private ComodChecker _comod = null; - - } -} - diff --git a/src/java/org/apache/commons/collections/primitives/RandomAccessFloatList.java b/src/java/org/apache/commons/collections/primitives/RandomAccessFloatList.java deleted file mode 100644 index 096323e7a..000000000 --- a/src/java/org/apache/commons/collections/primitives/RandomAccessFloatList.java +++ /dev/null @@ -1,431 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/RandomAccessFloatList.java,v 1.3 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -import java.util.ConcurrentModificationException; -import java.util.NoSuchElementException; - -/** - * Abstract base class for {@link FloatList}s backed - * by random access structures like arrays. - *

- * Read-only subclasses must override {@link #get} - * and {@link #size}. Mutable subclasses - * should also override {@link #set}. Variably-sized - * subclasses should also override {@link #add} - * and {@link #removeElementAt}. All other methods - * have at least some base implementation derived from - * these. Subclasses may choose to override these methods - * to provide a more efficient implementation. - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public abstract class RandomAccessFloatList extends AbstractFloatCollection implements FloatList { - - // constructors - //------------------------------------------------------------------------- - - /** Constructs an empty list. */ - protected RandomAccessFloatList() { - } - - // fully abstract methods - //------------------------------------------------------------------------- - - public abstract float get(int index); - public abstract int size(); - - // unsupported in base - //------------------------------------------------------------------------- - - /** - * Unsupported in this implementation. - * @throws UnsupportedOperationException since this method is not supported - */ - public float removeElementAt(int index) { - throw new UnsupportedOperationException(); - } - - /** - * Unsupported in this implementation. - * @throws UnsupportedOperationException since this method is not supported - */ - public float set(int index, float element) { - throw new UnsupportedOperationException(); - } - - /** - * Unsupported in this implementation. - * @throws UnsupportedOperationException since this method is not supported - */ - public void add(int index, float element) { - throw new UnsupportedOperationException(); - } - - //------------------------------------------------------------------------- - - // javadocs here are inherited - - public boolean add(float element) { - add(size(),element); - return true; - } - - public boolean addAll(int index, FloatCollection collection) { - boolean modified = false; - for(FloatIterator iter = collection.iterator(); iter.hasNext(); ) { - add(index++,iter.next()); - modified = true; - } - return modified; - } - - public int indexOf(float element) { - int i = 0; - for(FloatIterator iter = iterator(); iter.hasNext(); ) { - if(iter.next() == element) { - return i; - } else { - i++; - } - } - return -1; - } - - public int lastIndexOf(float element) { - for(FloatListIterator iter = listIterator(size()); iter.hasPrevious(); ) { - if(iter.previous() == element) { - return iter.nextIndex(); - } - } - return -1; - } - - public FloatIterator iterator() { - return listIterator(); - } - - public FloatListIterator listIterator() { - return listIterator(0); - } - - public FloatListIterator listIterator(int index) { - return new RandomAccessFloatListIterator(this,index); - } - - public FloatList subList(int fromIndex, int toIndex) { - return new RandomAccessFloatSubList(this,fromIndex,toIndex); - } - - public boolean equals(Object that) { - if(this == that) { - return true; - } else if(that instanceof FloatList) { - FloatList thatList = (FloatList)that; - if(size() != thatList.size()) { - return false; - } - for(FloatIterator thatIter = thatList.iterator(), thisIter = iterator(); thisIter.hasNext();) { - if(thisIter.next() != thatIter.next()) { - return false; - } - } - return true; - } else { - return false; - } - } - - public int hashCode() { - int hash = 1; - for(FloatIterator iter = iterator(); iter.hasNext(); ) { - hash = 31*hash + Float.floatToIntBits(iter.next()); - } - return hash; - } - - public String toString() { - StringBuffer buf = new StringBuffer(); - buf.append("["); - for(FloatIterator iter = iterator(); iter.hasNext();) { - buf.append(iter.next()); - if(iter.hasNext()) { - buf.append(", "); - } - } - buf.append("]"); - return buf.toString(); - } - - // protected utilities - //------------------------------------------------------------------------- - - /** Get my count of structural modifications. */ - protected int getModCount() { - return _modCount; - } - - /** Increment my count of structural modifications. */ - protected void incrModCount() { - _modCount++; - } - - // attributes - //------------------------------------------------------------------------- - - private int _modCount = 0; - - // inner classes - //------------------------------------------------------------------------- - - private static class ComodChecker { - ComodChecker(RandomAccessFloatList source) { - _source = source; - resyncModCount(); - } - - protected RandomAccessFloatList getList() { - return _source; - } - - protected void assertNotComodified() throws ConcurrentModificationException { - if(_expectedModCount != getList().getModCount()) { - throw new ConcurrentModificationException(); - } - } - - protected void resyncModCount() { - _expectedModCount = getList().getModCount(); - } - - private RandomAccessFloatList _source = null; - private int _expectedModCount = -1; - } - - protected static class RandomAccessFloatListIterator extends ComodChecker implements FloatListIterator { - RandomAccessFloatListIterator(RandomAccessFloatList list, int index) { - super(list); - if(index < 0 || index > getList().size()) { - throw new IndexOutOfBoundsException("Index " + index + " not in [0," + getList().size() + ")"); - } else { - _nextIndex = index; - resyncModCount(); - } - } - - public boolean hasNext() { - assertNotComodified(); - return _nextIndex < getList().size(); - } - - public boolean hasPrevious() { - assertNotComodified(); - return _nextIndex > 0; - } - - public int nextIndex() { - assertNotComodified(); - return _nextIndex; - } - - public int previousIndex() { - assertNotComodified(); - return _nextIndex - 1; - } - - public float next() { - assertNotComodified(); - if(!hasNext()) { - throw new NoSuchElementException(); - } else { - float val = getList().get(_nextIndex); - _lastReturnedIndex = _nextIndex; - _nextIndex++; - return val; - } - } - - public float previous() { - assertNotComodified(); - if(!hasPrevious()) { - throw new NoSuchElementException(); - } else { - float val = getList().get(_nextIndex-1); - _lastReturnedIndex = _nextIndex-1; - _nextIndex--; - return val; - } - } - - public void add(float value) { - assertNotComodified(); - getList().add(_nextIndex,value); - _nextIndex++; - _lastReturnedIndex = -1; - resyncModCount(); - } - - public void remove() { - assertNotComodified(); - if(-1 == _lastReturnedIndex) { - throw new IllegalStateException(); - } else { - getList().removeElementAt(_lastReturnedIndex); - _lastReturnedIndex = -1; - _nextIndex--; - resyncModCount(); - } - } - - public void set(float value) { - assertNotComodified(); - if(-1 == _lastReturnedIndex) { - throw new IllegalStateException(); - } else { - getList().set(_lastReturnedIndex,value); - resyncModCount(); - } - } - - private int _nextIndex = 0; - private int _lastReturnedIndex = -1; - } - - protected static class RandomAccessFloatSubList extends RandomAccessFloatList implements FloatList { - RandomAccessFloatSubList(RandomAccessFloatList list, int fromIndex, int toIndex) { - if(fromIndex < 0 || toIndex > list.size()) { - throw new IndexOutOfBoundsException(); - } else if(fromIndex > toIndex) { - throw new IllegalArgumentException(); - } else { - _list = list; - _offset = fromIndex; - _limit = toIndex - fromIndex; - _comod = new ComodChecker(list); - _comod.resyncModCount(); - } - } - - public float get(int index) { - checkRange(index); - _comod.assertNotComodified(); - return _list.get(toUnderlyingIndex(index)); - } - - public float removeElementAt(int index) { - checkRange(index); - _comod.assertNotComodified(); - float val = _list.removeElementAt(toUnderlyingIndex(index)); - _limit--; - _comod.resyncModCount(); - incrModCount(); - return val; - } - - public float set(int index, float element) { - checkRange(index); - _comod.assertNotComodified(); - float val = _list.set(toUnderlyingIndex(index),element); - incrModCount(); - _comod.resyncModCount(); - return val; - } - - public void add(int index, float element) { - checkRangeIncludingEndpoint(index); - _comod.assertNotComodified(); - _list.add(toUnderlyingIndex(index),element); - _limit++; - _comod.resyncModCount(); - incrModCount(); - } - - public int size() { - _comod.assertNotComodified(); - return _limit; - } - - private void checkRange(int index) { - if(index < 0 || index >= size()) { - throw new IndexOutOfBoundsException("index " + index + " not in [0," + size() + ")"); - } - } - - private void checkRangeIncludingEndpoint(int index) { - if(index < 0 || index > size()) { - throw new IndexOutOfBoundsException("index " + index + " not in [0," + size() + "]"); - } - } - - private int toUnderlyingIndex(int index) { - return (index + _offset); - } - - private int _offset = 0; - private int _limit = 0; - private RandomAccessFloatList _list = null; - private ComodChecker _comod = null; - - } -} - diff --git a/src/java/org/apache/commons/collections/primitives/RandomAccessIntList.java b/src/java/org/apache/commons/collections/primitives/RandomAccessIntList.java deleted file mode 100644 index b56a823a8..000000000 --- a/src/java/org/apache/commons/collections/primitives/RandomAccessIntList.java +++ /dev/null @@ -1,431 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/RandomAccessIntList.java,v 1.3 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -import java.util.ConcurrentModificationException; -import java.util.NoSuchElementException; - -/** - * Abstract base class for {@link IntList}s backed - * by random access structures like arrays. - *

- * Read-only subclasses must override {@link #get} - * and {@link #size}. Mutable subclasses - * should also override {@link #set}. Variably-sized - * subclasses should also override {@link #add} - * and {@link #removeElementAt}. All other methods - * have at least some base implementation derived from - * these. Subclasses may choose to override these methods - * to provide a more efficient implementation. - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public abstract class RandomAccessIntList extends AbstractIntCollection implements IntList { - - // constructors - //------------------------------------------------------------------------- - - /** Constructs an empty list. */ - protected RandomAccessIntList() { - } - - // fully abstract methods - //------------------------------------------------------------------------- - - public abstract int get(int index); - public abstract int size(); - - // unsupported in base - //------------------------------------------------------------------------- - - /** - * Unsupported in this implementation. - * @throws UnsupportedOperationException since this method is not supported - */ - public int removeElementAt(int index) { - throw new UnsupportedOperationException(); - } - - /** - * Unsupported in this implementation. - * @throws UnsupportedOperationException since this method is not supported - */ - public int set(int index, int element) { - throw new UnsupportedOperationException(); - } - - /** - * Unsupported in this implementation. - * @throws UnsupportedOperationException since this method is not supported - */ - public void add(int index, int element) { - throw new UnsupportedOperationException(); - } - - //------------------------------------------------------------------------- - - // javadocs here are inherited - - public boolean add(int element) { - add(size(),element); - return true; - } - - public boolean addAll(int index, IntCollection collection) { - boolean modified = false; - for(IntIterator iter = collection.iterator(); iter.hasNext(); ) { - add(index++,iter.next()); - modified = true; - } - return modified; - } - - public int indexOf(int element) { - int i = 0; - for(IntIterator iter = iterator(); iter.hasNext(); ) { - if(iter.next() == element) { - return i; - } else { - i++; - } - } - return -1; - } - - public int lastIndexOf(int element) { - for(IntListIterator iter = listIterator(size()); iter.hasPrevious(); ) { - if(iter.previous() == element) { - return iter.nextIndex(); - } - } - return -1; - } - - public IntIterator iterator() { - return listIterator(); - } - - public IntListIterator listIterator() { - return listIterator(0); - } - - public IntListIterator listIterator(int index) { - return new RandomAccessIntListIterator(this,index); - } - - public IntList subList(int fromIndex, int toIndex) { - return new RandomAccessIntSubList(this,fromIndex,toIndex); - } - - public boolean equals(Object that) { - if(this == that) { - return true; - } else if(that instanceof IntList) { - IntList thatList = (IntList)that; - if(size() != thatList.size()) { - return false; - } - for(IntIterator thatIter = thatList.iterator(), thisIter = iterator(); thisIter.hasNext();) { - if(thisIter.next() != thatIter.next()) { - return false; - } - } - return true; - } else { - return false; - } - } - - public int hashCode() { - int hash = 1; - for(IntIterator iter = iterator(); iter.hasNext(); ) { - hash = 31*hash + iter.next(); - } - return hash; - } - - public String toString() { - StringBuffer buf = new StringBuffer(); - buf.append("["); - for(IntIterator iter = iterator(); iter.hasNext();) { - buf.append(iter.next()); - if(iter.hasNext()) { - buf.append(", "); - } - } - buf.append("]"); - return buf.toString(); - } - - // protected utilities - //------------------------------------------------------------------------- - - /** Get my count of structural modifications. */ - protected int getModCount() { - return _modCount; - } - - /** Increment my count of structural modifications. */ - protected void incrModCount() { - _modCount++; - } - - // attributes - //------------------------------------------------------------------------- - - private int _modCount = 0; - - // inner classes - //------------------------------------------------------------------------- - - private static class ComodChecker { - ComodChecker(RandomAccessIntList source) { - _source = source; - resyncModCount(); - } - - protected RandomAccessIntList getList() { - return _source; - } - - protected void assertNotComodified() throws ConcurrentModificationException { - if(_expectedModCount != getList().getModCount()) { - throw new ConcurrentModificationException(); - } - } - - protected void resyncModCount() { - _expectedModCount = getList().getModCount(); - } - - private RandomAccessIntList _source = null; - private int _expectedModCount = -1; - } - - protected static class RandomAccessIntListIterator extends ComodChecker implements IntListIterator { - RandomAccessIntListIterator(RandomAccessIntList list, int index) { - super(list); - if(index < 0 || index > getList().size()) { - throw new IndexOutOfBoundsException("Index " + index + " not in [0," + getList().size() + ")"); - } else { - _nextIndex = index; - resyncModCount(); - } - } - - public boolean hasNext() { - assertNotComodified(); - return _nextIndex < getList().size(); - } - - public boolean hasPrevious() { - assertNotComodified(); - return _nextIndex > 0; - } - - public int nextIndex() { - assertNotComodified(); - return _nextIndex; - } - - public int previousIndex() { - assertNotComodified(); - return _nextIndex - 1; - } - - public int next() { - assertNotComodified(); - if(!hasNext()) { - throw new NoSuchElementException(); - } else { - int val = getList().get(_nextIndex); - _lastReturnedIndex = _nextIndex; - _nextIndex++; - return val; - } - } - - public int previous() { - assertNotComodified(); - if(!hasPrevious()) { - throw new NoSuchElementException(); - } else { - int val = getList().get(_nextIndex-1); - _lastReturnedIndex = _nextIndex-1; - _nextIndex--; - return val; - } - } - - public void add(int value) { - assertNotComodified(); - getList().add(_nextIndex,value); - _nextIndex++; - _lastReturnedIndex = -1; - resyncModCount(); - } - - public void remove() { - assertNotComodified(); - if(-1 == _lastReturnedIndex) { - throw new IllegalStateException(); - } else { - getList().removeElementAt(_lastReturnedIndex); - _lastReturnedIndex = -1; - _nextIndex--; - resyncModCount(); - } - } - - public void set(int value) { - assertNotComodified(); - if(-1 == _lastReturnedIndex) { - throw new IllegalStateException(); - } else { - getList().set(_lastReturnedIndex,value); - resyncModCount(); - } - } - - private int _nextIndex = 0; - private int _lastReturnedIndex = -1; - } - - protected static class RandomAccessIntSubList extends RandomAccessIntList implements IntList { - RandomAccessIntSubList(RandomAccessIntList list, int fromIndex, int toIndex) { - if(fromIndex < 0 || toIndex > list.size()) { - throw new IndexOutOfBoundsException(); - } else if(fromIndex > toIndex) { - throw new IllegalArgumentException(); - } else { - _list = list; - _offset = fromIndex; - _limit = toIndex - fromIndex; - _comod = new ComodChecker(list); - _comod.resyncModCount(); - } - } - - public int get(int index) { - checkRange(index); - _comod.assertNotComodified(); - return _list.get(toUnderlyingIndex(index)); - } - - public int removeElementAt(int index) { - checkRange(index); - _comod.assertNotComodified(); - int val = _list.removeElementAt(toUnderlyingIndex(index)); - _limit--; - _comod.resyncModCount(); - incrModCount(); - return val; - } - - public int set(int index, int element) { - checkRange(index); - _comod.assertNotComodified(); - int val = _list.set(toUnderlyingIndex(index),element); - incrModCount(); - _comod.resyncModCount(); - return val; - } - - public void add(int index, int element) { - checkRangeIncludingEndpoint(index); - _comod.assertNotComodified(); - _list.add(toUnderlyingIndex(index),element); - _limit++; - _comod.resyncModCount(); - incrModCount(); - } - - public int size() { - _comod.assertNotComodified(); - return _limit; - } - - private void checkRange(int index) { - if(index < 0 || index >= size()) { - throw new IndexOutOfBoundsException("index " + index + " not in [0," + size() + ")"); - } - } - - private void checkRangeIncludingEndpoint(int index) { - if(index < 0 || index > size()) { - throw new IndexOutOfBoundsException("index " + index + " not in [0," + size() + "]"); - } - } - - private int toUnderlyingIndex(int index) { - return (index + _offset); - } - - private int _offset = 0; - private int _limit = 0; - private RandomAccessIntList _list = null; - private ComodChecker _comod = null; - - } -} - diff --git a/src/java/org/apache/commons/collections/primitives/RandomAccessLongList.java b/src/java/org/apache/commons/collections/primitives/RandomAccessLongList.java deleted file mode 100644 index 8d9c811da..000000000 --- a/src/java/org/apache/commons/collections/primitives/RandomAccessLongList.java +++ /dev/null @@ -1,432 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/RandomAccessLongList.java,v 1.3 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -import java.util.ConcurrentModificationException; -import java.util.NoSuchElementException; - -/** - * Abstract base class for {@link LongList}s backed - * by random access structures like arrays. - *

- * Read-only subclasses must override {@link #get} - * and {@link #size}. Mutable subclasses - * should also override {@link #set}. Variably-sized - * subclasses should also override {@link #add} - * and {@link #removeElementAt}. All other methods - * have at least some base implementation derived from - * these. Subclasses may choose to override these methods - * to provide a more efficient implementation. - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public abstract class RandomAccessLongList extends AbstractLongCollection implements LongList { - - // constructors - //------------------------------------------------------------------------- - - /** Constructs an empty list. */ - protected RandomAccessLongList() { - } - - // fully abstract methods - //------------------------------------------------------------------------- - - public abstract long get(int index); - public abstract int size(); - - // unsupported in base - //------------------------------------------------------------------------- - - /** - * Unsupported in this implementation. - * @throws UnsupportedOperationException since this method is not supported - */ - public long removeElementAt(int index) { - throw new UnsupportedOperationException(); - } - - /** - * Unsupported in this implementation. - * @throws UnsupportedOperationException since this method is not supported - */ - public long set(int index, long element) { - throw new UnsupportedOperationException(); - } - - /** - * Unsupported in this implementation. - * @throws UnsupportedOperationException since this method is not supported - */ - public void add(int index, long element) { - throw new UnsupportedOperationException(); - } - - //------------------------------------------------------------------------- - - // javadocs here are inherited - - public boolean add(long element) { - add(size(),element); - return true; - } - - public boolean addAll(int index, LongCollection collection) { - boolean modified = false; - for(LongIterator iter = collection.iterator(); iter.hasNext(); ) { - add(index++,iter.next()); - modified = true; - } - return modified; - } - - public int indexOf(long element) { - int i = 0; - for(LongIterator iter = iterator(); iter.hasNext(); ) { - if(iter.next() == element) { - return i; - } else { - i++; - } - } - return -1; - } - - public int lastIndexOf(long element) { - for(LongListIterator iter = listIterator(size()); iter.hasPrevious(); ) { - if(iter.previous() == element) { - return iter.nextIndex(); - } - } - return -1; - } - - public LongIterator iterator() { - return listIterator(); - } - - public LongListIterator listIterator() { - return listIterator(0); - } - - public LongListIterator listIterator(int index) { - return new RandomAccessLongListIterator(this,index); - } - - public LongList subList(int fromIndex, int toIndex) { - return new RandomAccessLongSubList(this,fromIndex,toIndex); - } - - public boolean equals(Object that) { - if(this == that) { - return true; - } else if(that instanceof LongList) { - LongList thatList = (LongList)that; - if(size() != thatList.size()) { - return false; - } - for(LongIterator thatIter = thatList.iterator(), thisIter = iterator(); thisIter.hasNext();) { - if(thisIter.next() != thatIter.next()) { - return false; - } - } - return true; - } else { - return false; - } - } - - public int hashCode() { - int hash = 1; - for(LongIterator iter = iterator(); iter.hasNext(); ) { - long val = iter.next(); - hash = 31*hash + ((int)(val ^ (val >>> 32))); - } - return hash; - } - - public String toString() { - StringBuffer buf = new StringBuffer(); - buf.append("["); - for(LongIterator iter = iterator(); iter.hasNext();) { - buf.append(iter.next()); - if(iter.hasNext()) { - buf.append(", "); - } - } - buf.append("]"); - return buf.toString(); - } - - // protected utilities - //------------------------------------------------------------------------- - - /** Get my count of structural modifications. */ - protected int getModCount() { - return _modCount; - } - - /** Increment my count of structural modifications. */ - protected void incrModCount() { - _modCount++; - } - - // attributes - //------------------------------------------------------------------------- - - private int _modCount = 0; - - // inner classes - //------------------------------------------------------------------------- - - private static class ComodChecker { - ComodChecker(RandomAccessLongList source) { - _source = source; - resyncModCount(); - } - - protected RandomAccessLongList getList() { - return _source; - } - - protected void assertNotComodified() throws ConcurrentModificationException { - if(_expectedModCount != getList().getModCount()) { - throw new ConcurrentModificationException(); - } - } - - protected void resyncModCount() { - _expectedModCount = getList().getModCount(); - } - - private RandomAccessLongList _source = null; - private int _expectedModCount = -1; - } - - protected static class RandomAccessLongListIterator extends ComodChecker implements LongListIterator { - RandomAccessLongListIterator(RandomAccessLongList list, int index) { - super(list); - if(index < 0 || index > getList().size()) { - throw new IndexOutOfBoundsException("Index " + index + " not in [0," + getList().size() + ")"); - } else { - _nextIndex = index; - resyncModCount(); - } - } - - public boolean hasNext() { - assertNotComodified(); - return _nextIndex < getList().size(); - } - - public boolean hasPrevious() { - assertNotComodified(); - return _nextIndex > 0; - } - - public int nextIndex() { - assertNotComodified(); - return _nextIndex; - } - - public int previousIndex() { - assertNotComodified(); - return _nextIndex - 1; - } - - public long next() { - assertNotComodified(); - if(!hasNext()) { - throw new NoSuchElementException(); - } else { - long val = getList().get(_nextIndex); - _lastReturnedIndex = _nextIndex; - _nextIndex++; - return val; - } - } - - public long previous() { - assertNotComodified(); - if(!hasPrevious()) { - throw new NoSuchElementException(); - } else { - long val = getList().get(_nextIndex-1); - _lastReturnedIndex = _nextIndex-1; - _nextIndex--; - return val; - } - } - - public void add(long value) { - assertNotComodified(); - getList().add(_nextIndex,value); - _nextIndex++; - _lastReturnedIndex = -1; - resyncModCount(); - } - - public void remove() { - assertNotComodified(); - if(-1 == _lastReturnedIndex) { - throw new IllegalStateException(); - } else { - getList().removeElementAt(_lastReturnedIndex); - _lastReturnedIndex = -1; - _nextIndex--; - resyncModCount(); - } - } - - public void set(long value) { - assertNotComodified(); - if(-1 == _lastReturnedIndex) { - throw new IllegalStateException(); - } else { - getList().set(_lastReturnedIndex,value); - resyncModCount(); - } - } - - private int _nextIndex = 0; - private int _lastReturnedIndex = -1; - } - - protected static class RandomAccessLongSubList extends RandomAccessLongList implements LongList { - RandomAccessLongSubList(RandomAccessLongList list, int fromIndex, int toIndex) { - if(fromIndex < 0 || toIndex > list.size()) { - throw new IndexOutOfBoundsException(); - } else if(fromIndex > toIndex) { - throw new IllegalArgumentException(); - } else { - _list = list; - _offset = fromIndex; - _limit = toIndex - fromIndex; - _comod = new ComodChecker(list); - _comod.resyncModCount(); - } - } - - public long get(int index) { - checkRange(index); - _comod.assertNotComodified(); - return _list.get(toUnderlyingIndex(index)); - } - - public long removeElementAt(int index) { - checkRange(index); - _comod.assertNotComodified(); - long val = _list.removeElementAt(toUnderlyingIndex(index)); - _limit--; - _comod.resyncModCount(); - incrModCount(); - return val; - } - - public long set(int index, long element) { - checkRange(index); - _comod.assertNotComodified(); - long val = _list.set(toUnderlyingIndex(index),element); - incrModCount(); - _comod.resyncModCount(); - return val; - } - - public void add(int index, long element) { - checkRangeIncludingEndpoint(index); - _comod.assertNotComodified(); - _list.add(toUnderlyingIndex(index),element); - _limit++; - _comod.resyncModCount(); - incrModCount(); - } - - public int size() { - _comod.assertNotComodified(); - return _limit; - } - - private void checkRange(int index) { - if(index < 0 || index >= size()) { - throw new IndexOutOfBoundsException("index " + index + " not in [0," + size() + ")"); - } - } - - private void checkRangeIncludingEndpoint(int index) { - if(index < 0 || index > size()) { - throw new IndexOutOfBoundsException("index " + index + " not in [0," + size() + "]"); - } - } - - private int toUnderlyingIndex(int index) { - return (index + _offset); - } - - private int _offset = 0; - private int _limit = 0; - private RandomAccessLongList _list = null; - private ComodChecker _comod = null; - - } -} - diff --git a/src/java/org/apache/commons/collections/primitives/RandomAccessShortList.java b/src/java/org/apache/commons/collections/primitives/RandomAccessShortList.java deleted file mode 100644 index e299c29d2..000000000 --- a/src/java/org/apache/commons/collections/primitives/RandomAccessShortList.java +++ /dev/null @@ -1,431 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/RandomAccessShortList.java,v 1.3 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -import java.util.ConcurrentModificationException; -import java.util.NoSuchElementException; - -/** - * Abstract base class for {@link ShortList}s backed - * by random access structures like arrays. - *

- * Read-only subclasses must override {@link #get} - * and {@link #size}. Mutable subclasses - * should also override {@link #set}. Variably-sized - * subclasses should also override {@link #add} - * and {@link #removeElementAt}. All other methods - * have at least some base implementation derived from - * these. Subclasses may choose to override these methods - * to provide a more efficient implementation. - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public abstract class RandomAccessShortList extends AbstractShortCollection implements ShortList { - - // constructors - //------------------------------------------------------------------------- - - /** Constructs an empty list. */ - protected RandomAccessShortList() { - } - - // fully abstract methods - //------------------------------------------------------------------------- - - public abstract short get(int index); - public abstract int size(); - - // unsupported in base - //------------------------------------------------------------------------- - - /** - * Unsupported in this implementation. - * @throws UnsupportedOperationException since this method is not supported - */ - public short removeElementAt(int index) { - throw new UnsupportedOperationException(); - } - - /** - * Unsupported in this implementation. - * @throws UnsupportedOperationException since this method is not supported - */ - public short set(int index, short element) { - throw new UnsupportedOperationException(); - } - - /** - * Unsupported in this implementation. - * @throws UnsupportedOperationException since this method is not supported - */ - public void add(int index, short element) { - throw new UnsupportedOperationException(); - } - - //------------------------------------------------------------------------- - - // javadocs here are inherited - - public boolean add(short element) { - add(size(),element); - return true; - } - - public boolean addAll(int index, ShortCollection collection) { - boolean modified = false; - for(ShortIterator iter = collection.iterator(); iter.hasNext(); ) { - add(index++,iter.next()); - modified = true; - } - return modified; - } - - public int indexOf(short element) { - int i = 0; - for(ShortIterator iter = iterator(); iter.hasNext(); ) { - if(iter.next() == element) { - return i; - } else { - i++; - } - } - return -1; - } - - public int lastIndexOf(short element) { - for(ShortListIterator iter = listIterator(size()); iter.hasPrevious(); ) { - if(iter.previous() == element) { - return iter.nextIndex(); - } - } - return -1; - } - - public ShortIterator iterator() { - return listIterator(); - } - - public ShortListIterator listIterator() { - return listIterator(0); - } - - public ShortListIterator listIterator(int index) { - return new RandomAccessShortListIterator(this,index); - } - - public ShortList subList(int fromIndex, int toIndex) { - return new RandomAccessShortSubList(this,fromIndex,toIndex); - } - - public boolean equals(Object that) { - if(this == that) { - return true; - } else if(that instanceof ShortList) { - ShortList thatList = (ShortList)that; - if(size() != thatList.size()) { - return false; - } - for(ShortIterator thatIter = thatList.iterator(), thisIter = iterator(); thisIter.hasNext();) { - if(thisIter.next() != thatIter.next()) { - return false; - } - } - return true; - } else { - return false; - } - } - - public int hashCode() { - int hash = 1; - for(ShortIterator iter = iterator(); iter.hasNext(); ) { - hash = 31*hash + iter.next(); - } - return hash; - } - - public String toString() { - StringBuffer buf = new StringBuffer(); - buf.append("["); - for(ShortIterator iter = iterator(); iter.hasNext();) { - buf.append(iter.next()); - if(iter.hasNext()) { - buf.append(", "); - } - } - buf.append("]"); - return buf.toString(); - } - - // protected utilities - //------------------------------------------------------------------------- - - /** Get my count of structural modifications. */ - protected int getModCount() { - return _modCount; - } - - /** Increment my count of structural modifications. */ - protected void incrModCount() { - _modCount++; - } - - // attributes - //------------------------------------------------------------------------- - - private int _modCount = 0; - - // inner classes - //------------------------------------------------------------------------- - - private static class ComodChecker { - ComodChecker(RandomAccessShortList source) { - _source = source; - resyncModCount(); - } - - protected RandomAccessShortList getList() { - return _source; - } - - protected void assertNotComodified() throws ConcurrentModificationException { - if(_expectedModCount != getList().getModCount()) { - throw new ConcurrentModificationException(); - } - } - - protected void resyncModCount() { - _expectedModCount = getList().getModCount(); - } - - private RandomAccessShortList _source = null; - private int _expectedModCount = -1; - } - - protected static class RandomAccessShortListIterator extends ComodChecker implements ShortListIterator { - RandomAccessShortListIterator(RandomAccessShortList list, int index) { - super(list); - if(index < 0 || index > getList().size()) { - throw new IndexOutOfBoundsException("Index " + index + " not in [0," + getList().size() + ")"); - } else { - _nextIndex = index; - resyncModCount(); - } - } - - public boolean hasNext() { - assertNotComodified(); - return _nextIndex < getList().size(); - } - - public boolean hasPrevious() { - assertNotComodified(); - return _nextIndex > 0; - } - - public int nextIndex() { - assertNotComodified(); - return _nextIndex; - } - - public int previousIndex() { - assertNotComodified(); - return _nextIndex - 1; - } - - public short next() { - assertNotComodified(); - if(!hasNext()) { - throw new NoSuchElementException(); - } else { - short val = getList().get(_nextIndex); - _lastReturnedIndex = _nextIndex; - _nextIndex++; - return val; - } - } - - public short previous() { - assertNotComodified(); - if(!hasPrevious()) { - throw new NoSuchElementException(); - } else { - short val = getList().get(_nextIndex-1); - _lastReturnedIndex = _nextIndex-1; - _nextIndex--; - return val; - } - } - - public void add(short value) { - assertNotComodified(); - getList().add(_nextIndex,value); - _nextIndex++; - _lastReturnedIndex = -1; - resyncModCount(); - } - - public void remove() { - assertNotComodified(); - if(-1 == _lastReturnedIndex) { - throw new IllegalStateException(); - } else { - getList().removeElementAt(_lastReturnedIndex); - _lastReturnedIndex = -1; - _nextIndex--; - resyncModCount(); - } - } - - public void set(short value) { - assertNotComodified(); - if(-1 == _lastReturnedIndex) { - throw new IllegalStateException(); - } else { - getList().set(_lastReturnedIndex,value); - resyncModCount(); - } - } - - private int _nextIndex = 0; - private int _lastReturnedIndex = -1; - } - - protected static class RandomAccessShortSubList extends RandomAccessShortList implements ShortList { - RandomAccessShortSubList(RandomAccessShortList list, int fromIndex, int toIndex) { - if(fromIndex < 0 || toIndex > list.size()) { - throw new IndexOutOfBoundsException(); - } else if(fromIndex > toIndex) { - throw new IllegalArgumentException(); - } else { - _list = list; - _offset = fromIndex; - _limit = toIndex - fromIndex; - _comod = new ComodChecker(list); - _comod.resyncModCount(); - } - } - - public short get(int index) { - checkRange(index); - _comod.assertNotComodified(); - return _list.get(toUnderlyingIndex(index)); - } - - public short removeElementAt(int index) { - checkRange(index); - _comod.assertNotComodified(); - short val = _list.removeElementAt(toUnderlyingIndex(index)); - _limit--; - _comod.resyncModCount(); - incrModCount(); - return val; - } - - public short set(int index, short element) { - checkRange(index); - _comod.assertNotComodified(); - short val = _list.set(toUnderlyingIndex(index),element); - incrModCount(); - _comod.resyncModCount(); - return val; - } - - public void add(int index, short element) { - checkRangeIncludingEndpoint(index); - _comod.assertNotComodified(); - _list.add(toUnderlyingIndex(index),element); - _limit++; - _comod.resyncModCount(); - incrModCount(); - } - - public int size() { - _comod.assertNotComodified(); - return _limit; - } - - private void checkRange(int index) { - if(index < 0 || index >= size()) { - throw new IndexOutOfBoundsException("index " + index + " not in [0," + size() + ")"); - } - } - - private void checkRangeIncludingEndpoint(int index) { - if(index < 0 || index > size()) { - throw new IndexOutOfBoundsException("index " + index + " not in [0," + size() + "]"); - } - } - - private int toUnderlyingIndex(int index) { - return (index + _offset); - } - - private int _offset = 0; - private int _limit = 0; - private RandomAccessShortList _list = null; - private ComodChecker _comod = null; - - } -} - diff --git a/src/java/org/apache/commons/collections/primitives/ShortCollection.java b/src/java/org/apache/commons/collections/primitives/ShortCollection.java deleted file mode 100644 index 515e122a2..000000000 --- a/src/java/org/apache/commons/collections/primitives/ShortCollection.java +++ /dev/null @@ -1,248 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/ShortCollection.java,v 1.3 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -/** - * A collection of short values. - * - * @see org.apache.commons.collections.primitives.adapters.ShortCollectionCollection - * @see org.apache.commons.collections.primitives.adapters.CollectionShortCollection - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public interface ShortCollection { - /** - * Ensures that I contain the specified element - * (optional operation). Returns true - * iff I changed as a result of this call. - *

- * If a collection refuses to add the specified - * element for any reason other than that it already contains - * the element, it must throw an exception (rather than - * simply returning false). This preserves the invariant - * that a collection always contains the specified element after - * this call returns. - * - * @param element the value whose presence within me is to be ensured - * @return true iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException may be thrown if some aspect of the - * specified element prevents it from being added to me - */ - boolean add(short element); - - /** - * {@link #add Adds} all of the elements in the - * specified collection to me (optional operation). - * - * @param c the collection of elements whose presence within me is to - * be ensured - * @return true iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException may be thrown if some aspect of some - * specified element prevents it from being added to me - */ - boolean addAll(ShortCollection c); - - /** - * Removes all my elements (optional operation). - * I will be {@link #isEmpty empty} after this - * method successfully returns. - * - * @throws UnsupportedOperationException when this operation is not - * supported - */ - void clear(); - - /** - * Returns true iff I contain - * the specified element. - * - * @param element the value whose presence within me is to be tested - * @return true iff I contain the specified element - */ - boolean contains(short element); - - /** - * Returns true iff I {@link #contains contain} - * all of the elements in the given collection. - * - * @param c the collection of elements whose presence within me is to - * be tested - * @return true iff I contain the all the specified elements - */ - boolean containsAll(ShortCollection c); - - /** - * Returns true iff I contain no elements. - * @return true iff I contain no elements. - */ - boolean isEmpty(); - - /** - * Returns an {@link ShortIterator iterator} over all my elements. - * This base interface places no constraints on the order - * in which the elements are returned by the returned iterator. - * @return an {@link ShortIterator iterator} over all my elements. - */ - ShortIterator iterator(); - - /** - * Removes all of my elements that are contained in the - * specified collection (optional operation). - * The behavior of this method is unspecified if - * the given collection is modified while this method - * is executing. Note that this includes the case - * in which the given collection is this collection, - * and it is not empty. - * - * @param c the collection of elements to remove - * @return true iff I contained the at least one of the - * specified elements, in other words, returns true - * iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - */ - boolean removeAll(ShortCollection c); - - /** - * Removes a single occurrence of the specified element - * (optional operation). - * - * @param element the element to remove, if present - * @return true iff I contained the specified element, - * in other words, iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - */ - boolean removeElement(short element); - - /** - * Removes all of my elements that are not contained in the - * specified collection (optional operation). - * (In other words, retains only my elements that are - * contained in the specified collection.) - * The behavior of this method is unspecified if - * the given collection is modified while this method - * is executing. - * - * @param c the collection of elements to retain - * @return true iff I changed as a result - * of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - */ - boolean retainAll(ShortCollection c); - - /** - * Returns the number of elements I contain. - * @return the number of elements I contain - */ - int size(); - - /** - * Returns an array containing all of my elements. - * The length of the returned array will be equal - * to my {@link #size size}. - *

- * The returned array will be independent of me, - * so that callers may modify that - * returned array without modifying this collection. - *

- * When I guarantee the order in which - * elements are returned by an {@link #iterator iterator}, - * the returned array will contain elements in the - * same order. - * - * @return an array containing all my elements - */ - short[] toArray(); - - /** - * Returns an array containing all of my elements, - * using the given array if it is large - * enough. When the length of the given array is - * larger than the number of elements I contain, - * values outside of my range will be unchanged. - *

- * The returned array will be independent of me, - * so that callers may modify that - * returned array without modifying this collection. - *

- * When I guarantee the order in which - * elements are returned by an {@link #iterator iterator}, - * the returned array will contain elements in the - * same order. - * - * @param a an array that may be used to contain the elements - * @return an array containing all my elements - */ - short[] toArray(short[] a); -} diff --git a/src/java/org/apache/commons/collections/primitives/ShortIterator.java b/src/java/org/apache/commons/collections/primitives/ShortIterator.java deleted file mode 100644 index 7ff02e4a1..000000000 --- a/src/java/org/apache/commons/collections/primitives/ShortIterator.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/ShortIterator.java,v 1.3 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -/** - * An iterator over short values. - * - * @see org.apache.commons.collections.primitives.adapters.ShortIteratorIterator - * @see org.apache.commons.collections.primitives.adapters.IteratorShortIterator - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public interface ShortIterator { - /** - * Returns true iff I have more elements. - * (In other words, returns true iff - * a subsequent call to {@link #next next} will return - * an element rather than throwing an exception.) - * - * @return true iff I have more elements - */ - boolean hasNext(); - - /** - * Returns the next element in me. - * - * @return the next element in me - * @throws NoSuchElementException if there is no next element - */ - short next(); - - /** - * Removes from my underlying collection the last - * element {@link #next returned} by me - * (optional operation). - * - * @throws UnsupportedOperationException if this operation is not supported - * @throws IllegalStateException if {@link #next} has not yet been - * called, or {@link #remove} has already been called since - * the last call to {@link #next}. - */ - void remove(); -} diff --git a/src/java/org/apache/commons/collections/primitives/ShortList.java b/src/java/org/apache/commons/collections/primitives/ShortList.java deleted file mode 100644 index 08453c3e2..000000000 --- a/src/java/org/apache/commons/collections/primitives/ShortList.java +++ /dev/null @@ -1,293 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/ShortList.java,v 1.3 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -/** - * An ordered collection of short values. - * - * @see org.apache.commons.collections.primitives.adapters.ShortListList - * @see org.apache.commons.collections.primitives.adapters.ListShortList - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public interface ShortList extends ShortCollection { - /** - * Appends the specified element to the end of me - * (optional operation). Returns true - * iff I changed as a result of this call. - *

- * If a collection refuses to add the specified - * element for any reason other than that it already contains - * the element, it must throw an exception (rather than - * simply returning false). This preserves the invariant - * that a collection always contains the specified element after - * this call returns. - * - * @param element the value whose presence within me is to be ensured - * @return true iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException may be thrown if some aspect of the - * specified element prevents it from being added to me - */ - boolean add(short element); - - /** - * Inserts the specified element at the specified position - * (optional operation). Shifts the element currently - * at that position (if any) and any subsequent elements to the - * right, increasing their indices. - * - * @param index the index at which to insert the element - * @param element the value to insert - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException if some aspect of the specified element - * prevents it from being added to me - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - void add(int index, short element); - - /** - * Inserts all of the elements in the specified collection into me, - * at the specified position (optional operation). Shifts the - * element currently at that position (if any) and any subsequent - * elements to the right, increasing their indices. The new elements - * will appear in the order that they are returned by the given - * collection's {@link ShortCollection#iterator iterator}. - * - * @param index the index at which to insert the first element from - * the specified collection - * @param collection the {@link ShortCollection ShortCollection} of elements to add - * @return true iff I changed as a result of this call - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - boolean addAll(int index, ShortCollection collection); - - /** - * Returns true iff that is an ShortList - * that contains the same elements in the same order as me. - * In other words, returns true iff that is - * an ShortList that has the same {@link #size size} as me, - * and for which the elements returned by its - * {@link ShortList#iterator iterator} are equal (==) to - * the corresponding elements within me. - * (This contract ensures that this method works properly across - * different implementations of the ShortList interface.) - * - * @param that the object to compare to me - * @return true iff that is an ShortList - * that contains the same elements in the same order as me - */ - boolean equals(Object that); - - /** - * Returns the value of the element at the specified position - * within me. - * - * @param index the index of the element to return - * @return the value of the element at the specified position - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - short get(int index); - - /** - * Returns my hash code. - *

- * The hash code of an ShortList is defined to be the - * result of the following calculation: - *

 int hash = 1;
-     * for(ShortIterator iter = iterator(); iter.hasNext(); ) {
-     *   short value = iter.next();
-     *   hash = 31*hash + (int)(value ^ (value >>> 32));
-     * }
- *

- * This contract ensures that this method is consistent with - * {@link #equals equals} and with the - * {@link java.util.List#hashCode hashCode} - * method of a {@link java.util.List List} of {@link Short}s. - * - * @return my hash code - */ - int hashCode(); - - /** - * Returns the index of the first occurrence - * of the specified element within me, - * or -1 if I do not contain - * the element. - * - * @param element the element to search for - * @return the smallest index of an element matching the specified value, - * or -1 if no such matching element can be found - */ - int indexOf(short element); - - /** - * Returns an {@link ShortIterator iterator} over all my elements, - * in the appropriate sequence. - * @return an {@link ShortIterator iterator} over all my elements. - */ - ShortIterator iterator(); - - /** - * Returns the index of the last occurrence - * of the specified element within me, - * or -1 if I do not contain the element. - * - * @param element the element to search for - * @return the largest index of an element matching the specified value, - * or -1 if no such matching element can be found - */ - int lastIndexOf(short element); - - /** - * Returns a - * {@link ShortListIterator bidirectional iterator} - * over all my elements, in the appropriate sequence. - */ - ShortListIterator listIterator(); - - /** - * Returns a - * {@link ShortListIterator bidirectional iterator} - * over all my elements, in the appropriate sequence, - * starting at the specified position. The - * specified index indicates the first - * element that would be returned by an initial - * call to the - * {@link ShortListIterator#next next} - * method. An initial call to the - * {@link ShortListIterator#previous previous} - * method would return the element with the specified - * index minus one. - * - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - ShortListIterator listIterator(int index); - - /** - * Removes the element at the specified position in - * (optional operation). Any subsequent elements - * are shifted to the left, subtracting one from their - * indices. Returns the element that was removed. - * - * @param index the index of the element to remove - * @return the value of the element that was removed - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - short removeElementAt(int index); - - /** - * Replaces the element at the specified - * position in me with the specified element - * (optional operation). - * - * @param index the index of the element to change - * @param element the value to be stored at the specified position - * @return the value previously stored at the specified position - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IndexOutOfBoundsException if the specified index is out of range - */ - short set(int index, short element); - - /** - * Returns a view of the elements within me - * between the specified fromIndex, inclusive, and - * toIndex, exclusive. The returned ShortList - * is backed by me, so that any changes in - * the returned list are reflected in me, and vice-versa. - * The returned list supports all of the optional operations - * that I support. - *

- * Note that when fromIndex == toIndex, - * the returned list is initially empty, and when - * fromIndex == 0 && toIndex == {@link #size() size()} - * the returned list is my "improper" sublist, containing all my elements. - *

- * The semantics of the returned list become undefined - * if I am structurally modified in any way other than - * via the returned list. - * - * @param fromIndex the smallest index (inclusive) in me that appears in - * the returned list - * @param toIndex the largest index (exclusive) in me that appears in the - * returned list - * @return a view of this list from fromIndex (inclusive) to - * toIndex (exclusive) - * - * @throws IndexOutOfBoundsException if either specified index is out of range - */ - ShortList subList(int fromIndex, int toIndex); - -} diff --git a/src/java/org/apache/commons/collections/primitives/ShortListIterator.java b/src/java/org/apache/commons/collections/primitives/ShortListIterator.java deleted file mode 100644 index 8b6de0363..000000000 --- a/src/java/org/apache/commons/collections/primitives/ShortListIterator.java +++ /dev/null @@ -1,188 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/ShortListIterator.java,v 1.3 2003/11/07 17:24:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives; - -/** - * A bi-directional iterator over short values. - * - * @see org.apache.commons.collections.primitives.adapters.ShortListIteratorListIterator - * @see org.apache.commons.collections.primitives.adapters.ListIteratorShortListIterator - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 17:24:13 $ - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @author Rodney Waldhoff - */ -public interface ShortListIterator extends ShortIterator { - /** - * Inserts the specified element into my underlying collection - * (optional operation). - * The element is inserted immediately before the next element - * that would have been returned by {@link #next}, if any, - * and immediately after the next element that would have been - * returned by {@link #previous}, if any. - *

- * The new element is inserted immediately before the implied - * cursor. A subsequent call to {@link #previous} will return - * the added element, a subsequent call to {@link #next} will - * be unaffected. This call increases by one the value that - * would be returned by a call to {@link #nextIndex} or - * {@link #previousIndex}. - * - * @param element the value to be inserted - * - * @throws UnsupportedOperationException when this operation is not - * supported - * @throws IllegalArgumentException if some aspect of the specified element - * prevents it from being added - */ - void add(short element); - - /** - * Returns true iff I have more elements - * when traversed in the forward direction. - * (In other words, returns true iff - * a call to {@link #next} will return an element - * rather than throwing an exception. - * - * @return true iff I have more elements when - * traversed in the forward direction - */ - boolean hasNext(); - - /** - * Returns true iff I have more elements - * when traversed in the reverse direction. - * (In other words, returns true iff - * a call to {@link #previous} will return an element - * rather than throwing an exception. - * - * @return true iff I have more elements when - * traversed in the reverse direction - */ - boolean hasPrevious(); - - /** - * Returns the next element in me when traversed in the - * forward direction. - * - * @return the next element in me - * @throws NoSuchElementException if there is no next element - */ - short next(); - - /** - * Returns the index of the element that would be returned - * by a subsequent call to {@link #next}, or the number - * of elements in my iteration if I have no next element. - * - * @return the index of the next element in me - */ - int nextIndex(); - - /** - * Returns the next element in me when traversed in the - * reverse direction. - * - * @return the previous element in me - * @throws NoSuchElementException if there is no previous element - */ - short previous(); - - /** - * Returns the index of the element that would be returned - * by a subsequent call to {@link #previous}, or - * -1 if I have no previous element. - * - * @return the index of the previous element in me - */ - int previousIndex(); - - /** - * Removes from my underlying collection the last - * element returned by {@link #next} or {@link #previous} - * (optional operation). - * - * @throws UnsupportedOperationException if this operation is not - * supported - * @throws IllegalStateException if neither {@link #next} nor - * {@link #previous} has yet been called, or - * {@link #remove} or {@link #add} has already been called since - * the last call to {@link #next} or {@link #previous}. - */ - void remove(); - - /** - * Replaces in my underlying collection the last - * element returned by {@link #next} or {@link #previous} - * with the specified value (optional operation). - * - * @param element the value to replace the last returned element with - * @throws UnsupportedOperationException if this operation is not - * supported - * @throws IllegalStateException if neither {@link #next} nor - * {@link #previous} has yet been called, or - * {@link #remove} or {@link #add} has already been called since - * the last call to {@link #next} or {@link #previous}. - * @throws IllegalArgumentException if some aspect of the specified element - * prevents it from being added - */ - void set(short element); -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/AbstractByteCollectionCollection.java b/src/java/org/apache/commons/collections/primitives/adapters/AbstractByteCollectionCollection.java deleted file mode 100644 index b8f3c6324..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/AbstractByteCollectionCollection.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/AbstractByteCollectionCollection.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.lang.reflect.Array; -import java.util.Collection; -import java.util.Iterator; - -import org.apache.commons.collections.primitives.ByteCollection; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -abstract class AbstractByteCollectionCollection implements Collection { - - public boolean add(Object element) { - return getByteCollection().add(((Number)element).byteValue()); - } - - public boolean addAll(Collection c) { - return getByteCollection().addAll(CollectionByteCollection.wrap(c)); - } - - public void clear() { - getByteCollection().clear(); - } - - public boolean contains(Object element) { - return getByteCollection().contains(((Number)element).byteValue()); - } - - - public boolean containsAll(Collection c) { - return getByteCollection().containsAll(CollectionByteCollection.wrap(c)); - } - - public String toString() { - return getByteCollection().toString(); - } - - public boolean isEmpty() { - return getByteCollection().isEmpty(); - } - - /** - * {@link ByteIteratorIterator#wrap wraps} the - * {@link org.apache.commons.collections.primitives.ByteIterator ByteIterator} - * returned by my underlying - * {@link ByteCollection ByteCollection}, - * if any. - */ - public Iterator iterator() { - return ByteIteratorIterator.wrap(getByteCollection().iterator()); - } - - public boolean remove(Object element) { - return getByteCollection().removeElement(((Number)element).byteValue()); - } - - public boolean removeAll(Collection c) { - return getByteCollection().removeAll(CollectionByteCollection.wrap(c)); - } - - public boolean retainAll(Collection c) { - return getByteCollection().retainAll(CollectionByteCollection.wrap(c)); - } - - public int size() { - return getByteCollection().size(); - } - - public Object[] toArray() { - byte[] a = getByteCollection().toArray(); - Object[] A = new Object[a.length]; - for(int i=0;i a.length) { - A[a.length] = null; - } - - return A; - } - - protected abstract ByteCollection getByteCollection(); -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/AbstractByteListList.java b/src/java/org/apache/commons/collections/primitives/adapters/AbstractByteListList.java deleted file mode 100644 index 01d8f13af..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/AbstractByteListList.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/AbstractByteListList.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import java.util.ListIterator; - -import org.apache.commons.collections.primitives.ByteCollection; -import org.apache.commons.collections.primitives.ByteList; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -abstract class AbstractByteListList extends AbstractByteCollectionCollection implements List { - - public void add(int index, Object element) { - getByteList().add(index,((Number)element).byteValue()); - } - - public boolean addAll(int index, Collection c) { - return getByteList().addAll(index,CollectionByteCollection.wrap(c)); - } - - public Object get(int index) { - return new Byte(getByteList().get(index)); - } - - public int indexOf(Object element) { - return getByteList().indexOf(((Number)element).byteValue()); - } - - public int lastIndexOf(Object element) { - return getByteList().lastIndexOf(((Number)element).byteValue()); - } - - /** - * {@link ByteListIteratorListIterator#wrap wraps} the - * {@link org.apache.commons.collections.primitives.ByteListIterator ByteListIterator} - * returned by my underlying - * {@link ByteList ByteList}, - * if any. - */ - public ListIterator listIterator() { - return ByteListIteratorListIterator.wrap(getByteList().listIterator()); - } - - /** - * {@link ByteListIteratorListIterator#wrap wraps} the - * {@link org.apache.commons.collections.primitives.ByteListIterator ByteListIterator} - * returned by my underlying - * {@link ByteList ByteList}, - * if any. - */ - public ListIterator listIterator(int index) { - return ByteListIteratorListIterator.wrap(getByteList().listIterator(index)); - } - - public Object remove(int index) { - return new Byte(getByteList().removeElementAt(index)); - } - - public Object set(int index, Object element) { - return new Byte(getByteList().set(index, ((Number)element).byteValue() )); - } - - public List subList(int fromIndex, int toIndex) { - return ByteListList.wrap(getByteList().subList(fromIndex,toIndex)); - } - - public boolean equals(Object obj) { - if(obj instanceof List) { - List that = (List)obj; - if(this == that) { - return true; - } else if(this.size() != that.size()) { - return false; - } else { - Iterator thisiter = iterator(); - Iterator thatiter = that.iterator(); - while(thisiter.hasNext()) { - Object thiselt = thisiter.next(); - Object thatelt = thatiter.next(); - if(null == thiselt ? null != thatelt : !(thiselt.equals(thatelt))) { - return false; - } - } - return true; - } - } else { - return false; - } - } - - public int hashCode() { - return getByteList().hashCode(); - } - - protected final ByteCollection getByteCollection() { - return getByteList(); - } - - protected abstract ByteList getByteList(); - - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/AbstractCharCollectionCollection.java b/src/java/org/apache/commons/collections/primitives/adapters/AbstractCharCollectionCollection.java deleted file mode 100644 index ee8bf50d1..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/AbstractCharCollectionCollection.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/AbstractCharCollectionCollection.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.lang.reflect.Array; -import java.util.Collection; -import java.util.Iterator; - -import org.apache.commons.collections.primitives.CharCollection; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -abstract class AbstractCharCollectionCollection implements Collection { - - public boolean add(Object element) { - return getCharCollection().add(((Character)element).charValue()); - } - - public boolean addAll(Collection c) { - return getCharCollection().addAll(CollectionCharCollection.wrap(c)); - } - - public void clear() { - getCharCollection().clear(); - } - - public boolean contains(Object element) { - return getCharCollection().contains(((Character)element).charValue()); - } - - - public boolean containsAll(Collection c) { - return getCharCollection().containsAll(CollectionCharCollection.wrap(c)); - } - - public String toString() { - return getCharCollection().toString(); - } - - public boolean isEmpty() { - return getCharCollection().isEmpty(); - } - - /** - * {@link CharIteratorIterator#wrap wraps} the - * {@link org.apache.commons.collections.primitives.CharIterator CharIterator} - * returned by my underlying - * {@link CharCollection CharCollection}, - * if any. - */ - public Iterator iterator() { - return CharIteratorIterator.wrap(getCharCollection().iterator()); - } - - public boolean remove(Object element) { - return getCharCollection().removeElement(((Character)element).charValue()); - } - - public boolean removeAll(Collection c) { - return getCharCollection().removeAll(CollectionCharCollection.wrap(c)); - } - - public boolean retainAll(Collection c) { - return getCharCollection().retainAll(CollectionCharCollection.wrap(c)); - } - - public int size() { - return getCharCollection().size(); - } - - public Object[] toArray() { - char[] a = getCharCollection().toArray(); - Object[] A = new Object[a.length]; - for(int i=0;i a.length) { - A[a.length] = null; - } - - return A; - } - - protected abstract CharCollection getCharCollection(); -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/AbstractCharListList.java b/src/java/org/apache/commons/collections/primitives/adapters/AbstractCharListList.java deleted file mode 100644 index a3d74c2ef..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/AbstractCharListList.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/AbstractCharListList.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import java.util.ListIterator; - -import org.apache.commons.collections.primitives.CharCollection; -import org.apache.commons.collections.primitives.CharList; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -abstract class AbstractCharListList extends AbstractCharCollectionCollection implements List { - - public void add(int index, Object element) { - getCharList().add(index,((Character)element).charValue()); - } - - public boolean addAll(int index, Collection c) { - return getCharList().addAll(index,CollectionCharCollection.wrap(c)); - } - - public Object get(int index) { - return new Character(getCharList().get(index)); - } - - public int indexOf(Object element) { - return getCharList().indexOf(((Character)element).charValue()); - } - - public int lastIndexOf(Object element) { - return getCharList().lastIndexOf(((Character)element).charValue()); - } - - /** - * {@link CharListIteratorListIterator#wrap wraps} the - * {@link org.apache.commons.collections.primitives.CharListIterator CharListIterator} - * returned by my underlying - * {@link CharList CharList}, - * if any. - */ - public ListIterator listIterator() { - return CharListIteratorListIterator.wrap(getCharList().listIterator()); - } - - /** - * {@link CharListIteratorListIterator#wrap wraps} the - * {@link org.apache.commons.collections.primitives.CharListIterator CharListIterator} - * returned by my underlying - * {@link CharList CharList}, - * if any. - */ - public ListIterator listIterator(int index) { - return CharListIteratorListIterator.wrap(getCharList().listIterator(index)); - } - - public Object remove(int index) { - return new Character(getCharList().removeElementAt(index)); - } - - public Object set(int index, Object element) { - return new Character(getCharList().set(index, ((Character)element).charValue() )); - } - - public List subList(int fromIndex, int toIndex) { - return CharListList.wrap(getCharList().subList(fromIndex,toIndex)); - } - - public boolean equals(Object obj) { - if(obj instanceof List) { - List that = (List)obj; - if(this == that) { - return true; - } else if(this.size() != that.size()) { - return false; - } else { - Iterator thisiter = iterator(); - Iterator thatiter = that.iterator(); - while(thisiter.hasNext()) { - Object thiselt = thisiter.next(); - Object thatelt = thatiter.next(); - if(null == thiselt ? null != thatelt : !(thiselt.equals(thatelt))) { - return false; - } - } - return true; - } - } else { - return false; - } - } - - public int hashCode() { - return getCharList().hashCode(); - } - - protected final CharCollection getCharCollection() { - return getCharList(); - } - - protected abstract CharList getCharList(); - - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/AbstractCollectionByteCollection.java b/src/java/org/apache/commons/collections/primitives/adapters/AbstractCollectionByteCollection.java deleted file mode 100644 index cc8891e59..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/AbstractCollectionByteCollection.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/AbstractCollectionByteCollection.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Collection; - -import org.apache.commons.collections.primitives.ByteCollection; -import org.apache.commons.collections.primitives.ByteIterator; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -abstract class AbstractCollectionByteCollection implements ByteCollection { - protected AbstractCollectionByteCollection() { - } - - public boolean add(byte element) { - return getCollection().add(new Byte(element)); - } - - public boolean addAll(ByteCollection c) { - return getCollection().addAll(ByteCollectionCollection.wrap(c)); - } - - public void clear() { - getCollection().clear(); - } - - public boolean contains(byte element) { - return getCollection().contains(new Byte(element)); - } - - public boolean containsAll(ByteCollection c) { - return getCollection().containsAll(ByteCollectionCollection.wrap(c)); - } - - public String toString() { - return getCollection().toString(); - } - - public boolean isEmpty() { - return getCollection().isEmpty(); - } - - /** - * {@link IteratorByteIterator#wrap wraps} the - * {@link java.util.Iterator Iterator} - * returned by my underlying - * {@link Collection Collection}, - * if any. - */ - public ByteIterator iterator() { - return IteratorByteIterator.wrap(getCollection().iterator()); - } - - public boolean removeElement(byte element) { - return getCollection().remove(new Byte(element)); - } - - public boolean removeAll(ByteCollection c) { - return getCollection().removeAll(ByteCollectionCollection.wrap(c)); - } - - public boolean retainAll(ByteCollection c) { - return getCollection().retainAll(ByteCollectionCollection.wrap(c)); - } - - public int size() { - return getCollection().size(); - } - - public byte[] toArray() { - Object[] src = getCollection().toArray(); - byte[] dest = new byte[src.length]; - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Collection; - -import org.apache.commons.collections.primitives.CharCollection; -import org.apache.commons.collections.primitives.CharIterator; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -abstract class AbstractCollectionCharCollection implements CharCollection { - protected AbstractCollectionCharCollection() { - } - - public boolean add(char element) { - return getCollection().add(new Character(element)); - } - - public boolean addAll(CharCollection c) { - return getCollection().addAll(CharCollectionCollection.wrap(c)); - } - - public void clear() { - getCollection().clear(); - } - - public boolean contains(char element) { - return getCollection().contains(new Character(element)); - } - - public boolean containsAll(CharCollection c) { - return getCollection().containsAll(CharCollectionCollection.wrap(c)); - } - - public String toString() { - return getCollection().toString(); - } - - public boolean isEmpty() { - return getCollection().isEmpty(); - } - - /** - * {@link IteratorCharIterator#wrap wraps} the - * {@link java.util.Iterator Iterator} - * returned by my underlying - * {@link Collection Collection}, - * if any. - */ - public CharIterator iterator() { - return IteratorCharIterator.wrap(getCollection().iterator()); - } - - public boolean removeElement(char element) { - return getCollection().remove(new Character(element)); - } - - public boolean removeAll(CharCollection c) { - return getCollection().removeAll(CharCollectionCollection.wrap(c)); - } - - public boolean retainAll(CharCollection c) { - return getCollection().retainAll(CharCollectionCollection.wrap(c)); - } - - public int size() { - return getCollection().size(); - } - - public char[] toArray() { - Object[] src = getCollection().toArray(); - char[] dest = new char[src.length]; - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Collection; - -import org.apache.commons.collections.primitives.DoubleCollection; -import org.apache.commons.collections.primitives.DoubleIterator; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -abstract class AbstractCollectionDoubleCollection implements DoubleCollection { - protected AbstractCollectionDoubleCollection() { - } - - public boolean add(double element) { - return getCollection().add(new Double(element)); - } - - public boolean addAll(DoubleCollection c) { - return getCollection().addAll(DoubleCollectionCollection.wrap(c)); - } - - public void clear() { - getCollection().clear(); - } - - public boolean contains(double element) { - return getCollection().contains(new Double(element)); - } - - public boolean containsAll(DoubleCollection c) { - return getCollection().containsAll(DoubleCollectionCollection.wrap(c)); - } - - public String toString() { - return getCollection().toString(); - } - - public boolean isEmpty() { - return getCollection().isEmpty(); - } - - /** - * {@link IteratorDoubleIterator#wrap wraps} the - * {@link java.util.Iterator Iterator} - * returned by my underlying - * {@link Collection Collection}, - * if any. - */ - public DoubleIterator iterator() { - return IteratorDoubleIterator.wrap(getCollection().iterator()); - } - - public boolean removeElement(double element) { - return getCollection().remove(new Double(element)); - } - - public boolean removeAll(DoubleCollection c) { - return getCollection().removeAll(DoubleCollectionCollection.wrap(c)); - } - - public boolean retainAll(DoubleCollection c) { - return getCollection().retainAll(DoubleCollectionCollection.wrap(c)); - } - - public int size() { - return getCollection().size(); - } - - public double[] toArray() { - Object[] src = getCollection().toArray(); - double[] dest = new double[src.length]; - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Collection; - -import org.apache.commons.collections.primitives.FloatCollection; -import org.apache.commons.collections.primitives.FloatIterator; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -abstract class AbstractCollectionFloatCollection implements FloatCollection { - protected AbstractCollectionFloatCollection() { - } - - public boolean add(float element) { - return getCollection().add(new Float(element)); - } - - public boolean addAll(FloatCollection c) { - return getCollection().addAll(FloatCollectionCollection.wrap(c)); - } - - public void clear() { - getCollection().clear(); - } - - public boolean contains(float element) { - return getCollection().contains(new Float(element)); - } - - public boolean containsAll(FloatCollection c) { - return getCollection().containsAll(FloatCollectionCollection.wrap(c)); - } - - public String toString() { - return getCollection().toString(); - } - - public boolean isEmpty() { - return getCollection().isEmpty(); - } - - /** - * {@link IteratorFloatIterator#wrap wraps} the - * {@link java.util.Iterator Iterator} - * returned by my underlying - * {@link Collection Collection}, - * if any. - */ - public FloatIterator iterator() { - return IteratorFloatIterator.wrap(getCollection().iterator()); - } - - public boolean removeElement(float element) { - return getCollection().remove(new Float(element)); - } - - public boolean removeAll(FloatCollection c) { - return getCollection().removeAll(FloatCollectionCollection.wrap(c)); - } - - public boolean retainAll(FloatCollection c) { - return getCollection().retainAll(FloatCollectionCollection.wrap(c)); - } - - public int size() { - return getCollection().size(); - } - - public float[] toArray() { - Object[] src = getCollection().toArray(); - float[] dest = new float[src.length]; - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Collection; - -import org.apache.commons.collections.primitives.IntCollection; -import org.apache.commons.collections.primitives.IntIterator; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -abstract class AbstractCollectionIntCollection implements IntCollection { - protected AbstractCollectionIntCollection() { - } - - public boolean add(int element) { - return getCollection().add(new Integer(element)); - } - - public boolean addAll(IntCollection c) { - return getCollection().addAll(IntCollectionCollection.wrap(c)); - } - - public void clear() { - getCollection().clear(); - } - - public boolean contains(int element) { - return getCollection().contains(new Integer(element)); - } - - public boolean containsAll(IntCollection c) { - return getCollection().containsAll(IntCollectionCollection.wrap(c)); - } - - public String toString() { - return getCollection().toString(); - } - - public boolean isEmpty() { - return getCollection().isEmpty(); - } - - /** - * {@link IteratorIntIterator#wrap wraps} the - * {@link java.util.Iterator Iterator} - * returned by my underlying - * {@link Collection Collection}, - * if any. - */ - public IntIterator iterator() { - return IteratorIntIterator.wrap(getCollection().iterator()); - } - - public boolean removeElement(int element) { - return getCollection().remove(new Integer(element)); - } - - public boolean removeAll(IntCollection c) { - return getCollection().removeAll(IntCollectionCollection.wrap(c)); - } - - public boolean retainAll(IntCollection c) { - return getCollection().retainAll(IntCollectionCollection.wrap(c)); - } - - public int size() { - return getCollection().size(); - } - - public int[] toArray() { - Object[] src = getCollection().toArray(); - int[] dest = new int[src.length]; - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Collection; - -import org.apache.commons.collections.primitives.LongCollection; -import org.apache.commons.collections.primitives.LongIterator; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -abstract class AbstractCollectionLongCollection implements LongCollection { - protected AbstractCollectionLongCollection() { - } - - public boolean add(long element) { - return getCollection().add(new Long(element)); - } - - public boolean addAll(LongCollection c) { - return getCollection().addAll(LongCollectionCollection.wrap(c)); - } - - public void clear() { - getCollection().clear(); - } - - public boolean contains(long element) { - return getCollection().contains(new Long(element)); - } - - public boolean containsAll(LongCollection c) { - return getCollection().containsAll(LongCollectionCollection.wrap(c)); - } - - public String toString() { - return getCollection().toString(); - } - - public boolean isEmpty() { - return getCollection().isEmpty(); - } - - /** - * {@link IteratorLongIterator#wrap wraps} the - * {@link java.util.Iterator Iterator} - * returned by my underlying - * {@link Collection Collection}, - * if any. - */ - public LongIterator iterator() { - return IteratorLongIterator.wrap(getCollection().iterator()); - } - - public boolean removeElement(long element) { - return getCollection().remove(new Long(element)); - } - - public boolean removeAll(LongCollection c) { - return getCollection().removeAll(LongCollectionCollection.wrap(c)); - } - - public boolean retainAll(LongCollection c) { - return getCollection().retainAll(LongCollectionCollection.wrap(c)); - } - - public int size() { - return getCollection().size(); - } - - public long[] toArray() { - Object[] src = getCollection().toArray(); - long[] dest = new long[src.length]; - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Collection; - -import org.apache.commons.collections.primitives.ShortCollection; -import org.apache.commons.collections.primitives.ShortIterator; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -abstract class AbstractCollectionShortCollection implements ShortCollection { - protected AbstractCollectionShortCollection() { - } - - public boolean add(short element) { - return getCollection().add(new Short(element)); - } - - public boolean addAll(ShortCollection c) { - return getCollection().addAll(ShortCollectionCollection.wrap(c)); - } - - public void clear() { - getCollection().clear(); - } - - public boolean contains(short element) { - return getCollection().contains(new Short(element)); - } - - public boolean containsAll(ShortCollection c) { - return getCollection().containsAll(ShortCollectionCollection.wrap(c)); - } - - public String toString() { - return getCollection().toString(); - } - - public boolean isEmpty() { - return getCollection().isEmpty(); - } - - /** - * {@link IteratorShortIterator#wrap wraps} the - * {@link java.util.Iterator Iterator} - * returned by my underlying - * {@link Collection Collection}, - * if any. - */ - public ShortIterator iterator() { - return IteratorShortIterator.wrap(getCollection().iterator()); - } - - public boolean removeElement(short element) { - return getCollection().remove(new Short(element)); - } - - public boolean removeAll(ShortCollection c) { - return getCollection().removeAll(ShortCollectionCollection.wrap(c)); - } - - public boolean retainAll(ShortCollection c) { - return getCollection().retainAll(ShortCollectionCollection.wrap(c)); - } - - public int size() { - return getCollection().size(); - } - - public short[] toArray() { - Object[] src = getCollection().toArray(); - short[] dest = new short[src.length]; - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.lang.reflect.Array; -import java.util.Collection; -import java.util.Iterator; - -import org.apache.commons.collections.primitives.DoubleCollection; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -abstract class AbstractDoubleCollectionCollection implements Collection { - - public boolean add(Object element) { - return getDoubleCollection().add(((Number)element).doubleValue()); - } - - public boolean addAll(Collection c) { - return getDoubleCollection().addAll(CollectionDoubleCollection.wrap(c)); - } - - public void clear() { - getDoubleCollection().clear(); - } - - public boolean contains(Object element) { - return getDoubleCollection().contains(((Number)element).doubleValue()); - } - - - public boolean containsAll(Collection c) { - return getDoubleCollection().containsAll(CollectionDoubleCollection.wrap(c)); - } - - public String toString() { - return getDoubleCollection().toString(); - } - - public boolean isEmpty() { - return getDoubleCollection().isEmpty(); - } - - /** - * {@link DoubleIteratorIterator#wrap wraps} the - * {@link org.apache.commons.collections.primitives.DoubleIterator DoubleIterator} - * returned by my underlying - * {@link DoubleCollection DoubleCollection}, - * if any. - */ - public Iterator iterator() { - return DoubleIteratorIterator.wrap(getDoubleCollection().iterator()); - } - - public boolean remove(Object element) { - return getDoubleCollection().removeElement(((Number)element).doubleValue()); - } - - public boolean removeAll(Collection c) { - return getDoubleCollection().removeAll(CollectionDoubleCollection.wrap(c)); - } - - public boolean retainAll(Collection c) { - return getDoubleCollection().retainAll(CollectionDoubleCollection.wrap(c)); - } - - public int size() { - return getDoubleCollection().size(); - } - - public Object[] toArray() { - double[] a = getDoubleCollection().toArray(); - Object[] A = new Object[a.length]; - for(int i=0;i a.length) { - A[a.length] = null; - } - - return A; - } - - protected abstract DoubleCollection getDoubleCollection(); -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/AbstractDoubleListList.java b/src/java/org/apache/commons/collections/primitives/adapters/AbstractDoubleListList.java deleted file mode 100644 index c4b2afedf..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/AbstractDoubleListList.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/AbstractDoubleListList.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import java.util.ListIterator; - -import org.apache.commons.collections.primitives.DoubleCollection; -import org.apache.commons.collections.primitives.DoubleList; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -abstract class AbstractDoubleListList extends AbstractDoubleCollectionCollection implements List { - - public void add(int index, Object element) { - getDoubleList().add(index,((Number)element).doubleValue()); - } - - public boolean addAll(int index, Collection c) { - return getDoubleList().addAll(index,CollectionDoubleCollection.wrap(c)); - } - - public Object get(int index) { - return new Double(getDoubleList().get(index)); - } - - public int indexOf(Object element) { - return getDoubleList().indexOf(((Number)element).doubleValue()); - } - - public int lastIndexOf(Object element) { - return getDoubleList().lastIndexOf(((Number)element).doubleValue()); - } - - /** - * {@link DoubleListIteratorListIterator#wrap wraps} the - * {@link org.apache.commons.collections.primitives.DoubleListIterator DoubleListIterator} - * returned by my underlying - * {@link DoubleList DoubleList}, - * if any. - */ - public ListIterator listIterator() { - return DoubleListIteratorListIterator.wrap(getDoubleList().listIterator()); - } - - /** - * {@link DoubleListIteratorListIterator#wrap wraps} the - * {@link org.apache.commons.collections.primitives.DoubleListIterator DoubleListIterator} - * returned by my underlying - * {@link DoubleList DoubleList}, - * if any. - */ - public ListIterator listIterator(int index) { - return DoubleListIteratorListIterator.wrap(getDoubleList().listIterator(index)); - } - - public Object remove(int index) { - return new Double(getDoubleList().removeElementAt(index)); - } - - public Object set(int index, Object element) { - return new Double(getDoubleList().set(index, ((Number)element).doubleValue() )); - } - - public List subList(int fromIndex, int toIndex) { - return DoubleListList.wrap(getDoubleList().subList(fromIndex,toIndex)); - } - - public boolean equals(Object obj) { - if(obj instanceof List) { - List that = (List)obj; - if(this == that) { - return true; - } else if(this.size() != that.size()) { - return false; - } else { - Iterator thisiter = iterator(); - Iterator thatiter = that.iterator(); - while(thisiter.hasNext()) { - Object thiselt = thisiter.next(); - Object thatelt = thatiter.next(); - if(null == thiselt ? null != thatelt : !(thiselt.equals(thatelt))) { - return false; - } - } - return true; - } - } else { - return false; - } - } - - public int hashCode() { - return getDoubleList().hashCode(); - } - - protected final DoubleCollection getDoubleCollection() { - return getDoubleList(); - } - - protected abstract DoubleList getDoubleList(); - - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/AbstractFloatCollectionCollection.java b/src/java/org/apache/commons/collections/primitives/adapters/AbstractFloatCollectionCollection.java deleted file mode 100644 index f7132ecd0..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/AbstractFloatCollectionCollection.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/AbstractFloatCollectionCollection.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.lang.reflect.Array; -import java.util.Collection; -import java.util.Iterator; - -import org.apache.commons.collections.primitives.FloatCollection; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -abstract class AbstractFloatCollectionCollection implements Collection { - - public boolean add(Object element) { - return getFloatCollection().add(((Number)element).floatValue()); - } - - public boolean addAll(Collection c) { - return getFloatCollection().addAll(CollectionFloatCollection.wrap(c)); - } - - public void clear() { - getFloatCollection().clear(); - } - - public boolean contains(Object element) { - return getFloatCollection().contains(((Number)element).floatValue()); - } - - - public boolean containsAll(Collection c) { - return getFloatCollection().containsAll(CollectionFloatCollection.wrap(c)); - } - - public String toString() { - return getFloatCollection().toString(); - } - - public boolean isEmpty() { - return getFloatCollection().isEmpty(); - } - - /** - * {@link FloatIteratorIterator#wrap wraps} the - * {@link org.apache.commons.collections.primitives.FloatIterator FloatIterator} - * returned by my underlying - * {@link FloatCollection FloatCollection}, - * if any. - */ - public Iterator iterator() { - return FloatIteratorIterator.wrap(getFloatCollection().iterator()); - } - - public boolean remove(Object element) { - return getFloatCollection().removeElement(((Number)element).floatValue()); - } - - public boolean removeAll(Collection c) { - return getFloatCollection().removeAll(CollectionFloatCollection.wrap(c)); - } - - public boolean retainAll(Collection c) { - return getFloatCollection().retainAll(CollectionFloatCollection.wrap(c)); - } - - public int size() { - return getFloatCollection().size(); - } - - public Object[] toArray() { - float[] a = getFloatCollection().toArray(); - Object[] A = new Object[a.length]; - for(int i=0;i a.length) { - A[a.length] = null; - } - - return A; - } - - protected abstract FloatCollection getFloatCollection(); -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/AbstractFloatListList.java b/src/java/org/apache/commons/collections/primitives/adapters/AbstractFloatListList.java deleted file mode 100644 index b4f713711..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/AbstractFloatListList.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/AbstractFloatListList.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import java.util.ListIterator; - -import org.apache.commons.collections.primitives.FloatCollection; -import org.apache.commons.collections.primitives.FloatList; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -abstract class AbstractFloatListList extends AbstractFloatCollectionCollection implements List { - - public void add(int index, Object element) { - getFloatList().add(index,((Number)element).floatValue()); - } - - public boolean addAll(int index, Collection c) { - return getFloatList().addAll(index,CollectionFloatCollection.wrap(c)); - } - - public Object get(int index) { - return new Float(getFloatList().get(index)); - } - - public int indexOf(Object element) { - return getFloatList().indexOf(((Number)element).floatValue()); - } - - public int lastIndexOf(Object element) { - return getFloatList().lastIndexOf(((Number)element).floatValue()); - } - - /** - * {@link FloatListIteratorListIterator#wrap wraps} the - * {@link org.apache.commons.collections.primitives.FloatListIterator FloatListIterator} - * returned by my underlying - * {@link FloatList FloatList}, - * if any. - */ - public ListIterator listIterator() { - return FloatListIteratorListIterator.wrap(getFloatList().listIterator()); - } - - /** - * {@link FloatListIteratorListIterator#wrap wraps} the - * {@link org.apache.commons.collections.primitives.FloatListIterator FloatListIterator} - * returned by my underlying - * {@link FloatList FloatList}, - * if any. - */ - public ListIterator listIterator(int index) { - return FloatListIteratorListIterator.wrap(getFloatList().listIterator(index)); - } - - public Object remove(int index) { - return new Float(getFloatList().removeElementAt(index)); - } - - public Object set(int index, Object element) { - return new Float(getFloatList().set(index, ((Number)element).floatValue() )); - } - - public List subList(int fromIndex, int toIndex) { - return FloatListList.wrap(getFloatList().subList(fromIndex,toIndex)); - } - - public boolean equals(Object obj) { - if(obj instanceof List) { - List that = (List)obj; - if(this == that) { - return true; - } else if(this.size() != that.size()) { - return false; - } else { - Iterator thisiter = iterator(); - Iterator thatiter = that.iterator(); - while(thisiter.hasNext()) { - Object thiselt = thisiter.next(); - Object thatelt = thatiter.next(); - if(null == thiselt ? null != thatelt : !(thiselt.equals(thatelt))) { - return false; - } - } - return true; - } - } else { - return false; - } - } - - public int hashCode() { - return getFloatList().hashCode(); - } - - protected final FloatCollection getFloatCollection() { - return getFloatList(); - } - - protected abstract FloatList getFloatList(); - - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/AbstractIntCollectionCollection.java b/src/java/org/apache/commons/collections/primitives/adapters/AbstractIntCollectionCollection.java deleted file mode 100644 index 224e1c6b0..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/AbstractIntCollectionCollection.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/AbstractIntCollectionCollection.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.lang.reflect.Array; -import java.util.Collection; -import java.util.Iterator; - -import org.apache.commons.collections.primitives.IntCollection; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -abstract class AbstractIntCollectionCollection implements Collection { - - public boolean add(Object element) { - return getIntCollection().add(((Number)element).intValue()); - } - - public boolean addAll(Collection c) { - return getIntCollection().addAll(CollectionIntCollection.wrap(c)); - } - - public void clear() { - getIntCollection().clear(); - } - - public boolean contains(Object element) { - return getIntCollection().contains(((Number)element).intValue()); - } - - - public boolean containsAll(Collection c) { - return getIntCollection().containsAll(CollectionIntCollection.wrap(c)); - } - - public String toString() { - return getIntCollection().toString(); - } - - public boolean isEmpty() { - return getIntCollection().isEmpty(); - } - - /** - * {@link IntIteratorIterator#wrap wraps} the - * {@link org.apache.commons.collections.primitives.IntIterator IntIterator} - * returned by my underlying - * {@link IntCollection IntCollection}, - * if any. - */ - public Iterator iterator() { - return IntIteratorIterator.wrap(getIntCollection().iterator()); - } - - public boolean remove(Object element) { - return getIntCollection().removeElement(((Number)element).intValue()); - } - - public boolean removeAll(Collection c) { - return getIntCollection().removeAll(CollectionIntCollection.wrap(c)); - } - - public boolean retainAll(Collection c) { - return getIntCollection().retainAll(CollectionIntCollection.wrap(c)); - } - - public int size() { - return getIntCollection().size(); - } - - public Object[] toArray() { - int[] a = getIntCollection().toArray(); - Object[] A = new Object[a.length]; - for(int i=0;i a.length) { - A[a.length] = null; - } - - return A; - } - - protected abstract IntCollection getIntCollection(); -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/AbstractIntListList.java b/src/java/org/apache/commons/collections/primitives/adapters/AbstractIntListList.java deleted file mode 100644 index 45ed0fbb3..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/AbstractIntListList.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/AbstractIntListList.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import java.util.ListIterator; - -import org.apache.commons.collections.primitives.IntCollection; -import org.apache.commons.collections.primitives.IntList; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -abstract class AbstractIntListList extends AbstractIntCollectionCollection implements List { - - public void add(int index, Object element) { - getIntList().add(index,((Number)element).intValue()); - } - - public boolean addAll(int index, Collection c) { - return getIntList().addAll(index,CollectionIntCollection.wrap(c)); - } - - public Object get(int index) { - return new Integer(getIntList().get(index)); - } - - public int indexOf(Object element) { - return getIntList().indexOf(((Number)element).intValue()); - } - - public int lastIndexOf(Object element) { - return getIntList().lastIndexOf(((Number)element).intValue()); - } - - /** - * {@link IntListIteratorListIterator#wrap wraps} the - * {@link org.apache.commons.collections.primitives.IntListIterator IntListIterator} - * returned by my underlying - * {@link IntList IntList}, - * if any. - */ - public ListIterator listIterator() { - return IntListIteratorListIterator.wrap(getIntList().listIterator()); - } - - /** - * {@link IntListIteratorListIterator#wrap wraps} the - * {@link org.apache.commons.collections.primitives.IntListIterator IntListIterator} - * returned by my underlying - * {@link IntList IntList}, - * if any. - */ - public ListIterator listIterator(int index) { - return IntListIteratorListIterator.wrap(getIntList().listIterator(index)); - } - - public Object remove(int index) { - return new Integer(getIntList().removeElementAt(index)); - } - - public Object set(int index, Object element) { - return new Integer(getIntList().set(index, ((Number)element).intValue() )); - } - - public List subList(int fromIndex, int toIndex) { - return IntListList.wrap(getIntList().subList(fromIndex,toIndex)); - } - - public boolean equals(Object obj) { - if(obj instanceof List) { - List that = (List)obj; - if(this == that) { - return true; - } else if(this.size() != that.size()) { - return false; - } else { - Iterator thisiter = iterator(); - Iterator thatiter = that.iterator(); - while(thisiter.hasNext()) { - Object thiselt = thisiter.next(); - Object thatelt = thatiter.next(); - if(null == thiselt ? null != thatelt : !(thiselt.equals(thatelt))) { - return false; - } - } - return true; - } - } else { - return false; - } - } - - public int hashCode() { - return getIntList().hashCode(); - } - - protected final IntCollection getIntCollection() { - return getIntList(); - } - - protected abstract IntList getIntList(); - - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/AbstractListByteList.java b/src/java/org/apache/commons/collections/primitives/adapters/AbstractListByteList.java deleted file mode 100644 index df93bcb81..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/AbstractListByteList.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/AbstractListByteList.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Collection; -import java.util.List; - -import org.apache.commons.collections.primitives.ByteCollection; -import org.apache.commons.collections.primitives.ByteIterator; -import org.apache.commons.collections.primitives.ByteList; -import org.apache.commons.collections.primitives.ByteListIterator; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -abstract class AbstractListByteList extends AbstractCollectionByteCollection implements ByteList { - - public void add(int index, byte element) { - getList().add(index,new Byte(element)); - } - - public boolean addAll(int index, ByteCollection collection) { - return getList().addAll(index,ByteCollectionCollection.wrap(collection)); - } - - public byte get(int index) { - return ((Number)getList().get(index)).byteValue(); - } - - public int indexOf(byte element) { - return getList().indexOf(new Byte(element)); - } - - public int lastIndexOf(byte element) { - return getList().lastIndexOf(new Byte(element)); - } - - /** - * {@link ListIteratorByteListIterator#wrap wraps} the - * {@link ByteList ByteList} - * returned by my underlying - * {@link ByteListIterator ByteListIterator}, - * if any. - */ - public ByteListIterator listIterator() { - return ListIteratorByteListIterator.wrap(getList().listIterator()); - } - - /** - * {@link ListIteratorByteListIterator#wrap wraps} the - * {@link ByteList ByteList} - * returned by my underlying - * {@link ByteListIterator ByteListIterator}, - * if any. - */ - public ByteListIterator listIterator(int index) { - return ListIteratorByteListIterator.wrap(getList().listIterator(index)); - } - - public byte removeElementAt(int index) { - return ((Number)getList().remove(index)).byteValue(); - } - - public byte set(int index, byte element) { - return ((Number)getList().set(index,new Byte(element))).byteValue(); - } - - public ByteList subList(int fromIndex, int toIndex) { - return ListByteList.wrap(getList().subList(fromIndex,toIndex)); - } - - public boolean equals(Object obj) { - if(obj instanceof ByteList) { - ByteList that = (ByteList)obj; - if(this == that) { - return true; - } else if(this.size() != that.size()) { - return false; - } else { - ByteIterator thisiter = iterator(); - ByteIterator thatiter = that.iterator(); - while(thisiter.hasNext()) { - if(thisiter.next() != thatiter.next()) { - return false; - } - } - return true; - } - } else { - return false; - } - } - - public int hashCode() { - return getList().hashCode(); - } - - final protected Collection getCollection() { - return getList(); - } - - abstract protected List getList(); -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/AbstractListCharList.java b/src/java/org/apache/commons/collections/primitives/adapters/AbstractListCharList.java deleted file mode 100644 index b08c04d8a..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/AbstractListCharList.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/AbstractListCharList.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Collection; -import java.util.List; - -import org.apache.commons.collections.primitives.CharCollection; -import org.apache.commons.collections.primitives.CharIterator; -import org.apache.commons.collections.primitives.CharList; -import org.apache.commons.collections.primitives.CharListIterator; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -abstract class AbstractListCharList extends AbstractCollectionCharCollection implements CharList { - - public void add(int index, char element) { - getList().add(index,new Character(element)); - } - - public boolean addAll(int index, CharCollection collection) { - return getList().addAll(index,CharCollectionCollection.wrap(collection)); - } - - public char get(int index) { - return ((Character)getList().get(index)).charValue(); - } - - public int indexOf(char element) { - return getList().indexOf(new Character(element)); - } - - public int lastIndexOf(char element) { - return getList().lastIndexOf(new Character(element)); - } - - /** - * {@link ListIteratorCharListIterator#wrap wraps} the - * {@link CharList CharList} - * returned by my underlying - * {@link CharListIterator CharListIterator}, - * if any. - */ - public CharListIterator listIterator() { - return ListIteratorCharListIterator.wrap(getList().listIterator()); - } - - /** - * {@link ListIteratorCharListIterator#wrap wraps} the - * {@link CharList CharList} - * returned by my underlying - * {@link CharListIterator CharListIterator}, - * if any. - */ - public CharListIterator listIterator(int index) { - return ListIteratorCharListIterator.wrap(getList().listIterator(index)); - } - - public char removeElementAt(int index) { - return ((Character)getList().remove(index)).charValue(); - } - - public char set(int index, char element) { - return ((Character)getList().set(index,new Character(element))).charValue(); - } - - public CharList subList(int fromIndex, int toIndex) { - return ListCharList.wrap(getList().subList(fromIndex,toIndex)); - } - - public boolean equals(Object obj) { - if(obj instanceof CharList) { - CharList that = (CharList)obj; - if(this == that) { - return true; - } else if(this.size() != that.size()) { - return false; - } else { - CharIterator thisiter = iterator(); - CharIterator thatiter = that.iterator(); - while(thisiter.hasNext()) { - if(thisiter.next() != thatiter.next()) { - return false; - } - } - return true; - } - } else { - return false; - } - } - - public int hashCode() { - return getList().hashCode(); - } - - final protected Collection getCollection() { - return getList(); - } - - abstract protected List getList(); -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/AbstractListDoubleList.java b/src/java/org/apache/commons/collections/primitives/adapters/AbstractListDoubleList.java deleted file mode 100644 index ba024496f..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/AbstractListDoubleList.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/AbstractListDoubleList.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Collection; -import java.util.List; - -import org.apache.commons.collections.primitives.DoubleCollection; -import org.apache.commons.collections.primitives.DoubleIterator; -import org.apache.commons.collections.primitives.DoubleList; -import org.apache.commons.collections.primitives.DoubleListIterator; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -abstract class AbstractListDoubleList extends AbstractCollectionDoubleCollection implements DoubleList { - - public void add(int index, double element) { - getList().add(index,new Double(element)); - } - - public boolean addAll(int index, DoubleCollection collection) { - return getList().addAll(index,DoubleCollectionCollection.wrap(collection)); - } - - public double get(int index) { - return ((Number)getList().get(index)).doubleValue(); - } - - public int indexOf(double element) { - return getList().indexOf(new Double(element)); - } - - public int lastIndexOf(double element) { - return getList().lastIndexOf(new Double(element)); - } - - /** - * {@link ListIteratorDoubleListIterator#wrap wraps} the - * {@link DoubleList DoubleList} - * returned by my underlying - * {@link DoubleListIterator DoubleListIterator}, - * if any. - */ - public DoubleListIterator listIterator() { - return ListIteratorDoubleListIterator.wrap(getList().listIterator()); - } - - /** - * {@link ListIteratorDoubleListIterator#wrap wraps} the - * {@link DoubleList DoubleList} - * returned by my underlying - * {@link DoubleListIterator DoubleListIterator}, - * if any. - */ - public DoubleListIterator listIterator(int index) { - return ListIteratorDoubleListIterator.wrap(getList().listIterator(index)); - } - - public double removeElementAt(int index) { - return ((Number)getList().remove(index)).doubleValue(); - } - - public double set(int index, double element) { - return ((Number)getList().set(index,new Double(element))).doubleValue(); - } - - public DoubleList subList(int fromIndex, int toIndex) { - return ListDoubleList.wrap(getList().subList(fromIndex,toIndex)); - } - - public boolean equals(Object obj) { - if(obj instanceof DoubleList) { - DoubleList that = (DoubleList)obj; - if(this == that) { - return true; - } else if(this.size() != that.size()) { - return false; - } else { - DoubleIterator thisiter = iterator(); - DoubleIterator thatiter = that.iterator(); - while(thisiter.hasNext()) { - if(thisiter.next() != thatiter.next()) { - return false; - } - } - return true; - } - } else { - return false; - } - } - - public int hashCode() { - return getList().hashCode(); - } - - final protected Collection getCollection() { - return getList(); - } - - abstract protected List getList(); -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/AbstractListFloatList.java b/src/java/org/apache/commons/collections/primitives/adapters/AbstractListFloatList.java deleted file mode 100644 index 6b083f31a..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/AbstractListFloatList.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/AbstractListFloatList.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Collection; -import java.util.List; - -import org.apache.commons.collections.primitives.FloatCollection; -import org.apache.commons.collections.primitives.FloatIterator; -import org.apache.commons.collections.primitives.FloatList; -import org.apache.commons.collections.primitives.FloatListIterator; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -abstract class AbstractListFloatList extends AbstractCollectionFloatCollection implements FloatList { - - public void add(int index, float element) { - getList().add(index,new Float(element)); - } - - public boolean addAll(int index, FloatCollection collection) { - return getList().addAll(index,FloatCollectionCollection.wrap(collection)); - } - - public float get(int index) { - return ((Number)getList().get(index)).floatValue(); - } - - public int indexOf(float element) { - return getList().indexOf(new Float(element)); - } - - public int lastIndexOf(float element) { - return getList().lastIndexOf(new Float(element)); - } - - /** - * {@link ListIteratorFloatListIterator#wrap wraps} the - * {@link FloatList FloatList} - * returned by my underlying - * {@link FloatListIterator FloatListIterator}, - * if any. - */ - public FloatListIterator listIterator() { - return ListIteratorFloatListIterator.wrap(getList().listIterator()); - } - - /** - * {@link ListIteratorFloatListIterator#wrap wraps} the - * {@link FloatList FloatList} - * returned by my underlying - * {@link FloatListIterator FloatListIterator}, - * if any. - */ - public FloatListIterator listIterator(int index) { - return ListIteratorFloatListIterator.wrap(getList().listIterator(index)); - } - - public float removeElementAt(int index) { - return ((Number)getList().remove(index)).floatValue(); - } - - public float set(int index, float element) { - return ((Number)getList().set(index,new Float(element))).floatValue(); - } - - public FloatList subList(int fromIndex, int toIndex) { - return ListFloatList.wrap(getList().subList(fromIndex,toIndex)); - } - - public boolean equals(Object obj) { - if(obj instanceof FloatList) { - FloatList that = (FloatList)obj; - if(this == that) { - return true; - } else if(this.size() != that.size()) { - return false; - } else { - FloatIterator thisiter = iterator(); - FloatIterator thatiter = that.iterator(); - while(thisiter.hasNext()) { - if(thisiter.next() != thatiter.next()) { - return false; - } - } - return true; - } - } else { - return false; - } - } - - public int hashCode() { - return getList().hashCode(); - } - - final protected Collection getCollection() { - return getList(); - } - - abstract protected List getList(); -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/AbstractListIntList.java b/src/java/org/apache/commons/collections/primitives/adapters/AbstractListIntList.java deleted file mode 100644 index 0d39f7e10..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/AbstractListIntList.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/AbstractListIntList.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Collection; -import java.util.List; - -import org.apache.commons.collections.primitives.IntCollection; -import org.apache.commons.collections.primitives.IntIterator; -import org.apache.commons.collections.primitives.IntList; -import org.apache.commons.collections.primitives.IntListIterator; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -abstract class AbstractListIntList extends AbstractCollectionIntCollection implements IntList { - - public void add(int index, int element) { - getList().add(index,new Integer(element)); - } - - public boolean addAll(int index, IntCollection collection) { - return getList().addAll(index,IntCollectionCollection.wrap(collection)); - } - - public int get(int index) { - return ((Number)getList().get(index)).intValue(); - } - - public int indexOf(int element) { - return getList().indexOf(new Integer(element)); - } - - public int lastIndexOf(int element) { - return getList().lastIndexOf(new Integer(element)); - } - - /** - * {@link ListIteratorIntListIterator#wrap wraps} the - * {@link IntList IntList} - * returned by my underlying - * {@link IntListIterator IntListIterator}, - * if any. - */ - public IntListIterator listIterator() { - return ListIteratorIntListIterator.wrap(getList().listIterator()); - } - - /** - * {@link ListIteratorIntListIterator#wrap wraps} the - * {@link IntList IntList} - * returned by my underlying - * {@link IntListIterator IntListIterator}, - * if any. - */ - public IntListIterator listIterator(int index) { - return ListIteratorIntListIterator.wrap(getList().listIterator(index)); - } - - public int removeElementAt(int index) { - return ((Number)getList().remove(index)).intValue(); - } - - public int set(int index, int element) { - return ((Number)getList().set(index,new Integer(element))).intValue(); - } - - public IntList subList(int fromIndex, int toIndex) { - return ListIntList.wrap(getList().subList(fromIndex,toIndex)); - } - - public boolean equals(Object obj) { - if(obj instanceof IntList) { - IntList that = (IntList)obj; - if(this == that) { - return true; - } else if(this.size() != that.size()) { - return false; - } else { - IntIterator thisiter = iterator(); - IntIterator thatiter = that.iterator(); - while(thisiter.hasNext()) { - if(thisiter.next() != thatiter.next()) { - return false; - } - } - return true; - } - } else { - return false; - } - } - - public int hashCode() { - return getList().hashCode(); - } - - final protected Collection getCollection() { - return getList(); - } - - abstract protected List getList(); -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/AbstractListLongList.java b/src/java/org/apache/commons/collections/primitives/adapters/AbstractListLongList.java deleted file mode 100644 index 96910f656..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/AbstractListLongList.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/AbstractListLongList.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Collection; -import java.util.List; - -import org.apache.commons.collections.primitives.LongCollection; -import org.apache.commons.collections.primitives.LongIterator; -import org.apache.commons.collections.primitives.LongList; -import org.apache.commons.collections.primitives.LongListIterator; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -abstract class AbstractListLongList extends AbstractCollectionLongCollection implements LongList { - - public void add(int index, long element) { - getList().add(index,new Long(element)); - } - - public boolean addAll(int index, LongCollection collection) { - return getList().addAll(index,LongCollectionCollection.wrap(collection)); - } - - public long get(int index) { - return ((Number)getList().get(index)).longValue(); - } - - public int indexOf(long element) { - return getList().indexOf(new Long(element)); - } - - public int lastIndexOf(long element) { - return getList().lastIndexOf(new Long(element)); - } - - /** - * {@link ListIteratorLongListIterator#wrap wraps} the - * {@link LongList LongList} - * returned by my underlying - * {@link LongListIterator LongListIterator}, - * if any. - */ - public LongListIterator listIterator() { - return ListIteratorLongListIterator.wrap(getList().listIterator()); - } - - /** - * {@link ListIteratorLongListIterator#wrap wraps} the - * {@link LongList LongList} - * returned by my underlying - * {@link LongListIterator LongListIterator}, - * if any. - */ - public LongListIterator listIterator(int index) { - return ListIteratorLongListIterator.wrap(getList().listIterator(index)); - } - - public long removeElementAt(int index) { - return ((Number)getList().remove(index)).longValue(); - } - - public long set(int index, long element) { - return ((Number)getList().set(index,new Long(element))).longValue(); - } - - public LongList subList(int fromIndex, int toIndex) { - return ListLongList.wrap(getList().subList(fromIndex,toIndex)); - } - - public boolean equals(Object obj) { - if(obj instanceof LongList) { - LongList that = (LongList)obj; - if(this == that) { - return true; - } else if(this.size() != that.size()) { - return false; - } else { - LongIterator thisiter = iterator(); - LongIterator thatiter = that.iterator(); - while(thisiter.hasNext()) { - if(thisiter.next() != thatiter.next()) { - return false; - } - } - return true; - } - } else { - return false; - } - } - - public int hashCode() { - return getList().hashCode(); - } - - final protected Collection getCollection() { - return getList(); - } - - abstract protected List getList(); -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/AbstractListShortList.java b/src/java/org/apache/commons/collections/primitives/adapters/AbstractListShortList.java deleted file mode 100644 index 9ba408545..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/AbstractListShortList.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/AbstractListShortList.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Collection; -import java.util.List; - -import org.apache.commons.collections.primitives.ShortCollection; -import org.apache.commons.collections.primitives.ShortIterator; -import org.apache.commons.collections.primitives.ShortList; -import org.apache.commons.collections.primitives.ShortListIterator; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -abstract class AbstractListShortList extends AbstractCollectionShortCollection implements ShortList { - - public void add(int index, short element) { - getList().add(index,new Short(element)); - } - - public boolean addAll(int index, ShortCollection collection) { - return getList().addAll(index,ShortCollectionCollection.wrap(collection)); - } - - public short get(int index) { - return ((Number)getList().get(index)).shortValue(); - } - - public int indexOf(short element) { - return getList().indexOf(new Short(element)); - } - - public int lastIndexOf(short element) { - return getList().lastIndexOf(new Short(element)); - } - - /** - * {@link ListIteratorShortListIterator#wrap wraps} the - * {@link ShortList ShortList} - * returned by my underlying - * {@link ShortListIterator ShortListIterator}, - * if any. - */ - public ShortListIterator listIterator() { - return ListIteratorShortListIterator.wrap(getList().listIterator()); - } - - /** - * {@link ListIteratorShortListIterator#wrap wraps} the - * {@link ShortList ShortList} - * returned by my underlying - * {@link ShortListIterator ShortListIterator}, - * if any. - */ - public ShortListIterator listIterator(int index) { - return ListIteratorShortListIterator.wrap(getList().listIterator(index)); - } - - public short removeElementAt(int index) { - return ((Number)getList().remove(index)).shortValue(); - } - - public short set(int index, short element) { - return ((Number)getList().set(index,new Short(element))).shortValue(); - } - - public ShortList subList(int fromIndex, int toIndex) { - return ListShortList.wrap(getList().subList(fromIndex,toIndex)); - } - - public boolean equals(Object obj) { - if(obj instanceof ShortList) { - ShortList that = (ShortList)obj; - if(this == that) { - return true; - } else if(this.size() != that.size()) { - return false; - } else { - ShortIterator thisiter = iterator(); - ShortIterator thatiter = that.iterator(); - while(thisiter.hasNext()) { - if(thisiter.next() != thatiter.next()) { - return false; - } - } - return true; - } - } else { - return false; - } - } - - public int hashCode() { - return getList().hashCode(); - } - - final protected Collection getCollection() { - return getList(); - } - - abstract protected List getList(); -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/AbstractLongCollectionCollection.java b/src/java/org/apache/commons/collections/primitives/adapters/AbstractLongCollectionCollection.java deleted file mode 100644 index 7dea56486..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/AbstractLongCollectionCollection.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/AbstractLongCollectionCollection.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.lang.reflect.Array; -import java.util.Collection; -import java.util.Iterator; - -import org.apache.commons.collections.primitives.LongCollection; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -abstract class AbstractLongCollectionCollection implements Collection { - - public boolean add(Object element) { - return getLongCollection().add(((Number)element).longValue()); - } - - public boolean addAll(Collection c) { - return getLongCollection().addAll(CollectionLongCollection.wrap(c)); - } - - public void clear() { - getLongCollection().clear(); - } - - public boolean contains(Object element) { - return getLongCollection().contains(((Number)element).longValue()); - } - - - public boolean containsAll(Collection c) { - return getLongCollection().containsAll(CollectionLongCollection.wrap(c)); - } - - public String toString() { - return getLongCollection().toString(); - } - - public boolean isEmpty() { - return getLongCollection().isEmpty(); - } - - /** - * {@link LongIteratorIterator#wrap wraps} the - * {@link org.apache.commons.collections.primitives.LongIterator LongIterator} - * returned by my underlying - * {@link LongCollection LongCollection}, - * if any. - */ - public Iterator iterator() { - return LongIteratorIterator.wrap(getLongCollection().iterator()); - } - - public boolean remove(Object element) { - return getLongCollection().removeElement(((Number)element).longValue()); - } - - public boolean removeAll(Collection c) { - return getLongCollection().removeAll(CollectionLongCollection.wrap(c)); - } - - public boolean retainAll(Collection c) { - return getLongCollection().retainAll(CollectionLongCollection.wrap(c)); - } - - public int size() { - return getLongCollection().size(); - } - - public Object[] toArray() { - long[] a = getLongCollection().toArray(); - Object[] A = new Object[a.length]; - for(int i=0;i a.length) { - A[a.length] = null; - } - - return A; - } - - protected abstract LongCollection getLongCollection(); -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/AbstractLongListList.java b/src/java/org/apache/commons/collections/primitives/adapters/AbstractLongListList.java deleted file mode 100644 index 192bc6671..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/AbstractLongListList.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/AbstractLongListList.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import java.util.ListIterator; - -import org.apache.commons.collections.primitives.LongCollection; -import org.apache.commons.collections.primitives.LongList; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -abstract class AbstractLongListList extends AbstractLongCollectionCollection implements List { - - public void add(int index, Object element) { - getLongList().add(index,((Number)element).longValue()); - } - - public boolean addAll(int index, Collection c) { - return getLongList().addAll(index,CollectionLongCollection.wrap(c)); - } - - public Object get(int index) { - return new Long(getLongList().get(index)); - } - - public int indexOf(Object element) { - return getLongList().indexOf(((Number)element).longValue()); - } - - public int lastIndexOf(Object element) { - return getLongList().lastIndexOf(((Number)element).longValue()); - } - - /** - * {@link LongListIteratorListIterator#wrap wraps} the - * {@link org.apache.commons.collections.primitives.LongListIterator LongListIterator} - * returned by my underlying - * {@link LongList LongList}, - * if any. - */ - public ListIterator listIterator() { - return LongListIteratorListIterator.wrap(getLongList().listIterator()); - } - - /** - * {@link LongListIteratorListIterator#wrap wraps} the - * {@link org.apache.commons.collections.primitives.LongListIterator LongListIterator} - * returned by my underlying - * {@link LongList LongList}, - * if any. - */ - public ListIterator listIterator(int index) { - return LongListIteratorListIterator.wrap(getLongList().listIterator(index)); - } - - public Object remove(int index) { - return new Long(getLongList().removeElementAt(index)); - } - - public Object set(int index, Object element) { - return new Long(getLongList().set(index, ((Number)element).longValue() )); - } - - public List subList(int fromIndex, int toIndex) { - return LongListList.wrap(getLongList().subList(fromIndex,toIndex)); - } - - public boolean equals(Object obj) { - if(obj instanceof List) { - List that = (List)obj; - if(this == that) { - return true; - } else if(this.size() != that.size()) { - return false; - } else { - Iterator thisiter = iterator(); - Iterator thatiter = that.iterator(); - while(thisiter.hasNext()) { - Object thiselt = thisiter.next(); - Object thatelt = thatiter.next(); - if(null == thiselt ? null != thatelt : !(thiselt.equals(thatelt))) { - return false; - } - } - return true; - } - } else { - return false; - } - } - - public int hashCode() { - return getLongList().hashCode(); - } - - protected final LongCollection getLongCollection() { - return getLongList(); - } - - protected abstract LongList getLongList(); - - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/AbstractShortCollectionCollection.java b/src/java/org/apache/commons/collections/primitives/adapters/AbstractShortCollectionCollection.java deleted file mode 100644 index edbf1fd52..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/AbstractShortCollectionCollection.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/AbstractShortCollectionCollection.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.lang.reflect.Array; -import java.util.Collection; -import java.util.Iterator; - -import org.apache.commons.collections.primitives.ShortCollection; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -abstract class AbstractShortCollectionCollection implements Collection { - - public boolean add(Object element) { - return getShortCollection().add(((Number)element).shortValue()); - } - - public boolean addAll(Collection c) { - return getShortCollection().addAll(CollectionShortCollection.wrap(c)); - } - - public void clear() { - getShortCollection().clear(); - } - - public boolean contains(Object element) { - return getShortCollection().contains(((Number)element).shortValue()); - } - - - public boolean containsAll(Collection c) { - return getShortCollection().containsAll(CollectionShortCollection.wrap(c)); - } - - public String toString() { - return getShortCollection().toString(); - } - - public boolean isEmpty() { - return getShortCollection().isEmpty(); - } - - /** - * {@link ShortIteratorIterator#wrap wraps} the - * {@link org.apache.commons.collections.primitives.ShortIterator ShortIterator} - * returned by my underlying - * {@link ShortCollection ShortCollection}, - * if any. - */ - public Iterator iterator() { - return ShortIteratorIterator.wrap(getShortCollection().iterator()); - } - - public boolean remove(Object element) { - return getShortCollection().removeElement(((Number)element).shortValue()); - } - - public boolean removeAll(Collection c) { - return getShortCollection().removeAll(CollectionShortCollection.wrap(c)); - } - - public boolean retainAll(Collection c) { - return getShortCollection().retainAll(CollectionShortCollection.wrap(c)); - } - - public int size() { - return getShortCollection().size(); - } - - public Object[] toArray() { - short[] a = getShortCollection().toArray(); - Object[] A = new Object[a.length]; - for(int i=0;i a.length) { - A[a.length] = null; - } - - return A; - } - - protected abstract ShortCollection getShortCollection(); -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/AbstractShortListList.java b/src/java/org/apache/commons/collections/primitives/adapters/AbstractShortListList.java deleted file mode 100644 index c04bbd80c..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/AbstractShortListList.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/AbstractShortListList.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import java.util.ListIterator; - -import org.apache.commons.collections.primitives.ShortCollection; -import org.apache.commons.collections.primitives.ShortList; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -abstract class AbstractShortListList extends AbstractShortCollectionCollection implements List { - - public void add(int index, Object element) { - getShortList().add(index,((Number)element).shortValue()); - } - - public boolean addAll(int index, Collection c) { - return getShortList().addAll(index,CollectionShortCollection.wrap(c)); - } - - public Object get(int index) { - return new Short(getShortList().get(index)); - } - - public int indexOf(Object element) { - return getShortList().indexOf(((Number)element).shortValue()); - } - - public int lastIndexOf(Object element) { - return getShortList().lastIndexOf(((Number)element).shortValue()); - } - - /** - * {@link ShortListIteratorListIterator#wrap wraps} the - * {@link org.apache.commons.collections.primitives.ShortListIterator ShortListIterator} - * returned by my underlying - * {@link ShortList ShortList}, - * if any. - */ - public ListIterator listIterator() { - return ShortListIteratorListIterator.wrap(getShortList().listIterator()); - } - - /** - * {@link ShortListIteratorListIterator#wrap wraps} the - * {@link org.apache.commons.collections.primitives.ShortListIterator ShortListIterator} - * returned by my underlying - * {@link ShortList ShortList}, - * if any. - */ - public ListIterator listIterator(int index) { - return ShortListIteratorListIterator.wrap(getShortList().listIterator(index)); - } - - public Object remove(int index) { - return new Short(getShortList().removeElementAt(index)); - } - - public Object set(int index, Object element) { - return new Short(getShortList().set(index, ((Number)element).shortValue() )); - } - - public List subList(int fromIndex, int toIndex) { - return ShortListList.wrap(getShortList().subList(fromIndex,toIndex)); - } - - public boolean equals(Object obj) { - if(obj instanceof List) { - List that = (List)obj; - if(this == that) { - return true; - } else if(this.size() != that.size()) { - return false; - } else { - Iterator thisiter = iterator(); - Iterator thatiter = that.iterator(); - while(thisiter.hasNext()) { - Object thiselt = thisiter.next(); - Object thatelt = thatiter.next(); - if(null == thiselt ? null != thatelt : !(thiselt.equals(thatelt))) { - return false; - } - } - return true; - } - } else { - return false; - } - } - - public int hashCode() { - return getShortList().hashCode(); - } - - protected final ShortCollection getShortCollection() { - return getShortList(); - } - - protected abstract ShortList getShortList(); - - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/ByteCollectionCollection.java b/src/java/org/apache/commons/collections/primitives/adapters/ByteCollectionCollection.java deleted file mode 100644 index 63527e858..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/ByteCollectionCollection.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/ByteCollectionCollection.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.Collection; - -import org.apache.commons.collections.primitives.ByteCollection; - -/** - * Adapts an {@link ByteCollection ByteCollection} - * to the {@link java.util.Collection Collection} - * interface. - *

- * This implementation delegates most methods - * to the provided {@link ByteCollection ByteCollection} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -final public class ByteCollectionCollection extends AbstractByteCollectionCollection implements Serializable { - - /** - * Create a {@link Collection Collection} wrapping - * the specified {@link ByteCollection ByteCollection}. When - * the given collection is null, - * returns null. - * - * @param collection the (possibly null) - * {@link ByteCollection ByteCollection} to wrap - * @return a {@link Collection Collection} wrapping the given - * collection, or null when collection is - * null. - */ - public static Collection wrap(ByteCollection collection) { - if(null == collection) { - return null; - } else if(collection instanceof Serializable) { - return new ByteCollectionCollection(collection); - } else { - return new NonSerializableByteCollectionCollection(collection); - } - } - - /** - * Creates a {@link Collection Collection} wrapping - * the specified {@link ByteCollection ByteCollection}. - * @see #wrap - */ - public ByteCollectionCollection(ByteCollection collection) { - _collection = collection; - } - - - protected ByteCollection getByteCollection() { - return _collection; - } - - private ByteCollection _collection = null; -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/ByteIteratorIterator.java b/src/java/org/apache/commons/collections/primitives/adapters/ByteIteratorIterator.java deleted file mode 100644 index 23df35890..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/ByteIteratorIterator.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/ByteIteratorIterator.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Iterator; - -import org.apache.commons.collections.primitives.ByteIterator; - -/** - * Adapts an {@link ByteIterator ByteIterator} to the - * {@link java.util.Iterator Iterator} interface. - *

- * This implementation delegates most methods - * to the provided {@link ByteIterator ByteIterator} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -public class ByteIteratorIterator implements Iterator { - - /** - * Create an {@link Iterator Iterator} wrapping - * the specified {@link ByteIterator ByteIterator}. When - * the given iterator is null, - * returns null. - * - * @param iterator the (possibly null) - * {@link ByteIterator ByteIterator} to wrap - * @return an {@link Iterator Iterator} wrapping the given - * iterator, or null when iterator is - * null. - */ - public static Iterator wrap(ByteIterator iterator) { - return null == iterator ? null : new ByteIteratorIterator(iterator); - } - - /** - * Creates an {@link Iterator Iterator} wrapping - * the specified {@link ByteIterator ByteIterator}. - * @see #wrap - */ - public ByteIteratorIterator(ByteIterator iterator) { - _iterator = iterator; - } - - public boolean hasNext() { - return _iterator.hasNext(); - } - - public Object next() { - return new Byte(_iterator.next()); - } - - public void remove() { - _iterator.remove(); - } - - private ByteIterator _iterator = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/ByteListIteratorListIterator.java b/src/java/org/apache/commons/collections/primitives/adapters/ByteListIteratorListIterator.java deleted file mode 100644 index 665d22355..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/ByteListIteratorListIterator.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/ByteListIteratorListIterator.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.ListIterator; - -import org.apache.commons.collections.primitives.ByteListIterator; - -/** - * Adapts an {@link ByteListIterator ByteListIterator} to the - * {@link ListIterator ListIterator} interface. - *

- * This implementation delegates most methods - * to the provided {@link ByteListIterator ByteListIterator} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -public class ByteListIteratorListIterator implements ListIterator { - - /** - * Create a {@link ListIterator ListIterator} wrapping - * the specified {@link ByteListIterator ByteListIterator}. When - * the given iterator is null, - * returns null. - * - * @param iterator the (possibly null) - * {@link ByteListIterator ByteListIterator} to wrap - * @return a {@link ListIterator ListIterator} wrapping the given - * iterator, or null when iterator is - * null. - */ - public static ListIterator wrap(ByteListIterator iterator) { - return null == iterator ? null : new ByteListIteratorListIterator(iterator); - } - - /** - * Creates an {@link ListIterator ListIterator} wrapping - * the specified {@link ByteListIterator ByteListIterator}. - * @see #wrap - */ - public ByteListIteratorListIterator(ByteListIterator iterator) { - _iterator = iterator; - } - - public int nextIndex() { - return _iterator.nextIndex(); - } - - public int previousIndex() { - return _iterator.previousIndex(); - } - - public boolean hasNext() { - return _iterator.hasNext(); - } - - public boolean hasPrevious() { - return _iterator.hasPrevious(); - } - - public Object next() { - return new Byte(_iterator.next()); - } - - public Object previous() { - return new Byte(_iterator.previous()); - } - - public void add(Object obj) { - _iterator.add(((Number)obj).byteValue()); - } - - public void set(Object obj) { - _iterator.set(((Number)obj).byteValue()); - } - - public void remove() { - _iterator.remove(); - } - - private ByteListIterator _iterator = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/ByteListList.java b/src/java/org/apache/commons/collections/primitives/adapters/ByteListList.java deleted file mode 100644 index fff51736c..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/ByteListList.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/ByteListList.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.List; - -import org.apache.commons.collections.primitives.ByteList; - -/** - * Adapts an {@link ByteList ByteList} to the - * {@link List List} interface. - *

- * This implementation delegates most methods - * to the provided {@link ByteList ByteList} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -final public class ByteListList extends AbstractByteListList implements Serializable { - - /** - * Create a {@link List List} wrapping - * the specified {@link ByteList ByteList}. When - * the given list is null, - * returns null. - * - * @param list the (possibly null) - * {@link ByteList ByteList} to wrap - * @return a {@link List List} wrapping the given - * list, or null when list is - * null. - */ - public static List wrap(ByteList list) { - if(null == list) { - return null; - } else if(list instanceof Serializable) { - return new ByteListList(list); - } else { - return new NonSerializableByteListList(list); - } - } - - /** - * Creates a {@link List List} wrapping - * the specified {@link ByteList ByteList}. - * @see #wrap - */ - public ByteListList(ByteList list) { - _list = list; - } - - protected ByteList getByteList() { - return _list; - } - - private ByteList _list = null; -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/CharCollectionCollection.java b/src/java/org/apache/commons/collections/primitives/adapters/CharCollectionCollection.java deleted file mode 100644 index b6e62136c..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/CharCollectionCollection.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/CharCollectionCollection.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.Collection; - -import org.apache.commons.collections.primitives.CharCollection; - -/** - * Adapts an {@link CharCollection CharCollection} - * to the {@link java.util.Collection Collection} - * interface. - *

- * This implementation delegates most methods - * to the provided {@link CharCollection CharCollection} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -final public class CharCollectionCollection extends AbstractCharCollectionCollection implements Serializable { - - /** - * Create a {@link Collection Collection} wrapping - * the specified {@link CharCollection CharCollection}. When - * the given collection is null, - * returns null. - * - * @param collection the (possibly null) - * {@link CharCollection CharCollection} to wrap - * @return a {@link Collection Collection} wrapping the given - * collection, or null when collection is - * null. - */ - public static Collection wrap(CharCollection collection) { - if(null == collection) { - return null; - } else if(collection instanceof Serializable) { - return new CharCollectionCollection(collection); - } else { - return new NonSerializableCharCollectionCollection(collection); - } - } - - /** - * Creates a {@link Collection Collection} wrapping - * the specified {@link CharCollection CharCollection}. - * @see #wrap - */ - public CharCollectionCollection(CharCollection collection) { - _collection = collection; - } - - - protected CharCollection getCharCollection() { - return _collection; - } - - private CharCollection _collection = null; -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/CharIteratorIterator.java b/src/java/org/apache/commons/collections/primitives/adapters/CharIteratorIterator.java deleted file mode 100644 index 3cf395beb..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/CharIteratorIterator.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/CharIteratorIterator.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Iterator; - -import org.apache.commons.collections.primitives.CharIterator; - -/** - * Adapts an {@link CharIterator CharIterator} to the - * {@link java.util.Iterator Iterator} interface. - *

- * This implementation delegates most methods - * to the provided {@link CharIterator CharIterator} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -public class CharIteratorIterator implements Iterator { - - /** - * Create an {@link Iterator Iterator} wrapping - * the specified {@link CharIterator CharIterator}. When - * the given iterator is null, - * returns null. - * - * @param iterator the (possibly null) - * {@link CharIterator CharIterator} to wrap - * @return an {@link Iterator Iterator} wrapping the given - * iterator, or null when iterator is - * null. - */ - public static Iterator wrap(CharIterator iterator) { - return null == iterator ? null : new CharIteratorIterator(iterator); - } - - /** - * Creates an {@link Iterator Iterator} wrapping - * the specified {@link CharIterator CharIterator}. - * @see #wrap - */ - public CharIteratorIterator(CharIterator iterator) { - _iterator = iterator; - } - - public boolean hasNext() { - return _iterator.hasNext(); - } - - public Object next() { - return new Character(_iterator.next()); - } - - public void remove() { - _iterator.remove(); - } - - private CharIterator _iterator = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/CharListIteratorListIterator.java b/src/java/org/apache/commons/collections/primitives/adapters/CharListIteratorListIterator.java deleted file mode 100644 index e984f1f61..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/CharListIteratorListIterator.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/CharListIteratorListIterator.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.ListIterator; - -import org.apache.commons.collections.primitives.CharListIterator; - -/** - * Adapts an {@link CharListIterator CharListIterator} to the - * {@link ListIterator ListIterator} interface. - *

- * This implementation delegates most methods - * to the provided {@link CharListIterator CharListIterator} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -public class CharListIteratorListIterator implements ListIterator { - - /** - * Create a {@link ListIterator ListIterator} wrapping - * the specified {@link CharListIterator CharListIterator}. When - * the given iterator is null, - * returns null. - * - * @param iterator the (possibly null) - * {@link CharListIterator CharListIterator} to wrap - * @return a {@link ListIterator ListIterator} wrapping the given - * iterator, or null when iterator is - * null. - */ - public static ListIterator wrap(CharListIterator iterator) { - return null == iterator ? null : new CharListIteratorListIterator(iterator); - } - - /** - * Creates an {@link ListIterator ListIterator} wrapping - * the specified {@link CharListIterator CharListIterator}. - * @see #wrap - */ - public CharListIteratorListIterator(CharListIterator iterator) { - _iterator = iterator; - } - - public int nextIndex() { - return _iterator.nextIndex(); - } - - public int previousIndex() { - return _iterator.previousIndex(); - } - - public boolean hasNext() { - return _iterator.hasNext(); - } - - public boolean hasPrevious() { - return _iterator.hasPrevious(); - } - - public Object next() { - return new Character(_iterator.next()); - } - - public Object previous() { - return new Character(_iterator.previous()); - } - - public void add(Object obj) { - _iterator.add(((Character)obj).charValue()); - } - - public void set(Object obj) { - _iterator.set(((Character)obj).charValue()); - } - - public void remove() { - _iterator.remove(); - } - - private CharListIterator _iterator = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/CharListList.java b/src/java/org/apache/commons/collections/primitives/adapters/CharListList.java deleted file mode 100644 index 6830dfd92..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/CharListList.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/CharListList.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.List; - -import org.apache.commons.collections.primitives.CharList; - -/** - * Adapts an {@link CharList CharList} to the - * {@link List List} interface. - *

- * This implementation delegates most methods - * to the provided {@link CharList CharList} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -final public class CharListList extends AbstractCharListList implements Serializable { - - /** - * Create a {@link List List} wrapping - * the specified {@link CharList CharList}. When - * the given list is null, - * returns null. - * - * @param list the (possibly null) - * {@link CharList CharList} to wrap - * @return a {@link List List} wrapping the given - * list, or null when list is - * null. - */ - public static List wrap(CharList list) { - if(null == list) { - return null; - } else if(list instanceof Serializable) { - return new CharListList(list); - } else { - return new NonSerializableCharListList(list); - } - } - - /** - * Creates a {@link List List} wrapping - * the specified {@link CharList CharList}. - * @see #wrap - */ - public CharListList(CharList list) { - _list = list; - } - - protected CharList getCharList() { - return _list; - } - - private CharList _list = null; -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/CollectionByteCollection.java b/src/java/org/apache/commons/collections/primitives/adapters/CollectionByteCollection.java deleted file mode 100644 index 17c723aa2..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/CollectionByteCollection.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/CollectionByteCollection.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.Collection; - -import org.apache.commons.collections.primitives.ByteCollection; - -/** - * Adapts a {@link java.lang.Number Number}-valued - * {@link java.util.Collection Collection} to the - * {@link ByteCollection ByteCollection} interface. - *

- * This implementation delegates most methods - * to the provided {@link Collection Collection} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -final public class CollectionByteCollection extends AbstractCollectionByteCollection implements Serializable { - /** - * Create an {@link ByteCollection ByteCollection} wrapping - * the specified {@link Collection Collection}. When - * the given collection is null, - * returns null. - * - * @param collection the (possibly null) {@link Collection} to wrap - * @return an {@link ByteCollection ByteCollection} wrapping the given - * collection, or null when collection is - * null. - */ - public static ByteCollection wrap(Collection collection) { - if(null == collection) { - return null; - } else if(collection instanceof Serializable) { - return new CollectionByteCollection(collection); - } else { - return new NonSerializableCollectionByteCollection(collection); - } - } - - /** - * Creates an {@link ByteCollection ByteCollection} wrapping - * the specified {@link Collection Collection}. - * @see #wrap - */ - public CollectionByteCollection(Collection collection) { - _collection = collection; - } - - protected Collection getCollection() { - return _collection; - } - - private Collection _collection = null; -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/CollectionCharCollection.java b/src/java/org/apache/commons/collections/primitives/adapters/CollectionCharCollection.java deleted file mode 100644 index 76ccadb96..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/CollectionCharCollection.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/CollectionCharCollection.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.Collection; - -import org.apache.commons.collections.primitives.CharCollection; - -/** - * Adapts a {@link java.lang.Number Number}-valued - * {@link java.util.Collection Collection} to the - * {@link CharCollection CharCollection} interface. - *

- * This implementation delegates most methods - * to the provided {@link Collection Collection} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -final public class CollectionCharCollection extends AbstractCollectionCharCollection implements Serializable { - /** - * Create an {@link CharCollection CharCollection} wrapping - * the specified {@link Collection Collection}. When - * the given collection is null, - * returns null. - * - * @param collection the (possibly null) {@link Collection} to wrap - * @return an {@link CharCollection CharCollection} wrapping the given - * collection, or null when collection is - * null. - */ - public static CharCollection wrap(Collection collection) { - if(null == collection) { - return null; - } else if(collection instanceof Serializable) { - return new CollectionCharCollection(collection); - } else { - return new NonSerializableCollectionCharCollection(collection); - } - } - - /** - * Creates an {@link CharCollection CharCollection} wrapping - * the specified {@link Collection Collection}. - * @see #wrap - */ - public CollectionCharCollection(Collection collection) { - _collection = collection; - } - - protected Collection getCollection() { - return _collection; - } - - private Collection _collection = null; -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/CollectionDoubleCollection.java b/src/java/org/apache/commons/collections/primitives/adapters/CollectionDoubleCollection.java deleted file mode 100644 index 4b79ab271..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/CollectionDoubleCollection.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/CollectionDoubleCollection.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.Collection; - -import org.apache.commons.collections.primitives.DoubleCollection; - -/** - * Adapts a {@link java.lang.Number Number}-valued - * {@link java.util.Collection Collection} to the - * {@link DoubleCollection DoubleCollection} interface. - *

- * This implementation delegates most methods - * to the provided {@link Collection Collection} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -final public class CollectionDoubleCollection extends AbstractCollectionDoubleCollection implements Serializable { - /** - * Create an {@link DoubleCollection DoubleCollection} wrapping - * the specified {@link Collection Collection}. When - * the given collection is null, - * returns null. - * - * @param collection the (possibly null) {@link Collection} to wrap - * @return an {@link DoubleCollection DoubleCollection} wrapping the given - * collection, or null when collection is - * null. - */ - public static DoubleCollection wrap(Collection collection) { - if(null == collection) { - return null; - } else if(collection instanceof Serializable) { - return new CollectionDoubleCollection(collection); - } else { - return new NonSerializableCollectionDoubleCollection(collection); - } - } - - /** - * Creates an {@link DoubleCollection DoubleCollection} wrapping - * the specified {@link Collection Collection}. - * @see #wrap - */ - public CollectionDoubleCollection(Collection collection) { - _collection = collection; - } - - protected Collection getCollection() { - return _collection; - } - - private Collection _collection = null; -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/CollectionFloatCollection.java b/src/java/org/apache/commons/collections/primitives/adapters/CollectionFloatCollection.java deleted file mode 100644 index d966ba678..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/CollectionFloatCollection.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/CollectionFloatCollection.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.Collection; - -import org.apache.commons.collections.primitives.FloatCollection; - -/** - * Adapts a {@link java.lang.Number Number}-valued - * {@link java.util.Collection Collection} to the - * {@link FloatCollection FloatCollection} interface. - *

- * This implementation delegates most methods - * to the provided {@link Collection Collection} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -final public class CollectionFloatCollection extends AbstractCollectionFloatCollection implements Serializable { - /** - * Create an {@link FloatCollection FloatCollection} wrapping - * the specified {@link Collection Collection}. When - * the given collection is null, - * returns null. - * - * @param collection the (possibly null) {@link Collection} to wrap - * @return an {@link FloatCollection FloatCollection} wrapping the given - * collection, or null when collection is - * null. - */ - public static FloatCollection wrap(Collection collection) { - if(null == collection) { - return null; - } else if(collection instanceof Serializable) { - return new CollectionFloatCollection(collection); - } else { - return new NonSerializableCollectionFloatCollection(collection); - } - } - - /** - * Creates an {@link FloatCollection FloatCollection} wrapping - * the specified {@link Collection Collection}. - * @see #wrap - */ - public CollectionFloatCollection(Collection collection) { - _collection = collection; - } - - protected Collection getCollection() { - return _collection; - } - - private Collection _collection = null; -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/CollectionIntCollection.java b/src/java/org/apache/commons/collections/primitives/adapters/CollectionIntCollection.java deleted file mode 100644 index d3472cd4b..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/CollectionIntCollection.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/CollectionIntCollection.java,v 1.9 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.Collection; - -import org.apache.commons.collections.primitives.IntCollection; - -/** - * Adapts a {@link java.lang.Number Number}-valued - * {@link java.util.Collection Collection} to the - * {@link IntCollection IntCollection} interface. - *

- * This implementation delegates most methods - * to the provided {@link Collection Collection} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.9 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -final public class CollectionIntCollection extends AbstractCollectionIntCollection implements Serializable { - /** - * Create an {@link IntCollection IntCollection} wrapping - * the specified {@link Collection Collection}. When - * the given collection is null, - * returns null. - * - * @param collection the (possibly null) {@link Collection} to wrap - * @return an {@link IntCollection IntCollection} wrapping the given - * collection, or null when collection is - * null. - */ - public static IntCollection wrap(Collection collection) { - if(null == collection) { - return null; - } else if(collection instanceof Serializable) { - return new CollectionIntCollection(collection); - } else { - return new NonSerializableCollectionIntCollection(collection); - } - } - - /** - * Creates an {@link IntCollection IntCollection} wrapping - * the specified {@link Collection Collection}. - * @see #wrap - */ - public CollectionIntCollection(Collection collection) { - _collection = collection; - } - - protected Collection getCollection() { - return _collection; - } - - private Collection _collection = null; -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/CollectionLongCollection.java b/src/java/org/apache/commons/collections/primitives/adapters/CollectionLongCollection.java deleted file mode 100644 index f5199cf8e..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/CollectionLongCollection.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/CollectionLongCollection.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.Collection; - -import org.apache.commons.collections.primitives.LongCollection; - -/** - * Adapts a {@link java.lang.Number Number}-valued - * {@link java.util.Collection Collection} to the - * {@link LongCollection LongCollection} interface. - *

- * This implementation delegates most methods - * to the provided {@link Collection Collection} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -final public class CollectionLongCollection extends AbstractCollectionLongCollection implements Serializable { - /** - * Create an {@link LongCollection LongCollection} wrapping - * the specified {@link Collection Collection}. When - * the given collection is null, - * returns null. - * - * @param collection the (possibly null) {@link Collection} to wrap - * @return an {@link LongCollection LongCollection} wrapping the given - * collection, or null when collection is - * null. - */ - public static LongCollection wrap(Collection collection) { - if(null == collection) { - return null; - } else if(collection instanceof Serializable) { - return new CollectionLongCollection(collection); - } else { - return new NonSerializableCollectionLongCollection(collection); - } - } - - /** - * Creates an {@link LongCollection LongCollection} wrapping - * the specified {@link Collection Collection}. - * @see #wrap - */ - public CollectionLongCollection(Collection collection) { - _collection = collection; - } - - protected Collection getCollection() { - return _collection; - } - - private Collection _collection = null; -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/CollectionShortCollection.java b/src/java/org/apache/commons/collections/primitives/adapters/CollectionShortCollection.java deleted file mode 100644 index 8965480b5..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/CollectionShortCollection.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/CollectionShortCollection.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.Collection; - -import org.apache.commons.collections.primitives.ShortCollection; - -/** - * Adapts a {@link java.lang.Number Number}-valued - * {@link java.util.Collection Collection} to the - * {@link ShortCollection ShortCollection} interface. - *

- * This implementation delegates most methods - * to the provided {@link Collection Collection} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -final public class CollectionShortCollection extends AbstractCollectionShortCollection implements Serializable { - /** - * Create an {@link ShortCollection ShortCollection} wrapping - * the specified {@link Collection Collection}. When - * the given collection is null, - * returns null. - * - * @param collection the (possibly null) {@link Collection} to wrap - * @return an {@link ShortCollection ShortCollection} wrapping the given - * collection, or null when collection is - * null. - */ - public static ShortCollection wrap(Collection collection) { - if(null == collection) { - return null; - } else if(collection instanceof Serializable) { - return new CollectionShortCollection(collection); - } else { - return new NonSerializableCollectionShortCollection(collection); - } - } - - /** - * Creates an {@link ShortCollection ShortCollection} wrapping - * the specified {@link Collection Collection}. - * @see #wrap - */ - public CollectionShortCollection(Collection collection) { - _collection = collection; - } - - protected Collection getCollection() { - return _collection; - } - - private Collection _collection = null; -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/DoubleCollectionCollection.java b/src/java/org/apache/commons/collections/primitives/adapters/DoubleCollectionCollection.java deleted file mode 100644 index f9334e86f..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/DoubleCollectionCollection.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/DoubleCollectionCollection.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.Collection; - -import org.apache.commons.collections.primitives.DoubleCollection; - -/** - * Adapts an {@link DoubleCollection DoubleCollection} - * to the {@link java.util.Collection Collection} - * interface. - *

- * This implementation delegates most methods - * to the provided {@link DoubleCollection DoubleCollection} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -final public class DoubleCollectionCollection extends AbstractDoubleCollectionCollection implements Serializable { - - /** - * Create a {@link Collection Collection} wrapping - * the specified {@link DoubleCollection DoubleCollection}. When - * the given collection is null, - * returns null. - * - * @param collection the (possibly null) - * {@link DoubleCollection DoubleCollection} to wrap - * @return a {@link Collection Collection} wrapping the given - * collection, or null when collection is - * null. - */ - public static Collection wrap(DoubleCollection collection) { - if(null == collection) { - return null; - } else if(collection instanceof Serializable) { - return new DoubleCollectionCollection(collection); - } else { - return new NonSerializableDoubleCollectionCollection(collection); - } - } - - /** - * Creates a {@link Collection Collection} wrapping - * the specified {@link DoubleCollection DoubleCollection}. - * @see #wrap - */ - public DoubleCollectionCollection(DoubleCollection collection) { - _collection = collection; - } - - - protected DoubleCollection getDoubleCollection() { - return _collection; - } - - private DoubleCollection _collection = null; -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/DoubleIteratorIterator.java b/src/java/org/apache/commons/collections/primitives/adapters/DoubleIteratorIterator.java deleted file mode 100644 index 7faa5acc5..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/DoubleIteratorIterator.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/DoubleIteratorIterator.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Iterator; - -import org.apache.commons.collections.primitives.DoubleIterator; - -/** - * Adapts an {@link DoubleIterator DoubleIterator} to the - * {@link java.util.Iterator Iterator} interface. - *

- * This implementation delegates most methods - * to the provided {@link DoubleIterator DoubleIterator} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -public class DoubleIteratorIterator implements Iterator { - - /** - * Create an {@link Iterator Iterator} wrapping - * the specified {@link DoubleIterator DoubleIterator}. When - * the given iterator is null, - * returns null. - * - * @param iterator the (possibly null) - * {@link DoubleIterator DoubleIterator} to wrap - * @return an {@link Iterator Iterator} wrapping the given - * iterator, or null when iterator is - * null. - */ - public static Iterator wrap(DoubleIterator iterator) { - return null == iterator ? null : new DoubleIteratorIterator(iterator); - } - - /** - * Creates an {@link Iterator Iterator} wrapping - * the specified {@link DoubleIterator DoubleIterator}. - * @see #wrap - */ - public DoubleIteratorIterator(DoubleIterator iterator) { - _iterator = iterator; - } - - public boolean hasNext() { - return _iterator.hasNext(); - } - - public Object next() { - return new Double(_iterator.next()); - } - - public void remove() { - _iterator.remove(); - } - - private DoubleIterator _iterator = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/DoubleListIteratorListIterator.java b/src/java/org/apache/commons/collections/primitives/adapters/DoubleListIteratorListIterator.java deleted file mode 100644 index 24af1943b..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/DoubleListIteratorListIterator.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/DoubleListIteratorListIterator.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.ListIterator; - -import org.apache.commons.collections.primitives.DoubleListIterator; - -/** - * Adapts an {@link DoubleListIterator DoubleListIterator} to the - * {@link ListIterator ListIterator} interface. - *

- * This implementation delegates most methods - * to the provided {@link DoubleListIterator DoubleListIterator} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -public class DoubleListIteratorListIterator implements ListIterator { - - /** - * Create a {@link ListIterator ListIterator} wrapping - * the specified {@link DoubleListIterator DoubleListIterator}. When - * the given iterator is null, - * returns null. - * - * @param iterator the (possibly null) - * {@link DoubleListIterator DoubleListIterator} to wrap - * @return a {@link ListIterator ListIterator} wrapping the given - * iterator, or null when iterator is - * null. - */ - public static ListIterator wrap(DoubleListIterator iterator) { - return null == iterator ? null : new DoubleListIteratorListIterator(iterator); - } - - /** - * Creates an {@link ListIterator ListIterator} wrapping - * the specified {@link DoubleListIterator DoubleListIterator}. - * @see #wrap - */ - public DoubleListIteratorListIterator(DoubleListIterator iterator) { - _iterator = iterator; - } - - public int nextIndex() { - return _iterator.nextIndex(); - } - - public int previousIndex() { - return _iterator.previousIndex(); - } - - public boolean hasNext() { - return _iterator.hasNext(); - } - - public boolean hasPrevious() { - return _iterator.hasPrevious(); - } - - public Object next() { - return new Double(_iterator.next()); - } - - public Object previous() { - return new Double(_iterator.previous()); - } - - public void add(Object obj) { - _iterator.add(((Number)obj).doubleValue()); - } - - public void set(Object obj) { - _iterator.set(((Number)obj).doubleValue()); - } - - public void remove() { - _iterator.remove(); - } - - private DoubleListIterator _iterator = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/DoubleListList.java b/src/java/org/apache/commons/collections/primitives/adapters/DoubleListList.java deleted file mode 100644 index d5d9ba28d..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/DoubleListList.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/DoubleListList.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.List; - -import org.apache.commons.collections.primitives.DoubleList; - -/** - * Adapts an {@link DoubleList DoubleList} to the - * {@link List List} interface. - *

- * This implementation delegates most methods - * to the provided {@link DoubleList DoubleList} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -final public class DoubleListList extends AbstractDoubleListList implements Serializable { - - /** - * Create a {@link List List} wrapping - * the specified {@link DoubleList DoubleList}. When - * the given list is null, - * returns null. - * - * @param list the (possibly null) - * {@link DoubleList DoubleList} to wrap - * @return a {@link List List} wrapping the given - * list, or null when list is - * null. - */ - public static List wrap(DoubleList list) { - if(null == list) { - return null; - } else if(list instanceof Serializable) { - return new DoubleListList(list); - } else { - return new NonSerializableDoubleListList(list); - } - } - - /** - * Creates a {@link List List} wrapping - * the specified {@link DoubleList DoubleList}. - * @see #wrap - */ - public DoubleListList(DoubleList list) { - _list = list; - } - - protected DoubleList getDoubleList() { - return _list; - } - - private DoubleList _list = null; -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/FloatCollectionCollection.java b/src/java/org/apache/commons/collections/primitives/adapters/FloatCollectionCollection.java deleted file mode 100644 index ee2079892..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/FloatCollectionCollection.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/FloatCollectionCollection.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.Collection; - -import org.apache.commons.collections.primitives.FloatCollection; - -/** - * Adapts an {@link FloatCollection FloatCollection} - * to the {@link java.util.Collection Collection} - * interface. - *

- * This implementation delegates most methods - * to the provided {@link FloatCollection FloatCollection} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -final public class FloatCollectionCollection extends AbstractFloatCollectionCollection implements Serializable { - - /** - * Create a {@link Collection Collection} wrapping - * the specified {@link FloatCollection FloatCollection}. When - * the given collection is null, - * returns null. - * - * @param collection the (possibly null) - * {@link FloatCollection FloatCollection} to wrap - * @return a {@link Collection Collection} wrapping the given - * collection, or null when collection is - * null. - */ - public static Collection wrap(FloatCollection collection) { - if(null == collection) { - return null; - } else if(collection instanceof Serializable) { - return new FloatCollectionCollection(collection); - } else { - return new NonSerializableFloatCollectionCollection(collection); - } - } - - /** - * Creates a {@link Collection Collection} wrapping - * the specified {@link FloatCollection FloatCollection}. - * @see #wrap - */ - public FloatCollectionCollection(FloatCollection collection) { - _collection = collection; - } - - - protected FloatCollection getFloatCollection() { - return _collection; - } - - private FloatCollection _collection = null; -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/FloatIteratorIterator.java b/src/java/org/apache/commons/collections/primitives/adapters/FloatIteratorIterator.java deleted file mode 100644 index fc99256ec..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/FloatIteratorIterator.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/FloatIteratorIterator.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Iterator; - -import org.apache.commons.collections.primitives.FloatIterator; - -/** - * Adapts an {@link FloatIterator FloatIterator} to the - * {@link java.util.Iterator Iterator} interface. - *

- * This implementation delegates most methods - * to the provided {@link FloatIterator FloatIterator} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -public class FloatIteratorIterator implements Iterator { - - /** - * Create an {@link Iterator Iterator} wrapping - * the specified {@link FloatIterator FloatIterator}. When - * the given iterator is null, - * returns null. - * - * @param iterator the (possibly null) - * {@link FloatIterator FloatIterator} to wrap - * @return an {@link Iterator Iterator} wrapping the given - * iterator, or null when iterator is - * null. - */ - public static Iterator wrap(FloatIterator iterator) { - return null == iterator ? null : new FloatIteratorIterator(iterator); - } - - /** - * Creates an {@link Iterator Iterator} wrapping - * the specified {@link FloatIterator FloatIterator}. - * @see #wrap - */ - public FloatIteratorIterator(FloatIterator iterator) { - _iterator = iterator; - } - - public boolean hasNext() { - return _iterator.hasNext(); - } - - public Object next() { - return new Float(_iterator.next()); - } - - public void remove() { - _iterator.remove(); - } - - private FloatIterator _iterator = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/FloatListIteratorListIterator.java b/src/java/org/apache/commons/collections/primitives/adapters/FloatListIteratorListIterator.java deleted file mode 100644 index 0dd13231c..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/FloatListIteratorListIterator.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/FloatListIteratorListIterator.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.ListIterator; - -import org.apache.commons.collections.primitives.FloatListIterator; - -/** - * Adapts an {@link FloatListIterator FloatListIterator} to the - * {@link ListIterator ListIterator} interface. - *

- * This implementation delegates most methods - * to the provided {@link FloatListIterator FloatListIterator} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -public class FloatListIteratorListIterator implements ListIterator { - - /** - * Create a {@link ListIterator ListIterator} wrapping - * the specified {@link FloatListIterator FloatListIterator}. When - * the given iterator is null, - * returns null. - * - * @param iterator the (possibly null) - * {@link FloatListIterator FloatListIterator} to wrap - * @return a {@link ListIterator ListIterator} wrapping the given - * iterator, or null when iterator is - * null. - */ - public static ListIterator wrap(FloatListIterator iterator) { - return null == iterator ? null : new FloatListIteratorListIterator(iterator); - } - - /** - * Creates an {@link ListIterator ListIterator} wrapping - * the specified {@link FloatListIterator FloatListIterator}. - * @see #wrap - */ - public FloatListIteratorListIterator(FloatListIterator iterator) { - _iterator = iterator; - } - - public int nextIndex() { - return _iterator.nextIndex(); - } - - public int previousIndex() { - return _iterator.previousIndex(); - } - - public boolean hasNext() { - return _iterator.hasNext(); - } - - public boolean hasPrevious() { - return _iterator.hasPrevious(); - } - - public Object next() { - return new Float(_iterator.next()); - } - - public Object previous() { - return new Float(_iterator.previous()); - } - - public void add(Object obj) { - _iterator.add(((Number)obj).floatValue()); - } - - public void set(Object obj) { - _iterator.set(((Number)obj).floatValue()); - } - - public void remove() { - _iterator.remove(); - } - - private FloatListIterator _iterator = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/FloatListList.java b/src/java/org/apache/commons/collections/primitives/adapters/FloatListList.java deleted file mode 100644 index 826a5d53c..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/FloatListList.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/FloatListList.java,v 1.3 2003/11/07 20:09:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.List; - -import org.apache.commons.collections.primitives.FloatList; - -/** - * Adapts an {@link FloatList FloatList} to the - * {@link List List} interface. - *

- * This implementation delegates most methods - * to the provided {@link FloatList FloatList} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $ - * @author Rodney Waldhoff - */ -final public class FloatListList extends AbstractFloatListList implements Serializable { - - /** - * Create a {@link List List} wrapping - * the specified {@link FloatList FloatList}. When - * the given list is null, - * returns null. - * - * @param list the (possibly null) - * {@link FloatList FloatList} to wrap - * @return a {@link List List} wrapping the given - * list, or null when list is - * null. - */ - public static List wrap(FloatList list) { - if(null == list) { - return null; - } else if(list instanceof Serializable) { - return new FloatListList(list); - } else { - return new NonSerializableFloatListList(list); - } - } - - /** - * Creates a {@link List List} wrapping - * the specified {@link FloatList FloatList}. - * @see #wrap - */ - public FloatListList(FloatList list) { - _list = list; - } - - protected FloatList getFloatList() { - return _list; - } - - private FloatList _list = null; -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/IntCollectionCollection.java b/src/java/org/apache/commons/collections/primitives/adapters/IntCollectionCollection.java deleted file mode 100644 index fc0125181..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/IntCollectionCollection.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/IntCollectionCollection.java,v 1.8 2003/11/07 20:08:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.Collection; - -import org.apache.commons.collections.primitives.IntCollection; - -/** - * Adapts an {@link IntCollection IntCollection} - * to the {@link java.util.Collection Collection} - * interface. - *

- * This implementation delegates most methods - * to the provided {@link IntCollection IntCollection} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.8 $ $Date: 2003/11/07 20:08:15 $ - * @author Rodney Waldhoff - */ -final public class IntCollectionCollection extends AbstractIntCollectionCollection implements Serializable { - - /** - * Create a {@link Collection Collection} wrapping - * the specified {@link IntCollection IntCollection}. When - * the given collection is null, - * returns null. - * - * @param collection the (possibly null) - * {@link IntCollection IntCollection} to wrap - * @return a {@link Collection Collection} wrapping the given - * collection, or null when collection is - * null. - */ - public static Collection wrap(IntCollection collection) { - if(null == collection) { - return null; - } else if(collection instanceof Serializable) { - return new IntCollectionCollection(collection); - } else { - return new NonSerializableIntCollectionCollection(collection); - } - } - - /** - * Creates a {@link Collection Collection} wrapping - * the specified {@link IntCollection IntCollection}. - * @see #wrap - */ - public IntCollectionCollection(IntCollection collection) { - _collection = collection; - } - - - protected IntCollection getIntCollection() { - return _collection; - } - - private IntCollection _collection = null; -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/IntIteratorIterator.java b/src/java/org/apache/commons/collections/primitives/adapters/IntIteratorIterator.java deleted file mode 100644 index 3aaa3487a..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/IntIteratorIterator.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/IntIteratorIterator.java,v 1.5 2003/11/07 20:08:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Iterator; - -import org.apache.commons.collections.primitives.IntIterator; - -/** - * Adapts an {@link IntIterator IntIterator} to the - * {@link java.util.Iterator Iterator} interface. - *

- * This implementation delegates most methods - * to the provided {@link IntIterator IntIterator} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.5 $ $Date: 2003/11/07 20:08:15 $ - * @author Rodney Waldhoff - */ -public class IntIteratorIterator implements Iterator { - - /** - * Create an {@link Iterator Iterator} wrapping - * the specified {@link IntIterator IntIterator}. When - * the given iterator is null, - * returns null. - * - * @param iterator the (possibly null) - * {@link IntIterator IntIterator} to wrap - * @return an {@link Iterator Iterator} wrapping the given - * iterator, or null when iterator is - * null. - */ - public static Iterator wrap(IntIterator iterator) { - return null == iterator ? null : new IntIteratorIterator(iterator); - } - - /** - * Creates an {@link Iterator Iterator} wrapping - * the specified {@link IntIterator IntIterator}. - * @see #wrap - */ - public IntIteratorIterator(IntIterator iterator) { - _iterator = iterator; - } - - public boolean hasNext() { - return _iterator.hasNext(); - } - - public Object next() { - return new Integer(_iterator.next()); - } - - public void remove() { - _iterator.remove(); - } - - private IntIterator _iterator = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/IntListIteratorListIterator.java b/src/java/org/apache/commons/collections/primitives/adapters/IntListIteratorListIterator.java deleted file mode 100644 index 3f5b51515..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/IntListIteratorListIterator.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/IntListIteratorListIterator.java,v 1.6 2003/11/07 20:08:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.ListIterator; - -import org.apache.commons.collections.primitives.IntListIterator; - -/** - * Adapts an {@link IntListIterator IntListIterator} to the - * {@link ListIterator ListIterator} interface. - *

- * This implementation delegates most methods - * to the provided {@link IntListIterator IntListIterator} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.6 $ $Date: 2003/11/07 20:08:15 $ - * @author Rodney Waldhoff - */ -public class IntListIteratorListIterator implements ListIterator { - - /** - * Create a {@link ListIterator ListIterator} wrapping - * the specified {@link IntListIterator IntListIterator}. When - * the given iterator is null, - * returns null. - * - * @param iterator the (possibly null) - * {@link IntListIterator IntListIterator} to wrap - * @return a {@link ListIterator ListIterator} wrapping the given - * iterator, or null when iterator is - * null. - */ - public static ListIterator wrap(IntListIterator iterator) { - return null == iterator ? null : new IntListIteratorListIterator(iterator); - } - - /** - * Creates an {@link ListIterator ListIterator} wrapping - * the specified {@link IntListIterator IntListIterator}. - * @see #wrap - */ - public IntListIteratorListIterator(IntListIterator iterator) { - _iterator = iterator; - } - - public int nextIndex() { - return _iterator.nextIndex(); - } - - public int previousIndex() { - return _iterator.previousIndex(); - } - - public boolean hasNext() { - return _iterator.hasNext(); - } - - public boolean hasPrevious() { - return _iterator.hasPrevious(); - } - - public Object next() { - return new Integer(_iterator.next()); - } - - public Object previous() { - return new Integer(_iterator.previous()); - } - - public void add(Object obj) { - _iterator.add(((Number)obj).intValue()); - } - - public void set(Object obj) { - _iterator.set(((Number)obj).intValue()); - } - - public void remove() { - _iterator.remove(); - } - - private IntListIterator _iterator = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/IntListList.java b/src/java/org/apache/commons/collections/primitives/adapters/IntListList.java deleted file mode 100644 index dc5cff629..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/IntListList.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/IntListList.java,v 1.8 2003/11/07 20:08:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.List; - -import org.apache.commons.collections.primitives.IntList; - -/** - * Adapts an {@link IntList IntList} to the - * {@link List List} interface. - *

- * This implementation delegates most methods - * to the provided {@link IntList IntList} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.8 $ $Date: 2003/11/07 20:08:15 $ - * @author Rodney Waldhoff - */ -final public class IntListList extends AbstractIntListList implements Serializable { - - /** - * Create a {@link List List} wrapping - * the specified {@link IntList IntList}. When - * the given list is null, - * returns null. - * - * @param list the (possibly null) - * {@link IntList IntList} to wrap - * @return a {@link List List} wrapping the given - * list, or null when list is - * null. - */ - public static List wrap(IntList list) { - if(null == list) { - return null; - } else if(list instanceof Serializable) { - return new IntListList(list); - } else { - return new NonSerializableIntListList(list); - } - } - - /** - * Creates a {@link List List} wrapping - * the specified {@link IntList IntList}. - * @see #wrap - */ - public IntListList(IntList list) { - _list = list; - } - - protected IntList getIntList() { - return _list; - } - - private IntList _list = null; -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/IteratorByteIterator.java b/src/java/org/apache/commons/collections/primitives/adapters/IteratorByteIterator.java deleted file mode 100644 index e2e57a80c..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/IteratorByteIterator.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/IteratorByteIterator.java,v 1.3 2003/11/07 20:08:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Iterator; - -import org.apache.commons.collections.primitives.ByteIterator; - -/** - * Adapts a {@link java.lang.Number Number}-valued - * {@link Iterator Iterator} - * to the {@link ByteIterator ByteIterator} - * interface. - *

- * This implementation delegates most methods - * to the provided {@link Iterator Iterator} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:08:15 $ - * @author Rodney Waldhoff - */ -public class IteratorByteIterator implements ByteIterator { - - /** - * Create an {@link ByteIterator ByteIterator} wrapping - * the specified {@link Iterator Iterator}. When - * the given iterator is null, - * returns null. - * - * @param iterator the (possibly null) - * {@link Iterator Iterator} to wrap - * @return an {@link ByteIterator ByteIterator} wrapping the given - * iterator, or null when iterator is - * null. - */ - public static ByteIterator wrap(Iterator iterator) { - return null == iterator ? null : new IteratorByteIterator(iterator); - } - - /** - * Creates an {@link ByteIterator ByteIterator} wrapping - * the specified {@link Iterator Iterator}. - * @see #wrap - */ - public IteratorByteIterator(Iterator iterator) { - _iterator = iterator; - } - - public boolean hasNext() { - return _iterator.hasNext(); - } - - public byte next() { - return ((Number)(_iterator.next())).byteValue(); - } - - public void remove() { - _iterator.remove(); - } - - private Iterator _iterator = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/IteratorCharIterator.java b/src/java/org/apache/commons/collections/primitives/adapters/IteratorCharIterator.java deleted file mode 100644 index ba27b8042..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/IteratorCharIterator.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/IteratorCharIterator.java,v 1.3 2003/11/07 20:08:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Iterator; - -import org.apache.commons.collections.primitives.CharIterator; - -/** - * Adapts a {@link java.lang.Number Number}-valued - * {@link Iterator Iterator} - * to the {@link CharIterator CharIterator} - * interface. - *

- * This implementation delegates most methods - * to the provided {@link Iterator Iterator} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:08:15 $ - * @author Rodney Waldhoff - */ -public class IteratorCharIterator implements CharIterator { - - /** - * Create an {@link CharIterator CharIterator} wrapping - * the specified {@link Iterator Iterator}. When - * the given iterator is null, - * returns null. - * - * @param iterator the (possibly null) - * {@link Iterator Iterator} to wrap - * @return an {@link CharIterator CharIterator} wrapping the given - * iterator, or null when iterator is - * null. - */ - public static CharIterator wrap(Iterator iterator) { - return null == iterator ? null : new IteratorCharIterator(iterator); - } - - /** - * Creates an {@link CharIterator CharIterator} wrapping - * the specified {@link Iterator Iterator}. - * @see #wrap - */ - public IteratorCharIterator(Iterator iterator) { - _iterator = iterator; - } - - public boolean hasNext() { - return _iterator.hasNext(); - } - - public char next() { - return ((Character)(_iterator.next())).charValue(); - } - - public void remove() { - _iterator.remove(); - } - - private Iterator _iterator = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/IteratorDoubleIterator.java b/src/java/org/apache/commons/collections/primitives/adapters/IteratorDoubleIterator.java deleted file mode 100644 index 849c73ff9..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/IteratorDoubleIterator.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/IteratorDoubleIterator.java,v 1.3 2003/11/07 20:08:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Iterator; - -import org.apache.commons.collections.primitives.DoubleIterator; - -/** - * Adapts a {@link java.lang.Number Number}-valued - * {@link Iterator Iterator} - * to the {@link DoubleIterator DoubleIterator} - * interface. - *

- * This implementation delegates most methods - * to the provided {@link Iterator Iterator} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:08:15 $ - * @author Rodney Waldhoff - */ -public class IteratorDoubleIterator implements DoubleIterator { - - /** - * Create an {@link DoubleIterator DoubleIterator} wrapping - * the specified {@link Iterator Iterator}. When - * the given iterator is null, - * returns null. - * - * @param iterator the (possibly null) - * {@link Iterator Iterator} to wrap - * @return an {@link DoubleIterator DoubleIterator} wrapping the given - * iterator, or null when iterator is - * null. - */ - public static DoubleIterator wrap(Iterator iterator) { - return null == iterator ? null : new IteratorDoubleIterator(iterator); - } - - /** - * Creates an {@link DoubleIterator DoubleIterator} wrapping - * the specified {@link Iterator Iterator}. - * @see #wrap - */ - public IteratorDoubleIterator(Iterator iterator) { - _iterator = iterator; - } - - public boolean hasNext() { - return _iterator.hasNext(); - } - - public double next() { - return ((Number)(_iterator.next())).doubleValue(); - } - - public void remove() { - _iterator.remove(); - } - - private Iterator _iterator = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/IteratorFloatIterator.java b/src/java/org/apache/commons/collections/primitives/adapters/IteratorFloatIterator.java deleted file mode 100644 index dd0a4dc6d..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/IteratorFloatIterator.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/IteratorFloatIterator.java,v 1.3 2003/11/07 20:08:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Iterator; - -import org.apache.commons.collections.primitives.FloatIterator; - -/** - * Adapts a {@link java.lang.Number Number}-valued - * {@link Iterator Iterator} - * to the {@link FloatIterator FloatIterator} - * interface. - *

- * This implementation delegates most methods - * to the provided {@link Iterator Iterator} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:08:15 $ - * @author Rodney Waldhoff - */ -public class IteratorFloatIterator implements FloatIterator { - - /** - * Create an {@link FloatIterator FloatIterator} wrapping - * the specified {@link Iterator Iterator}. When - * the given iterator is null, - * returns null. - * - * @param iterator the (possibly null) - * {@link Iterator Iterator} to wrap - * @return an {@link FloatIterator FloatIterator} wrapping the given - * iterator, or null when iterator is - * null. - */ - public static FloatIterator wrap(Iterator iterator) { - return null == iterator ? null : new IteratorFloatIterator(iterator); - } - - /** - * Creates an {@link FloatIterator FloatIterator} wrapping - * the specified {@link Iterator Iterator}. - * @see #wrap - */ - public IteratorFloatIterator(Iterator iterator) { - _iterator = iterator; - } - - public boolean hasNext() { - return _iterator.hasNext(); - } - - public float next() { - return ((Number)(_iterator.next())).floatValue(); - } - - public void remove() { - _iterator.remove(); - } - - private Iterator _iterator = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/IteratorIntIterator.java b/src/java/org/apache/commons/collections/primitives/adapters/IteratorIntIterator.java deleted file mode 100644 index 50e0273a2..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/IteratorIntIterator.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/IteratorIntIterator.java,v 1.5 2003/11/07 20:08:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Iterator; - -import org.apache.commons.collections.primitives.IntIterator; - -/** - * Adapts a {@link java.lang.Number Number}-valued - * {@link Iterator Iterator} - * to the {@link IntIterator IntIterator} - * interface. - *

- * This implementation delegates most methods - * to the provided {@link Iterator Iterator} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.5 $ $Date: 2003/11/07 20:08:15 $ - * @author Rodney Waldhoff - */ -public class IteratorIntIterator implements IntIterator { - - /** - * Create an {@link IntIterator IntIterator} wrapping - * the specified {@link Iterator Iterator}. When - * the given iterator is null, - * returns null. - * - * @param iterator the (possibly null) - * {@link Iterator Iterator} to wrap - * @return an {@link IntIterator IntIterator} wrapping the given - * iterator, or null when iterator is - * null. - */ - public static IntIterator wrap(Iterator iterator) { - return null == iterator ? null : new IteratorIntIterator(iterator); - } - - /** - * Creates an {@link IntIterator IntIterator} wrapping - * the specified {@link Iterator Iterator}. - * @see #wrap - */ - public IteratorIntIterator(Iterator iterator) { - _iterator = iterator; - } - - public boolean hasNext() { - return _iterator.hasNext(); - } - - public int next() { - return ((Number)(_iterator.next())).intValue(); - } - - public void remove() { - _iterator.remove(); - } - - private Iterator _iterator = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/IteratorLongIterator.java b/src/java/org/apache/commons/collections/primitives/adapters/IteratorLongIterator.java deleted file mode 100644 index d73dcc58e..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/IteratorLongIterator.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/IteratorLongIterator.java,v 1.3 2003/11/07 20:08:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Iterator; - -import org.apache.commons.collections.primitives.LongIterator; - -/** - * Adapts a {@link java.lang.Number Number}-valued - * {@link Iterator Iterator} - * to the {@link LongIterator LongIterator} - * interface. - *

- * This implementation delegates most methods - * to the provided {@link Iterator Iterator} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:08:15 $ - * @author Rodney Waldhoff - */ -public class IteratorLongIterator implements LongIterator { - - /** - * Create an {@link LongIterator LongIterator} wrapping - * the specified {@link Iterator Iterator}. When - * the given iterator is null, - * returns null. - * - * @param iterator the (possibly null) - * {@link Iterator Iterator} to wrap - * @return an {@link LongIterator LongIterator} wrapping the given - * iterator, or null when iterator is - * null. - */ - public static LongIterator wrap(Iterator iterator) { - return null == iterator ? null : new IteratorLongIterator(iterator); - } - - /** - * Creates an {@link LongIterator LongIterator} wrapping - * the specified {@link Iterator Iterator}. - * @see #wrap - */ - public IteratorLongIterator(Iterator iterator) { - _iterator = iterator; - } - - public boolean hasNext() { - return _iterator.hasNext(); - } - - public long next() { - return ((Number)(_iterator.next())).longValue(); - } - - public void remove() { - _iterator.remove(); - } - - private Iterator _iterator = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/IteratorShortIterator.java b/src/java/org/apache/commons/collections/primitives/adapters/IteratorShortIterator.java deleted file mode 100644 index 5f8f8e956..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/IteratorShortIterator.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/IteratorShortIterator.java,v 1.3 2003/11/07 20:08:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Iterator; - -import org.apache.commons.collections.primitives.ShortIterator; - -/** - * Adapts a {@link java.lang.Number Number}-valued - * {@link Iterator Iterator} - * to the {@link ShortIterator ShortIterator} - * interface. - *

- * This implementation delegates most methods - * to the provided {@link Iterator Iterator} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:08:15 $ - * @author Rodney Waldhoff - */ -public class IteratorShortIterator implements ShortIterator { - - /** - * Create an {@link ShortIterator ShortIterator} wrapping - * the specified {@link Iterator Iterator}. When - * the given iterator is null, - * returns null. - * - * @param iterator the (possibly null) - * {@link Iterator Iterator} to wrap - * @return an {@link ShortIterator ShortIterator} wrapping the given - * iterator, or null when iterator is - * null. - */ - public static ShortIterator wrap(Iterator iterator) { - return null == iterator ? null : new IteratorShortIterator(iterator); - } - - /** - * Creates an {@link ShortIterator ShortIterator} wrapping - * the specified {@link Iterator Iterator}. - * @see #wrap - */ - public IteratorShortIterator(Iterator iterator) { - _iterator = iterator; - } - - public boolean hasNext() { - return _iterator.hasNext(); - } - - public short next() { - return ((Number)(_iterator.next())).shortValue(); - } - - public void remove() { - _iterator.remove(); - } - - private Iterator _iterator = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/ListByteList.java b/src/java/org/apache/commons/collections/primitives/adapters/ListByteList.java deleted file mode 100644 index 38a005930..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/ListByteList.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/ListByteList.java,v 1.3 2003/11/07 20:08:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.List; - -import org.apache.commons.collections.primitives.ByteList; - -/** - * Adapts a {@link Number}-valued {@link List List} - * to the {@link ByteList ByteList} interface. - *

- * This implementation delegates most methods - * to the provided {@link List List} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:08:15 $ - * @author Rodney Waldhoff - */ -public class ListByteList extends AbstractListByteList implements Serializable { - - /** - * Create an {@link ByteList ByteList} wrapping - * the specified {@link List List}. When - * the given list is null, - * returns null. - * - * @param list the (possibly null) - * {@link List List} to wrap - * @return a {@link ByteList ByteList} wrapping the given - * list, or null when list is - * null. - */ - public static ByteList wrap(List list) { - if(null == list) { - return null; - } else if(list instanceof Serializable) { - return new ListByteList(list); - } else { - return new NonSerializableListByteList(list); - } - } - - /** - * Creates an {@link ByteList ByteList} wrapping - * the specified {@link List List}. - * @see #wrap - */ - public ListByteList(List list) { - _list = list; - } - - protected List getList() { - return _list; - } - - private List _list = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/ListCharList.java b/src/java/org/apache/commons/collections/primitives/adapters/ListCharList.java deleted file mode 100644 index 5a0a9cb96..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/ListCharList.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/ListCharList.java,v 1.4 2003/11/07 20:08:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.List; - -import org.apache.commons.collections.primitives.CharList; - -/** - * Adapts a {@link Number}-valued {@link List List} - * to the {@link CharList CharList} interface. - *

- * This implementation delegates most methods - * to the provided {@link List List} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.4 $ $Date: 2003/11/07 20:08:15 $ - * @author Rodney Waldhoff - */ -public class ListCharList extends AbstractListCharList implements Serializable { - - /** - * Create an {@link CharList CharList} wrapping - * the specified {@link List List}. When - * the given list is null, - * returns null. - * - * @param list the (possibly null) - * {@link List List} to wrap - * @return a {@link CharList CharList} wrapping the given - * list, or null when list is - * null. - */ - public static CharList wrap(List list) { - if(null == list) { - return null; - } else if(list instanceof Serializable) { - return new ListCharList(list); - } else { - return new NonSerializableListCharList(list); - } - } - - /** - * Creates an {@link CharList CharList} wrapping - * the specified {@link List List}. - * @see #wrap - */ - public ListCharList(List list) { - _list = list; - } - - public String toString() { - // could cache these like StringBuffer does - return new String(toArray()); - } - - protected List getList() { - return _list; - } - - private List _list = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/ListDoubleList.java b/src/java/org/apache/commons/collections/primitives/adapters/ListDoubleList.java deleted file mode 100644 index 6e3762e9f..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/ListDoubleList.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/ListDoubleList.java,v 1.3 2003/11/07 20:08:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.List; - -import org.apache.commons.collections.primitives.DoubleList; - -/** - * Adapts a {@link Number}-valued {@link List List} - * to the {@link DoubleList DoubleList} interface. - *

- * This implementation delegates most methods - * to the provided {@link List List} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:08:15 $ - * @author Rodney Waldhoff - */ -public class ListDoubleList extends AbstractListDoubleList implements Serializable { - - /** - * Create an {@link DoubleList DoubleList} wrapping - * the specified {@link List List}. When - * the given list is null, - * returns null. - * - * @param list the (possibly null) - * {@link List List} to wrap - * @return a {@link DoubleList DoubleList} wrapping the given - * list, or null when list is - * null. - */ - public static DoubleList wrap(List list) { - if(null == list) { - return null; - } else if(list instanceof Serializable) { - return new ListDoubleList(list); - } else { - return new NonSerializableListDoubleList(list); - } - } - - /** - * Creates an {@link DoubleList DoubleList} wrapping - * the specified {@link List List}. - * @see #wrap - */ - public ListDoubleList(List list) { - _list = list; - } - - protected List getList() { - return _list; - } - - private List _list = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/ListFloatList.java b/src/java/org/apache/commons/collections/primitives/adapters/ListFloatList.java deleted file mode 100644 index 551f03a1f..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/ListFloatList.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/ListFloatList.java,v 1.3 2003/11/07 20:08:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.List; - -import org.apache.commons.collections.primitives.FloatList; - -/** - * Adapts a {@link Number}-valued {@link List List} - * to the {@link FloatList FloatList} interface. - *

- * This implementation delegates most methods - * to the provided {@link List List} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:08:15 $ - * @author Rodney Waldhoff - */ -public class ListFloatList extends AbstractListFloatList implements Serializable { - - /** - * Create an {@link FloatList FloatList} wrapping - * the specified {@link List List}. When - * the given list is null, - * returns null. - * - * @param list the (possibly null) - * {@link List List} to wrap - * @return a {@link FloatList FloatList} wrapping the given - * list, or null when list is - * null. - */ - public static FloatList wrap(List list) { - if(null == list) { - return null; - } else if(list instanceof Serializable) { - return new ListFloatList(list); - } else { - return new NonSerializableListFloatList(list); - } - } - - /** - * Creates an {@link FloatList FloatList} wrapping - * the specified {@link List List}. - * @see #wrap - */ - public ListFloatList(List list) { - _list = list; - } - - protected List getList() { - return _list; - } - - private List _list = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/ListIntList.java b/src/java/org/apache/commons/collections/primitives/adapters/ListIntList.java deleted file mode 100644 index f49ad069c..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/ListIntList.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/ListIntList.java,v 1.9 2003/11/07 20:08:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.List; - -import org.apache.commons.collections.primitives.IntList; - -/** - * Adapts a {@link Number}-valued {@link List List} - * to the {@link IntList IntList} interface. - *

- * This implementation delegates most methods - * to the provided {@link List List} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.9 $ $Date: 2003/11/07 20:08:15 $ - * @author Rodney Waldhoff - */ -public class ListIntList extends AbstractListIntList implements Serializable { - - /** - * Create an {@link IntList IntList} wrapping - * the specified {@link List List}. When - * the given list is null, - * returns null. - * - * @param list the (possibly null) - * {@link List List} to wrap - * @return a {@link IntList IntList} wrapping the given - * list, or null when list is - * null. - */ - public static IntList wrap(List list) { - if(null == list) { - return null; - } else if(list instanceof Serializable) { - return new ListIntList(list); - } else { - return new NonSerializableListIntList(list); - } - } - - /** - * Creates an {@link IntList IntList} wrapping - * the specified {@link List List}. - * @see #wrap - */ - public ListIntList(List list) { - _list = list; - } - - protected List getList() { - return _list; - } - - private List _list = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/ListIteratorByteListIterator.java b/src/java/org/apache/commons/collections/primitives/adapters/ListIteratorByteListIterator.java deleted file mode 100644 index e4848ba39..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/ListIteratorByteListIterator.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/ListIteratorByteListIterator.java,v 1.3 2003/11/07 20:08:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.ListIterator; - -import org.apache.commons.collections.primitives.ByteListIterator; - -/** - * Adapts a {@link Number}-valued {@link ListIterator ListIterator} - * to the {@link ByteListIterator ByteListIterator} interface. - *

- * This implementation delegates most methods - * to the provided {@link ByteListIterator ByteListIterator} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:08:15 $ - * @author Rodney Waldhoff - */ -public class ListIteratorByteListIterator implements ByteListIterator { - - /** - * Create an {@link ByteListIterator ByteListIterator} wrapping - * the specified {@link ListIterator ListIterator}. When - * the given iterator is null, - * returns null. - * - * @param iterator the (possibly null) - * {@link ListIterator ListIterator} to wrap - * @return an {@link ByteListIterator ByteListIterator} wrapping the given - * iterator, or null when iterator is - * null. - */ - public static ByteListIterator wrap(ListIterator iterator) { - return null == iterator ? null : new ListIteratorByteListIterator(iterator); - } - - /** - * Creates an {@link ByteListIterator ByteListIterator} wrapping - * the specified {@link ListIterator ListIterator}. - * @see #wrap - */ - public ListIteratorByteListIterator(ListIterator iterator) { - _iterator = iterator; - } - - public int nextIndex() { - return _iterator.nextIndex(); - } - - public int previousIndex() { - return _iterator.previousIndex(); - } - - public boolean hasNext() { - return _iterator.hasNext(); - } - - public boolean hasPrevious() { - return _iterator.hasPrevious(); - } - - public byte next() { - return ((Number)_iterator.next()).byteValue(); - } - - public byte previous() { - return ((Number)_iterator.previous()).byteValue(); - } - - public void add(byte element) { - _iterator.add(new Byte(element)); - } - - public void set(byte element) { - _iterator.set(new Byte(element)); - } - - public void remove() { - _iterator.remove(); - } - - private ListIterator _iterator = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/ListIteratorCharListIterator.java b/src/java/org/apache/commons/collections/primitives/adapters/ListIteratorCharListIterator.java deleted file mode 100644 index 807e646e3..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/ListIteratorCharListIterator.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/ListIteratorCharListIterator.java,v 1.3 2003/11/07 20:08:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.ListIterator; - -import org.apache.commons.collections.primitives.CharListIterator; - -/** - * Adapts a {@link Number}-valued {@link ListIterator ListIterator} - * to the {@link CharListIterator CharListIterator} interface. - *

- * This implementation delegates most methods - * to the provided {@link CharListIterator CharListIterator} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:08:15 $ - * @author Rodney Waldhoff - */ -public class ListIteratorCharListIterator implements CharListIterator { - - /** - * Create an {@link CharListIterator CharListIterator} wrapping - * the specified {@link ListIterator ListIterator}. When - * the given iterator is null, - * returns null. - * - * @param iterator the (possibly null) - * {@link ListIterator ListIterator} to wrap - * @return an {@link CharListIterator CharListIterator} wrapping the given - * iterator, or null when iterator is - * null. - */ - public static CharListIterator wrap(ListIterator iterator) { - return null == iterator ? null : new ListIteratorCharListIterator(iterator); - } - - /** - * Creates an {@link CharListIterator CharListIterator} wrapping - * the specified {@link ListIterator ListIterator}. - * @see #wrap - */ - public ListIteratorCharListIterator(ListIterator iterator) { - _iterator = iterator; - } - - public int nextIndex() { - return _iterator.nextIndex(); - } - - public int previousIndex() { - return _iterator.previousIndex(); - } - - public boolean hasNext() { - return _iterator.hasNext(); - } - - public boolean hasPrevious() { - return _iterator.hasPrevious(); - } - - public char next() { - return ((Character)_iterator.next()).charValue(); - } - - public char previous() { - return ((Character)_iterator.previous()).charValue(); - } - - public void add(char element) { - _iterator.add(new Character(element)); - } - - public void set(char element) { - _iterator.set(new Character(element)); - } - - public void remove() { - _iterator.remove(); - } - - private ListIterator _iterator = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/ListIteratorDoubleListIterator.java b/src/java/org/apache/commons/collections/primitives/adapters/ListIteratorDoubleListIterator.java deleted file mode 100644 index a55ccf400..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/ListIteratorDoubleListIterator.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/ListIteratorDoubleListIterator.java,v 1.3 2003/11/07 20:08:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.ListIterator; - -import org.apache.commons.collections.primitives.DoubleListIterator; - -/** - * Adapts a {@link Number}-valued {@link ListIterator ListIterator} - * to the {@link DoubleListIterator DoubleListIterator} interface. - *

- * This implementation delegates most methods - * to the provided {@link DoubleListIterator DoubleListIterator} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:08:15 $ - * @author Rodney Waldhoff - */ -public class ListIteratorDoubleListIterator implements DoubleListIterator { - - /** - * Create an {@link DoubleListIterator DoubleListIterator} wrapping - * the specified {@link ListIterator ListIterator}. When - * the given iterator is null, - * returns null. - * - * @param iterator the (possibly null) - * {@link ListIterator ListIterator} to wrap - * @return an {@link DoubleListIterator DoubleListIterator} wrapping the given - * iterator, or null when iterator is - * null. - */ - public static DoubleListIterator wrap(ListIterator iterator) { - return null == iterator ? null : new ListIteratorDoubleListIterator(iterator); - } - - /** - * Creates an {@link DoubleListIterator DoubleListIterator} wrapping - * the specified {@link ListIterator ListIterator}. - * @see #wrap - */ - public ListIteratorDoubleListIterator(ListIterator iterator) { - _iterator = iterator; - } - - public int nextIndex() { - return _iterator.nextIndex(); - } - - public int previousIndex() { - return _iterator.previousIndex(); - } - - public boolean hasNext() { - return _iterator.hasNext(); - } - - public boolean hasPrevious() { - return _iterator.hasPrevious(); - } - - public double next() { - return ((Number)_iterator.next()).doubleValue(); - } - - public double previous() { - return ((Number)_iterator.previous()).doubleValue(); - } - - public void add(double element) { - _iterator.add(new Double(element)); - } - - public void set(double element) { - _iterator.set(new Double(element)); - } - - public void remove() { - _iterator.remove(); - } - - private ListIterator _iterator = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/ListIteratorFloatListIterator.java b/src/java/org/apache/commons/collections/primitives/adapters/ListIteratorFloatListIterator.java deleted file mode 100644 index 09f0c628b..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/ListIteratorFloatListIterator.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/ListIteratorFloatListIterator.java,v 1.3 2003/11/07 20:08:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.ListIterator; - -import org.apache.commons.collections.primitives.FloatListIterator; - -/** - * Adapts a {@link Number}-valued {@link ListIterator ListIterator} - * to the {@link FloatListIterator FloatListIterator} interface. - *

- * This implementation delegates most methods - * to the provided {@link FloatListIterator FloatListIterator} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:08:15 $ - * @author Rodney Waldhoff - */ -public class ListIteratorFloatListIterator implements FloatListIterator { - - /** - * Create an {@link FloatListIterator FloatListIterator} wrapping - * the specified {@link ListIterator ListIterator}. When - * the given iterator is null, - * returns null. - * - * @param iterator the (possibly null) - * {@link ListIterator ListIterator} to wrap - * @return an {@link FloatListIterator FloatListIterator} wrapping the given - * iterator, or null when iterator is - * null. - */ - public static FloatListIterator wrap(ListIterator iterator) { - return null == iterator ? null : new ListIteratorFloatListIterator(iterator); - } - - /** - * Creates an {@link FloatListIterator FloatListIterator} wrapping - * the specified {@link ListIterator ListIterator}. - * @see #wrap - */ - public ListIteratorFloatListIterator(ListIterator iterator) { - _iterator = iterator; - } - - public int nextIndex() { - return _iterator.nextIndex(); - } - - public int previousIndex() { - return _iterator.previousIndex(); - } - - public boolean hasNext() { - return _iterator.hasNext(); - } - - public boolean hasPrevious() { - return _iterator.hasPrevious(); - } - - public float next() { - return ((Number)_iterator.next()).floatValue(); - } - - public float previous() { - return ((Number)_iterator.previous()).floatValue(); - } - - public void add(float element) { - _iterator.add(new Float(element)); - } - - public void set(float element) { - _iterator.set(new Float(element)); - } - - public void remove() { - _iterator.remove(); - } - - private ListIterator _iterator = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/ListIteratorIntListIterator.java b/src/java/org/apache/commons/collections/primitives/adapters/ListIteratorIntListIterator.java deleted file mode 100644 index c51a1344b..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/ListIteratorIntListIterator.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/ListIteratorIntListIterator.java,v 1.6 2003/11/07 20:08:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.ListIterator; - -import org.apache.commons.collections.primitives.IntListIterator; - -/** - * Adapts a {@link Number}-valued {@link ListIterator ListIterator} - * to the {@link IntListIterator IntListIterator} interface. - *

- * This implementation delegates most methods - * to the provided {@link IntListIterator IntListIterator} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.6 $ $Date: 2003/11/07 20:08:15 $ - * @author Rodney Waldhoff - */ -public class ListIteratorIntListIterator implements IntListIterator { - - /** - * Create an {@link IntListIterator IntListIterator} wrapping - * the specified {@link ListIterator ListIterator}. When - * the given iterator is null, - * returns null. - * - * @param iterator the (possibly null) - * {@link ListIterator ListIterator} to wrap - * @return an {@link IntListIterator IntListIterator} wrapping the given - * iterator, or null when iterator is - * null. - */ - public static IntListIterator wrap(ListIterator iterator) { - return null == iterator ? null : new ListIteratorIntListIterator(iterator); - } - - /** - * Creates an {@link IntListIterator IntListIterator} wrapping - * the specified {@link ListIterator ListIterator}. - * @see #wrap - */ - public ListIteratorIntListIterator(ListIterator iterator) { - _iterator = iterator; - } - - public int nextIndex() { - return _iterator.nextIndex(); - } - - public int previousIndex() { - return _iterator.previousIndex(); - } - - public boolean hasNext() { - return _iterator.hasNext(); - } - - public boolean hasPrevious() { - return _iterator.hasPrevious(); - } - - public int next() { - return ((Number)_iterator.next()).intValue(); - } - - public int previous() { - return ((Number)_iterator.previous()).intValue(); - } - - public void add(int element) { - _iterator.add(new Integer(element)); - } - - public void set(int element) { - _iterator.set(new Integer(element)); - } - - public void remove() { - _iterator.remove(); - } - - private ListIterator _iterator = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/ListIteratorLongListIterator.java b/src/java/org/apache/commons/collections/primitives/adapters/ListIteratorLongListIterator.java deleted file mode 100644 index df035ca36..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/ListIteratorLongListIterator.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/ListIteratorLongListIterator.java,v 1.3 2003/11/07 20:08:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.ListIterator; - -import org.apache.commons.collections.primitives.LongListIterator; - -/** - * Adapts a {@link Number}-valued {@link ListIterator ListIterator} - * to the {@link LongListIterator LongListIterator} interface. - *

- * This implementation delegates most methods - * to the provided {@link LongListIterator LongListIterator} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:08:15 $ - * @author Rodney Waldhoff - */ -public class ListIteratorLongListIterator implements LongListIterator { - - /** - * Create an {@link LongListIterator LongListIterator} wrapping - * the specified {@link ListIterator ListIterator}. When - * the given iterator is null, - * returns null. - * - * @param iterator the (possibly null) - * {@link ListIterator ListIterator} to wrap - * @return an {@link LongListIterator LongListIterator} wrapping the given - * iterator, or null when iterator is - * null. - */ - public static LongListIterator wrap(ListIterator iterator) { - return null == iterator ? null : new ListIteratorLongListIterator(iterator); - } - - /** - * Creates an {@link LongListIterator LongListIterator} wrapping - * the specified {@link ListIterator ListIterator}. - * @see #wrap - */ - public ListIteratorLongListIterator(ListIterator iterator) { - _iterator = iterator; - } - - public int nextIndex() { - return _iterator.nextIndex(); - } - - public int previousIndex() { - return _iterator.previousIndex(); - } - - public boolean hasNext() { - return _iterator.hasNext(); - } - - public boolean hasPrevious() { - return _iterator.hasPrevious(); - } - - public long next() { - return ((Number)_iterator.next()).longValue(); - } - - public long previous() { - return ((Number)_iterator.previous()).longValue(); - } - - public void add(long element) { - _iterator.add(new Long(element)); - } - - public void set(long element) { - _iterator.set(new Long(element)); - } - - public void remove() { - _iterator.remove(); - } - - private ListIterator _iterator = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/ListIteratorShortListIterator.java b/src/java/org/apache/commons/collections/primitives/adapters/ListIteratorShortListIterator.java deleted file mode 100644 index 3661679c2..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/ListIteratorShortListIterator.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/ListIteratorShortListIterator.java,v 1.3 2003/11/07 20:08:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.ListIterator; - -import org.apache.commons.collections.primitives.ShortListIterator; - -/** - * Adapts a {@link Number}-valued {@link ListIterator ListIterator} - * to the {@link ShortListIterator ShortListIterator} interface. - *

- * This implementation delegates most methods - * to the provided {@link ShortListIterator ShortListIterator} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:08:15 $ - * @author Rodney Waldhoff - */ -public class ListIteratorShortListIterator implements ShortListIterator { - - /** - * Create an {@link ShortListIterator ShortListIterator} wrapping - * the specified {@link ListIterator ListIterator}. When - * the given iterator is null, - * returns null. - * - * @param iterator the (possibly null) - * {@link ListIterator ListIterator} to wrap - * @return an {@link ShortListIterator ShortListIterator} wrapping the given - * iterator, or null when iterator is - * null. - */ - public static ShortListIterator wrap(ListIterator iterator) { - return null == iterator ? null : new ListIteratorShortListIterator(iterator); - } - - /** - * Creates an {@link ShortListIterator ShortListIterator} wrapping - * the specified {@link ListIterator ListIterator}. - * @see #wrap - */ - public ListIteratorShortListIterator(ListIterator iterator) { - _iterator = iterator; - } - - public int nextIndex() { - return _iterator.nextIndex(); - } - - public int previousIndex() { - return _iterator.previousIndex(); - } - - public boolean hasNext() { - return _iterator.hasNext(); - } - - public boolean hasPrevious() { - return _iterator.hasPrevious(); - } - - public short next() { - return ((Number)_iterator.next()).shortValue(); - } - - public short previous() { - return ((Number)_iterator.previous()).shortValue(); - } - - public void add(short element) { - _iterator.add(new Short(element)); - } - - public void set(short element) { - _iterator.set(new Short(element)); - } - - public void remove() { - _iterator.remove(); - } - - private ListIterator _iterator = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/ListLongList.java b/src/java/org/apache/commons/collections/primitives/adapters/ListLongList.java deleted file mode 100644 index 746324704..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/ListLongList.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/ListLongList.java,v 1.3 2003/11/07 20:08:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.List; - -import org.apache.commons.collections.primitives.LongList; - -/** - * Adapts a {@link Number}-valued {@link List List} - * to the {@link LongList LongList} interface. - *

- * This implementation delegates most methods - * to the provided {@link List List} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:08:15 $ - * @author Rodney Waldhoff - */ -public class ListLongList extends AbstractListLongList implements Serializable { - - /** - * Create an {@link LongList LongList} wrapping - * the specified {@link List List}. When - * the given list is null, - * returns null. - * - * @param list the (possibly null) - * {@link List List} to wrap - * @return a {@link LongList LongList} wrapping the given - * list, or null when list is - * null. - */ - public static LongList wrap(List list) { - if(null == list) { - return null; - } else if(list instanceof Serializable) { - return new ListLongList(list); - } else { - return new NonSerializableListLongList(list); - } - } - - /** - * Creates an {@link LongList LongList} wrapping - * the specified {@link List List}. - * @see #wrap - */ - public ListLongList(List list) { - _list = list; - } - - protected List getList() { - return _list; - } - - private List _list = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/ListShortList.java b/src/java/org/apache/commons/collections/primitives/adapters/ListShortList.java deleted file mode 100644 index 3ca174deb..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/ListShortList.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/ListShortList.java,v 1.3 2003/11/07 20:08:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.List; - -import org.apache.commons.collections.primitives.ShortList; - -/** - * Adapts a {@link Number}-valued {@link List List} - * to the {@link ShortList ShortList} interface. - *

- * This implementation delegates most methods - * to the provided {@link List List} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:08:15 $ - * @author Rodney Waldhoff - */ -public class ListShortList extends AbstractListShortList implements Serializable { - - /** - * Create an {@link ShortList ShortList} wrapping - * the specified {@link List List}. When - * the given list is null, - * returns null. - * - * @param list the (possibly null) - * {@link List List} to wrap - * @return a {@link ShortList ShortList} wrapping the given - * list, or null when list is - * null. - */ - public static ShortList wrap(List list) { - if(null == list) { - return null; - } else if(list instanceof Serializable) { - return new ListShortList(list); - } else { - return new NonSerializableListShortList(list); - } - } - - /** - * Creates an {@link ShortList ShortList} wrapping - * the specified {@link List List}. - * @see #wrap - */ - public ListShortList(List list) { - _list = list; - } - - protected List getList() { - return _list; - } - - private List _list = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/LongCollectionCollection.java b/src/java/org/apache/commons/collections/primitives/adapters/LongCollectionCollection.java deleted file mode 100644 index 3364ab195..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/LongCollectionCollection.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/LongCollectionCollection.java,v 1.3 2003/11/07 20:08:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.Collection; - -import org.apache.commons.collections.primitives.LongCollection; - -/** - * Adapts an {@link LongCollection LongCollection} - * to the {@link java.util.Collection Collection} - * interface. - *

- * This implementation delegates most methods - * to the provided {@link LongCollection LongCollection} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:08:15 $ - * @author Rodney Waldhoff - */ -final public class LongCollectionCollection extends AbstractLongCollectionCollection implements Serializable { - - /** - * Create a {@link Collection Collection} wrapping - * the specified {@link LongCollection LongCollection}. When - * the given collection is null, - * returns null. - * - * @param collection the (possibly null) - * {@link LongCollection LongCollection} to wrap - * @return a {@link Collection Collection} wrapping the given - * collection, or null when collection is - * null. - */ - public static Collection wrap(LongCollection collection) { - if(null == collection) { - return null; - } else if(collection instanceof Serializable) { - return new LongCollectionCollection(collection); - } else { - return new NonSerializableLongCollectionCollection(collection); - } - } - - /** - * Creates a {@link Collection Collection} wrapping - * the specified {@link LongCollection LongCollection}. - * @see #wrap - */ - public LongCollectionCollection(LongCollection collection) { - _collection = collection; - } - - - protected LongCollection getLongCollection() { - return _collection; - } - - private LongCollection _collection = null; -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/LongIteratorIterator.java b/src/java/org/apache/commons/collections/primitives/adapters/LongIteratorIterator.java deleted file mode 100644 index 77f5be2e6..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/LongIteratorIterator.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/LongIteratorIterator.java,v 1.3 2003/11/07 20:08:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Iterator; - -import org.apache.commons.collections.primitives.LongIterator; - -/** - * Adapts an {@link LongIterator LongIterator} to the - * {@link java.util.Iterator Iterator} interface. - *

- * This implementation delegates most methods - * to the provided {@link LongIterator LongIterator} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:08:15 $ - * @author Rodney Waldhoff - */ -public class LongIteratorIterator implements Iterator { - - /** - * Create an {@link Iterator Iterator} wrapping - * the specified {@link LongIterator LongIterator}. When - * the given iterator is null, - * returns null. - * - * @param iterator the (possibly null) - * {@link LongIterator LongIterator} to wrap - * @return an {@link Iterator Iterator} wrapping the given - * iterator, or null when iterator is - * null. - */ - public static Iterator wrap(LongIterator iterator) { - return null == iterator ? null : new LongIteratorIterator(iterator); - } - - /** - * Creates an {@link Iterator Iterator} wrapping - * the specified {@link LongIterator LongIterator}. - * @see #wrap - */ - public LongIteratorIterator(LongIterator iterator) { - _iterator = iterator; - } - - public boolean hasNext() { - return _iterator.hasNext(); - } - - public Object next() { - return new Long(_iterator.next()); - } - - public void remove() { - _iterator.remove(); - } - - private LongIterator _iterator = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/LongListIteratorListIterator.java b/src/java/org/apache/commons/collections/primitives/adapters/LongListIteratorListIterator.java deleted file mode 100644 index e28ebea8f..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/LongListIteratorListIterator.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/LongListIteratorListIterator.java,v 1.3 2003/11/07 20:08:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.ListIterator; - -import org.apache.commons.collections.primitives.LongListIterator; - -/** - * Adapts an {@link LongListIterator LongListIterator} to the - * {@link ListIterator ListIterator} interface. - *

- * This implementation delegates most methods - * to the provided {@link LongListIterator LongListIterator} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:08:15 $ - * @author Rodney Waldhoff - */ -public class LongListIteratorListIterator implements ListIterator { - - /** - * Create a {@link ListIterator ListIterator} wrapping - * the specified {@link LongListIterator LongListIterator}. When - * the given iterator is null, - * returns null. - * - * @param iterator the (possibly null) - * {@link LongListIterator LongListIterator} to wrap - * @return a {@link ListIterator ListIterator} wrapping the given - * iterator, or null when iterator is - * null. - */ - public static ListIterator wrap(LongListIterator iterator) { - return null == iterator ? null : new LongListIteratorListIterator(iterator); - } - - /** - * Creates an {@link ListIterator ListIterator} wrapping - * the specified {@link LongListIterator LongListIterator}. - * @see #wrap - */ - public LongListIteratorListIterator(LongListIterator iterator) { - _iterator = iterator; - } - - public int nextIndex() { - return _iterator.nextIndex(); - } - - public int previousIndex() { - return _iterator.previousIndex(); - } - - public boolean hasNext() { - return _iterator.hasNext(); - } - - public boolean hasPrevious() { - return _iterator.hasPrevious(); - } - - public Object next() { - return new Long(_iterator.next()); - } - - public Object previous() { - return new Long(_iterator.previous()); - } - - public void add(Object obj) { - _iterator.add(((Number)obj).longValue()); - } - - public void set(Object obj) { - _iterator.set(((Number)obj).longValue()); - } - - public void remove() { - _iterator.remove(); - } - - private LongListIterator _iterator = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/LongListList.java b/src/java/org/apache/commons/collections/primitives/adapters/LongListList.java deleted file mode 100644 index ce10ae086..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/LongListList.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/LongListList.java,v 1.3 2003/11/07 20:08:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.List; - -import org.apache.commons.collections.primitives.LongList; - -/** - * Adapts an {@link LongList LongList} to the - * {@link List List} interface. - *

- * This implementation delegates most methods - * to the provided {@link LongList LongList} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:08:15 $ - * @author Rodney Waldhoff - */ -final public class LongListList extends AbstractLongListList implements Serializable { - - /** - * Create a {@link List List} wrapping - * the specified {@link LongList LongList}. When - * the given list is null, - * returns null. - * - * @param list the (possibly null) - * {@link LongList LongList} to wrap - * @return a {@link List List} wrapping the given - * list, or null when list is - * null. - */ - public static List wrap(LongList list) { - if(null == list) { - return null; - } else if(list instanceof Serializable) { - return new LongListList(list); - } else { - return new NonSerializableLongListList(list); - } - } - - /** - * Creates a {@link List List} wrapping - * the specified {@link LongList LongList}. - * @see #wrap - */ - public LongListList(LongList list) { - _list = list; - } - - protected LongList getLongList() { - return _list; - } - - private LongList _list = null; -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableByteCollectionCollection.java b/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableByteCollectionCollection.java deleted file mode 100644 index 145b9978a..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableByteCollectionCollection.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/NonSerializableByteCollectionCollection.java,v 1.3 2003/11/07 20:07:51 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import org.apache.commons.collections.primitives.ByteCollection; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:07:51 $ - * @author Rodney Waldhoff - */ -final class NonSerializableByteCollectionCollection extends AbstractByteCollectionCollection { - - /** - * Creates a {@link Collection Collection} wrapping - * the specified {@link ByteCollection ByteCollection}. - */ - public NonSerializableByteCollectionCollection(ByteCollection collection) { - _collection = collection; - } - - protected ByteCollection getByteCollection() { - return _collection; - } - - private ByteCollection _collection = null; -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableByteListList.java b/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableByteListList.java deleted file mode 100644 index d666ef4c9..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableByteListList.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/NonSerializableByteListList.java,v 1.3 2003/11/07 20:07:50 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import org.apache.commons.collections.primitives.ByteList; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:07:50 $ - * @author Rodney Waldhoff - */ -final class NonSerializableByteListList extends AbstractByteListList { - - /** - * Creates a {@link List List} wrapping - * the specified {@link ByteList ByteList}. - */ - public NonSerializableByteListList(ByteList list) { - _list = list; - } - - protected ByteList getByteList() { - return _list; - } - - private ByteList _list = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableCharCollectionCollection.java b/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableCharCollectionCollection.java deleted file mode 100644 index a92fb5c4e..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableCharCollectionCollection.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/NonSerializableCharCollectionCollection.java,v 1.3 2003/11/07 20:07:50 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import org.apache.commons.collections.primitives.CharCollection; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:07:50 $ - * @author Rodney Waldhoff - */ -final class NonSerializableCharCollectionCollection extends AbstractCharCollectionCollection { - - /** - * Creates a {@link Collection Collection} wrapping - * the specified {@link CharCollection CharCollection}. - */ - public NonSerializableCharCollectionCollection(CharCollection collection) { - _collection = collection; - } - - protected CharCollection getCharCollection() { - return _collection; - } - - private CharCollection _collection = null; -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableCharListList.java b/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableCharListList.java deleted file mode 100644 index e19de2158..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableCharListList.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/NonSerializableCharListList.java,v 1.3 2003/11/07 20:07:51 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import org.apache.commons.collections.primitives.CharList; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:07:51 $ - * @author Rodney Waldhoff - */ -final class NonSerializableCharListList extends AbstractCharListList { - - /** - * Creates a {@link List List} wrapping - * the specified {@link CharList CharList}. - */ - public NonSerializableCharListList(CharList list) { - _list = list; - } - - protected CharList getCharList() { - return _list; - } - - private CharList _list = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableCollectionByteCollection.java b/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableCollectionByteCollection.java deleted file mode 100644 index 85f998d2d..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableCollectionByteCollection.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/NonSerializableCollectionByteCollection.java,v 1.3 2003/11/07 20:07:51 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Collection; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:07:51 $ - * @author Rodney Waldhoff - */ -final class NonSerializableCollectionByteCollection extends AbstractCollectionByteCollection { - public NonSerializableCollectionByteCollection(Collection collection) { - _collection = collection; - } - - protected Collection getCollection() { - return _collection; - } - - private Collection _collection = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableCollectionCharCollection.java b/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableCollectionCharCollection.java deleted file mode 100644 index a6ea7ba20..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableCollectionCharCollection.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/NonSerializableCollectionCharCollection.java,v 1.3 2003/11/07 20:07:51 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Collection; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:07:51 $ - * @author Rodney Waldhoff - */ -final class NonSerializableCollectionCharCollection extends AbstractCollectionCharCollection { - public NonSerializableCollectionCharCollection(Collection collection) { - _collection = collection; - } - - protected Collection getCollection() { - return _collection; - } - - private Collection _collection = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableCollectionDoubleCollection.java b/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableCollectionDoubleCollection.java deleted file mode 100644 index 4dad0b11f..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableCollectionDoubleCollection.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/NonSerializableCollectionDoubleCollection.java,v 1.3 2003/11/07 20:07:51 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Collection; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:07:51 $ - * @author Rodney Waldhoff - */ -final class NonSerializableCollectionDoubleCollection extends AbstractCollectionDoubleCollection { - public NonSerializableCollectionDoubleCollection(Collection collection) { - _collection = collection; - } - - protected Collection getCollection() { - return _collection; - } - - private Collection _collection = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableCollectionFloatCollection.java b/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableCollectionFloatCollection.java deleted file mode 100644 index 324c4f4e1..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableCollectionFloatCollection.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/NonSerializableCollectionFloatCollection.java,v 1.3 2003/11/07 20:07:51 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Collection; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:07:51 $ - * @author Rodney Waldhoff - */ -final class NonSerializableCollectionFloatCollection extends AbstractCollectionFloatCollection { - public NonSerializableCollectionFloatCollection(Collection collection) { - _collection = collection; - } - - protected Collection getCollection() { - return _collection; - } - - private Collection _collection = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableCollectionIntCollection.java b/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableCollectionIntCollection.java deleted file mode 100644 index 670a2a07a..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableCollectionIntCollection.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/NonSerializableCollectionIntCollection.java,v 1.4 2003/11/07 20:07:51 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Collection; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.4 $ $Date: 2003/11/07 20:07:51 $ - * @author Rodney Waldhoff - */ -final class NonSerializableCollectionIntCollection extends AbstractCollectionIntCollection { - public NonSerializableCollectionIntCollection(Collection collection) { - _collection = collection; - } - - protected Collection getCollection() { - return _collection; - } - - private Collection _collection = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableCollectionLongCollection.java b/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableCollectionLongCollection.java deleted file mode 100644 index 3a8c7c2f1..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableCollectionLongCollection.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/NonSerializableCollectionLongCollection.java,v 1.3 2003/11/07 20:07:51 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Collection; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:07:51 $ - * @author Rodney Waldhoff - */ -final class NonSerializableCollectionLongCollection extends AbstractCollectionLongCollection { - public NonSerializableCollectionLongCollection(Collection collection) { - _collection = collection; - } - - protected Collection getCollection() { - return _collection; - } - - private Collection _collection = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableCollectionShortCollection.java b/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableCollectionShortCollection.java deleted file mode 100644 index 3a264fac3..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableCollectionShortCollection.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/NonSerializableCollectionShortCollection.java,v 1.3 2003/11/07 20:07:51 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Collection; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:07:51 $ - * @author Rodney Waldhoff - */ -final class NonSerializableCollectionShortCollection extends AbstractCollectionShortCollection { - public NonSerializableCollectionShortCollection(Collection collection) { - _collection = collection; - } - - protected Collection getCollection() { - return _collection; - } - - private Collection _collection = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableDoubleCollectionCollection.java b/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableDoubleCollectionCollection.java deleted file mode 100644 index 67f88c3a9..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableDoubleCollectionCollection.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/NonSerializableDoubleCollectionCollection.java,v 1.3 2003/11/07 20:07:51 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import org.apache.commons.collections.primitives.DoubleCollection; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:07:51 $ - * @author Rodney Waldhoff - */ -final class NonSerializableDoubleCollectionCollection extends AbstractDoubleCollectionCollection { - - /** - * Creates a {@link Collection Collection} wrapping - * the specified {@link DoubleCollection DoubleCollection}. - */ - public NonSerializableDoubleCollectionCollection(DoubleCollection collection) { - _collection = collection; - } - - protected DoubleCollection getDoubleCollection() { - return _collection; - } - - private DoubleCollection _collection = null; -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableDoubleListList.java b/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableDoubleListList.java deleted file mode 100644 index 1b7d50c8d..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableDoubleListList.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/NonSerializableDoubleListList.java,v 1.3 2003/11/07 20:07:51 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import org.apache.commons.collections.primitives.DoubleList; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:07:51 $ - * @author Rodney Waldhoff - */ -final class NonSerializableDoubleListList extends AbstractDoubleListList { - - /** - * Creates a {@link List List} wrapping - * the specified {@link DoubleList DoubleList}. - */ - public NonSerializableDoubleListList(DoubleList list) { - _list = list; - } - - protected DoubleList getDoubleList() { - return _list; - } - - private DoubleList _list = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableFloatCollectionCollection.java b/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableFloatCollectionCollection.java deleted file mode 100644 index 8f1a3663e..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableFloatCollectionCollection.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/NonSerializableFloatCollectionCollection.java,v 1.3 2003/11/07 20:07:50 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import org.apache.commons.collections.primitives.FloatCollection; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:07:50 $ - * @author Rodney Waldhoff - */ -final class NonSerializableFloatCollectionCollection extends AbstractFloatCollectionCollection { - - /** - * Creates a {@link Collection Collection} wrapping - * the specified {@link FloatCollection FloatCollection}. - */ - public NonSerializableFloatCollectionCollection(FloatCollection collection) { - _collection = collection; - } - - protected FloatCollection getFloatCollection() { - return _collection; - } - - private FloatCollection _collection = null; -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableFloatListList.java b/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableFloatListList.java deleted file mode 100644 index 045d35372..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableFloatListList.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/NonSerializableFloatListList.java,v 1.3 2003/11/07 20:07:51 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import org.apache.commons.collections.primitives.FloatList; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:07:51 $ - * @author Rodney Waldhoff - */ -final class NonSerializableFloatListList extends AbstractFloatListList { - - /** - * Creates a {@link List List} wrapping - * the specified {@link FloatList FloatList}. - */ - public NonSerializableFloatListList(FloatList list) { - _list = list; - } - - protected FloatList getFloatList() { - return _list; - } - - private FloatList _list = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableIntCollectionCollection.java b/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableIntCollectionCollection.java deleted file mode 100644 index 0f35d0d16..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableIntCollectionCollection.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/NonSerializableIntCollectionCollection.java,v 1.3 2003/11/07 20:07:51 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import org.apache.commons.collections.primitives.IntCollection; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:07:51 $ - * @author Rodney Waldhoff - */ -final class NonSerializableIntCollectionCollection extends AbstractIntCollectionCollection { - - /** - * Creates a {@link Collection Collection} wrapping - * the specified {@link IntCollection IntCollection}. - */ - public NonSerializableIntCollectionCollection(IntCollection collection) { - _collection = collection; - } - - protected IntCollection getIntCollection() { - return _collection; - } - - private IntCollection _collection = null; -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableIntListList.java b/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableIntListList.java deleted file mode 100644 index 0f4d91c19..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableIntListList.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/NonSerializableIntListList.java,v 1.3 2003/11/07 20:07:51 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import org.apache.commons.collections.primitives.IntList; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:07:51 $ - * @author Rodney Waldhoff - */ -final class NonSerializableIntListList extends AbstractIntListList { - - /** - * Creates a {@link List List} wrapping - * the specified {@link IntList IntList}. - */ - public NonSerializableIntListList(IntList list) { - _list = list; - } - - protected IntList getIntList() { - return _list; - } - - private IntList _list = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableListByteList.java b/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableListByteList.java deleted file mode 100644 index 733ede17d..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableListByteList.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/NonSerializableListByteList.java,v 1.3 2003/11/07 20:07:51 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.List; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:07:51 $ - * @author Rodney Waldhoff - */ -final class NonSerializableListByteList extends AbstractListByteList { - - protected NonSerializableListByteList(List list) { - _list = list; - } - - protected List getList() { - return _list; - } - - private List _list = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableListCharList.java b/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableListCharList.java deleted file mode 100644 index e0ee948f8..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableListCharList.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/NonSerializableListCharList.java,v 1.3 2003/11/07 20:07:51 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.List; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:07:51 $ - * @author Rodney Waldhoff - */ -final class NonSerializableListCharList extends AbstractListCharList { - - protected NonSerializableListCharList(List list) { - _list = list; - } - - protected List getList() { - return _list; - } - - private List _list = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableListDoubleList.java b/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableListDoubleList.java deleted file mode 100644 index e33c3b084..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableListDoubleList.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/NonSerializableListDoubleList.java,v 1.3 2003/11/07 20:07:51 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.List; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:07:51 $ - * @author Rodney Waldhoff - */ -final class NonSerializableListDoubleList extends AbstractListDoubleList { - - protected NonSerializableListDoubleList(List list) { - _list = list; - } - - protected List getList() { - return _list; - } - - private List _list = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableListFloatList.java b/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableListFloatList.java deleted file mode 100644 index b73a932c7..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableListFloatList.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/NonSerializableListFloatList.java,v 1.3 2003/11/07 20:07:50 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.List; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:07:50 $ - * @author Rodney Waldhoff - */ -final class NonSerializableListFloatList extends AbstractListFloatList { - - protected NonSerializableListFloatList(List list) { - _list = list; - } - - protected List getList() { - return _list; - } - - private List _list = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableListIntList.java b/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableListIntList.java deleted file mode 100644 index 8733a62c8..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableListIntList.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/NonSerializableListIntList.java,v 1.4 2003/11/07 20:07:51 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.List; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.4 $ $Date: 2003/11/07 20:07:51 $ - * @author Rodney Waldhoff - */ -final class NonSerializableListIntList extends AbstractListIntList { - - protected NonSerializableListIntList(List list) { - _list = list; - } - - protected List getList() { - return _list; - } - - private List _list = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableListLongList.java b/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableListLongList.java deleted file mode 100644 index 19c506ab9..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableListLongList.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/NonSerializableListLongList.java,v 1.3 2003/11/07 20:07:51 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.List; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:07:51 $ - * @author Rodney Waldhoff - */ -final class NonSerializableListLongList extends AbstractListLongList { - - protected NonSerializableListLongList(List list) { - _list = list; - } - - protected List getList() { - return _list; - } - - private List _list = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableListShortList.java b/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableListShortList.java deleted file mode 100644 index 862681747..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableListShortList.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/NonSerializableListShortList.java,v 1.3 2003/11/07 20:07:51 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.List; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:07:51 $ - * @author Rodney Waldhoff - */ -final class NonSerializableListShortList extends AbstractListShortList { - - protected NonSerializableListShortList(List list) { - _list = list; - } - - protected List getList() { - return _list; - } - - private List _list = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableLongCollectionCollection.java b/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableLongCollectionCollection.java deleted file mode 100644 index 704422563..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableLongCollectionCollection.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/NonSerializableLongCollectionCollection.java,v 1.3 2003/11/07 20:07:51 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import org.apache.commons.collections.primitives.LongCollection; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:07:51 $ - * @author Rodney Waldhoff - */ -final class NonSerializableLongCollectionCollection extends AbstractLongCollectionCollection { - - /** - * Creates a {@link Collection Collection} wrapping - * the specified {@link LongCollection LongCollection}. - */ - public NonSerializableLongCollectionCollection(LongCollection collection) { - _collection = collection; - } - - protected LongCollection getLongCollection() { - return _collection; - } - - private LongCollection _collection = null; -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableLongListList.java b/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableLongListList.java deleted file mode 100644 index 79c46d167..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableLongListList.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/NonSerializableLongListList.java,v 1.3 2003/11/07 20:07:50 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import org.apache.commons.collections.primitives.LongList; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:07:50 $ - * @author Rodney Waldhoff - */ -final class NonSerializableLongListList extends AbstractLongListList { - - /** - * Creates a {@link List List} wrapping - * the specified {@link LongList LongList}. - */ - public NonSerializableLongListList(LongList list) { - _list = list; - } - - protected LongList getLongList() { - return _list; - } - - private LongList _list = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableShortCollectionCollection.java b/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableShortCollectionCollection.java deleted file mode 100644 index c1ca6cad1..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableShortCollectionCollection.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/NonSerializableShortCollectionCollection.java,v 1.3 2003/11/07 20:07:50 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import org.apache.commons.collections.primitives.ShortCollection; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:07:50 $ - * @author Rodney Waldhoff - */ -final class NonSerializableShortCollectionCollection extends AbstractShortCollectionCollection { - - /** - * Creates a {@link Collection Collection} wrapping - * the specified {@link ShortCollection ShortCollection}. - */ - public NonSerializableShortCollectionCollection(ShortCollection collection) { - _collection = collection; - } - - protected ShortCollection getShortCollection() { - return _collection; - } - - private ShortCollection _collection = null; -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableShortListList.java b/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableShortListList.java deleted file mode 100644 index feb7c7cc7..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/NonSerializableShortListList.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/NonSerializableShortListList.java,v 1.3 2003/11/07 20:07:51 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import org.apache.commons.collections.primitives.ShortList; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:07:51 $ - * @author Rodney Waldhoff - */ -final class NonSerializableShortListList extends AbstractShortListList { - - /** - * Creates a {@link List List} wrapping - * the specified {@link ShortList ShortList}. - */ - public NonSerializableShortListList(ShortList list) { - _list = list; - } - - protected ShortList getShortList() { - return _list; - } - - private ShortList _list = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/ShortCollectionCollection.java b/src/java/org/apache/commons/collections/primitives/adapters/ShortCollectionCollection.java deleted file mode 100644 index 5ba694cb8..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/ShortCollectionCollection.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/ShortCollectionCollection.java,v 1.3 2003/11/07 20:07:50 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.Collection; - -import org.apache.commons.collections.primitives.ShortCollection; - -/** - * Adapts an {@link ShortCollection ShortCollection} - * to the {@link java.util.Collection Collection} - * interface. - *

- * This implementation delegates most methods - * to the provided {@link ShortCollection ShortCollection} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:07:50 $ - * @author Rodney Waldhoff - */ -final public class ShortCollectionCollection extends AbstractShortCollectionCollection implements Serializable { - - /** - * Create a {@link Collection Collection} wrapping - * the specified {@link ShortCollection ShortCollection}. When - * the given collection is null, - * returns null. - * - * @param collection the (possibly null) - * {@link ShortCollection ShortCollection} to wrap - * @return a {@link Collection Collection} wrapping the given - * collection, or null when collection is - * null. - */ - public static Collection wrap(ShortCollection collection) { - if(null == collection) { - return null; - } else if(collection instanceof Serializable) { - return new ShortCollectionCollection(collection); - } else { - return new NonSerializableShortCollectionCollection(collection); - } - } - - /** - * Creates a {@link Collection Collection} wrapping - * the specified {@link ShortCollection ShortCollection}. - * @see #wrap - */ - public ShortCollectionCollection(ShortCollection collection) { - _collection = collection; - } - - - protected ShortCollection getShortCollection() { - return _collection; - } - - private ShortCollection _collection = null; -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/ShortIteratorIterator.java b/src/java/org/apache/commons/collections/primitives/adapters/ShortIteratorIterator.java deleted file mode 100644 index 62d0a70fc..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/ShortIteratorIterator.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/ShortIteratorIterator.java,v 1.3 2003/11/07 20:12:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Iterator; - -import org.apache.commons.collections.primitives.ShortIterator; - -/** - * Adapts an {@link ShortIterator ShortIterator} to the - * {@link java.util.Iterator Iterator} interface. - *

- * This implementation delegates most methods - * to the provided {@link ShortIterator ShortIterator} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:12:15 $ - * @author Rodney Waldhoff - */ -public class ShortIteratorIterator implements Iterator { - - /** - * Create an {@link Iterator Iterator} wrapping - * the specified {@link ShortIterator ShortIterator}. When - * the given iterator is null, - * returns null. - * - * @param iterator the (possibly null) - * {@link ShortIterator ShortIterator} to wrap - * @return an {@link Iterator Iterator} wrapping the given - * iterator, or null when iterator is - * null. - */ - public static Iterator wrap(ShortIterator iterator) { - return null == iterator ? null : new ShortIteratorIterator(iterator); - } - - /** - * Creates an {@link Iterator Iterator} wrapping - * the specified {@link ShortIterator ShortIterator}. - * @see #wrap - */ - public ShortIteratorIterator(ShortIterator iterator) { - _iterator = iterator; - } - - public boolean hasNext() { - return _iterator.hasNext(); - } - - public Object next() { - return new Short(_iterator.next()); - } - - public void remove() { - _iterator.remove(); - } - - private ShortIterator _iterator = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/ShortListIteratorListIterator.java b/src/java/org/apache/commons/collections/primitives/adapters/ShortListIteratorListIterator.java deleted file mode 100644 index b9a2eca03..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/ShortListIteratorListIterator.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/ShortListIteratorListIterator.java,v 1.3 2003/11/07 20:12:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.ListIterator; - -import org.apache.commons.collections.primitives.ShortListIterator; - -/** - * Adapts an {@link ShortListIterator ShortListIterator} to the - * {@link ListIterator ListIterator} interface. - *

- * This implementation delegates most methods - * to the provided {@link ShortListIterator ShortListIterator} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:12:15 $ - * @author Rodney Waldhoff - */ -public class ShortListIteratorListIterator implements ListIterator { - - /** - * Create a {@link ListIterator ListIterator} wrapping - * the specified {@link ShortListIterator ShortListIterator}. When - * the given iterator is null, - * returns null. - * - * @param iterator the (possibly null) - * {@link ShortListIterator ShortListIterator} to wrap - * @return a {@link ListIterator ListIterator} wrapping the given - * iterator, or null when iterator is - * null. - */ - public static ListIterator wrap(ShortListIterator iterator) { - return null == iterator ? null : new ShortListIteratorListIterator(iterator); - } - - /** - * Creates an {@link ListIterator ListIterator} wrapping - * the specified {@link ShortListIterator ShortListIterator}. - * @see #wrap - */ - public ShortListIteratorListIterator(ShortListIterator iterator) { - _iterator = iterator; - } - - public int nextIndex() { - return _iterator.nextIndex(); - } - - public int previousIndex() { - return _iterator.previousIndex(); - } - - public boolean hasNext() { - return _iterator.hasNext(); - } - - public boolean hasPrevious() { - return _iterator.hasPrevious(); - } - - public Object next() { - return new Short(_iterator.next()); - } - - public Object previous() { - return new Short(_iterator.previous()); - } - - public void add(Object obj) { - _iterator.add(((Number)obj).shortValue()); - } - - public void set(Object obj) { - _iterator.set(((Number)obj).shortValue()); - } - - public void remove() { - _iterator.remove(); - } - - private ShortListIterator _iterator = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/ShortListList.java b/src/java/org/apache/commons/collections/primitives/adapters/ShortListList.java deleted file mode 100644 index ed3874422..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/ShortListList.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/ShortListList.java,v 1.3 2003/11/07 20:12:15 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.List; - -import org.apache.commons.collections.primitives.ShortList; - -/** - * Adapts an {@link ShortList ShortList} to the - * {@link List List} interface. - *

- * This implementation delegates most methods - * to the provided {@link ShortList ShortList} - * implementation in the "obvious" way. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:12:15 $ - * @author Rodney Waldhoff - */ -final public class ShortListList extends AbstractShortListList implements Serializable { - - /** - * Create a {@link List List} wrapping - * the specified {@link ShortList ShortList}. When - * the given list is null, - * returns null. - * - * @param list the (possibly null) - * {@link ShortList ShortList} to wrap - * @return a {@link List List} wrapping the given - * list, or null when list is - * null. - */ - public static List wrap(ShortList list) { - if(null == list) { - return null; - } else if(list instanceof Serializable) { - return new ShortListList(list); - } else { - return new NonSerializableShortListList(list); - } - } - - /** - * Creates a {@link List List} wrapping - * the specified {@link ShortList ShortList}. - * @see #wrap - */ - public ShortListList(ShortList list) { - _list = list; - } - - protected ShortList getShortList() { - return _list; - } - - private ShortList _list = null; -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/io/ByteIteratorInputStream.java b/src/java/org/apache/commons/collections/primitives/adapters/io/ByteIteratorInputStream.java deleted file mode 100644 index 573384a70..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/io/ByteIteratorInputStream.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/io/Attic/ByteIteratorInputStream.java,v 1.3 2003/11/07 20:13:05 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters.io; - -import java.io.InputStream; - -import org.apache.commons.collections.primitives.ByteIterator; - -/** - * Adapts an {@link ByteIterator} to the {@link InputStream} interface. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:13:05 $ - * @author Rodney Waldhoff - */ -public class ByteIteratorInputStream extends InputStream { - - public ByteIteratorInputStream(ByteIterator in) { - this.iterator= in; - } - - public int read() { - if(iterator.hasNext()) { - return (0xFF & iterator.next()); - } else { - return -1; - } - } - - public static InputStream adapt(ByteIterator in) { - return null == in ? null : new ByteIteratorInputStream(in); - } - - private ByteIterator iterator = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/io/CharIteratorReader.java b/src/java/org/apache/commons/collections/primitives/adapters/io/CharIteratorReader.java deleted file mode 100644 index cd9dcdf0d..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/io/CharIteratorReader.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/io/Attic/CharIteratorReader.java,v 1.3 2003/11/07 20:13:05 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters.io; - -import java.io.Reader; - -import org.apache.commons.collections.primitives.CharIterator; - -/** - * Adapts a {@link CharIterator} to the {@link Reader} interface. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:13:05 $ - * @author Rodney Waldhoff - */ -public class CharIteratorReader extends Reader { - - public CharIteratorReader(CharIterator in) { - this.iterator= in; - } - - public int read(char[] buf, int off, int len) { - if(iterator.hasNext()) { - int count = 0; - while(iterator.hasNext() && count < len) { - buf[off + count] = iterator.next(); - count++; - } - return count; - } else { - return -1; - } - } - - public void close() { - } - - public static Reader adapt(CharIterator in) { - return null == in ? null : new CharIteratorReader(in); - } - - private CharIterator iterator = null; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/io/InputStreamByteIterator.java b/src/java/org/apache/commons/collections/primitives/adapters/io/InputStreamByteIterator.java deleted file mode 100644 index 73d7a4595..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/io/InputStreamByteIterator.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/io/Attic/InputStreamByteIterator.java,v 1.4 2003/11/07 20:13:05 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters.io; - -import java.io.IOException; -import java.io.InputStream; -import java.util.NoSuchElementException; - -import org.apache.commons.collections.primitives.ByteIterator; - -/** - * Adapts an {@link InputStream} to the {@link ByteIterator} interface. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @version $Revision: 1.4 $ $Date: 2003/11/07 20:13:05 $ - * @author Rodney Waldhoff - */ -public class InputStreamByteIterator implements ByteIterator { - - public InputStreamByteIterator(InputStream in) { - this.stream = in; - } - - public boolean hasNext() { - ensureNextAvailable(); - return (-1 != next); - } - - public byte next() { - if(!hasNext()) { - throw new NoSuchElementException("No next element"); - } else { - nextAvailable = false; - return (byte)next; - } - } - - /** - * Not supported. - * @throws UnsupportedOperationException - */ - public void remove() throws UnsupportedOperationException { - throw new UnsupportedOperationException("remove() is not supported here"); - } - - public static ByteIterator adapt(InputStream in) { - return null == in ? null : new InputStreamByteIterator(in); - } - - private void ensureNextAvailable() { - if(!nextAvailable) { - readNext(); - } - } - - private void readNext() { - try { - next = stream.read(); - nextAvailable = true; - } catch(IOException e) { - // TODO: Fix me using tunnelled exception, see - // http://radio.weblogs.com/0122027/2003/04/01.html#a7 - // for example - throw new RuntimeException(e.toString()); - } - } - - private InputStream stream = null; - private boolean nextAvailable = false; - private int next; -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/io/ReaderCharIterator.java b/src/java/org/apache/commons/collections/primitives/adapters/io/ReaderCharIterator.java deleted file mode 100644 index 6a012e842..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/io/ReaderCharIterator.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/io/Attic/ReaderCharIterator.java,v 1.4 2003/11/07 20:13:05 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.adapters.io; - -import java.io.IOException; -import java.io.Reader; -import java.util.NoSuchElementException; - -import org.apache.commons.collections.primitives.CharIterator; - -/** - * Adapts a {@link Reader} to the {@link CharIterator} interface. - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @version $Revision: 1.4 $ $Date: 2003/11/07 20:13:05 $ - * @author Rodney Waldhoff - */ -public class ReaderCharIterator implements CharIterator { - - public ReaderCharIterator(Reader in) { - this.reader = in; - } - - public static CharIterator adapt(Reader in) { - return null == in ? null : new ReaderCharIterator(in); - } - - public boolean hasNext() { - ensureNextAvailable(); - return (-1 != next); - } - - public char next() { - if(!hasNext()) { - throw new NoSuchElementException("No next element"); - } else { - nextAvailable = false; - return (char)next; - } - } - - /** - * Not supported. - * @throws UnsupportedOperationException - */ - public void remove() throws UnsupportedOperationException { - throw new UnsupportedOperationException("remove() is not supported here"); - } - - private void ensureNextAvailable() { - if(!nextAvailable) { - readNext(); - } - } - - private void readNext() { - try { - next = reader.read(); - nextAvailable = true; - } catch(IOException e) { - // TODO: Fix me using tunnelled exception, see - // http://radio.weblogs.com/0122027/2003/04/01.html#a7 - // for example - throw new RuntimeException(e.toString()); - } - } - - private Reader reader = null; - private boolean nextAvailable = false; - private int next; - -} diff --git a/src/java/org/apache/commons/collections/primitives/adapters/package.html b/src/java/org/apache/commons/collections/primitives/adapters/package.html deleted file mode 100644 index 0e5a4c83f..000000000 --- a/src/java/org/apache/commons/collections/primitives/adapters/package.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - Package Documentation for org.apache.commons.collections.primitives.adapters - - -

- NOTE: This code has been moved (current package names and all) - to the Jakarta Commons Primitives - component. Please stop using the version from the commons-collections JAR, and use the - commons-primitives version instead. -

-

- Adapters for converting between the - primitive and object based versions of the - collections framework. -

-

- Also see the {@link org.apache.commons.collections.primitives}, - {@link java.util} and {@link org.apache.commons.collections} packages. -

- - - diff --git a/src/java/org/apache/commons/collections/primitives/decorators/BaseProxyIntCollection.java b/src/java/org/apache/commons/collections/primitives/decorators/BaseProxyIntCollection.java deleted file mode 100644 index 186b15afc..000000000 --- a/src/java/org/apache/commons/collections/primitives/decorators/BaseProxyIntCollection.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/decorators/Attic/BaseProxyIntCollection.java,v 1.3 2003/11/07 20:17:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.decorators; - -import org.apache.commons.collections.primitives.IntCollection; -import org.apache.commons.collections.primitives.IntIterator; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:17:13 $ - * - * @author Rodney Waldhoff - */ -abstract class BaseProxyIntCollection implements IntCollection { - protected abstract IntCollection getProxiedCollection(); - - protected BaseProxyIntCollection() { - } - - - - public boolean add(int element) { - return getProxiedCollection().add(element); - } - - public boolean addAll(IntCollection c) { - return getProxiedCollection().addAll(c); - } - - public void clear() { - getProxiedCollection().clear(); - } - - public boolean contains(int element) { - return getProxiedCollection().contains(element); - } - - public boolean containsAll(IntCollection c) { - return getProxiedCollection().containsAll(c); - } - - public boolean isEmpty() { - return getProxiedCollection().isEmpty(); - } - - public IntIterator iterator() { - return getProxiedCollection().iterator(); - } - - public boolean removeAll(IntCollection c) { - return getProxiedCollection().removeAll(c); - } - - public boolean removeElement(int element) { - return getProxiedCollection().removeElement(element); - } - - public boolean retainAll(IntCollection c) { - return getProxiedCollection().retainAll(c); - } - - public int size() { - return getProxiedCollection().size(); - } - - public int[] toArray() { - return getProxiedCollection().toArray(); - } - - public int[] toArray(int[] a) { - return getProxiedCollection().toArray(a); - } - - // TODO: Add note about possible contract violations here. - - public boolean equals(Object obj) { - return getProxiedCollection().equals(obj); - } - - public int hashCode() { - return getProxiedCollection().hashCode(); - } - - public String toString() { - return getProxiedCollection().toString(); - } - -} diff --git a/src/java/org/apache/commons/collections/primitives/decorators/BaseProxyIntList.java b/src/java/org/apache/commons/collections/primitives/decorators/BaseProxyIntList.java deleted file mode 100644 index 69246d847..000000000 --- a/src/java/org/apache/commons/collections/primitives/decorators/BaseProxyIntList.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/decorators/Attic/BaseProxyIntList.java,v 1.3 2003/11/07 20:17:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.decorators; - -import org.apache.commons.collections.primitives.IntCollection; -import org.apache.commons.collections.primitives.IntList; -import org.apache.commons.collections.primitives.IntListIterator; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:17:13 $ - * - * @author Rodney Waldhoff - */ -abstract class BaseProxyIntList extends BaseProxyIntCollection implements IntList { - protected abstract IntList getProxiedList(); - - protected final IntCollection getProxiedCollection() { - return getProxiedList(); - } - - protected BaseProxyIntList() { - } - - public void add(int index, int element) { - getProxiedList().add(index,element); - } - - public boolean addAll(int index, IntCollection collection) { - return getProxiedList().addAll(index,collection); - } - - public int get(int index) { - return getProxiedList().get(index); - } - - public int indexOf(int element) { - return getProxiedList().indexOf(element); - } - - public int lastIndexOf(int element) { - return getProxiedList().lastIndexOf(element); - } - - public IntListIterator listIterator() { - return getProxiedList().listIterator(); - } - - public IntListIterator listIterator(int index) { - return getProxiedList().listIterator(index); - } - - public int removeElementAt(int index) { - return getProxiedList().removeElementAt(index); - } - - public int set(int index, int element) { - return getProxiedList().set(index,element); - } - - public IntList subList(int fromIndex, int toIndex) { - return getProxiedList().subList(fromIndex,toIndex); - } - -} diff --git a/src/java/org/apache/commons/collections/primitives/decorators/BaseUnmodifiableIntList.java b/src/java/org/apache/commons/collections/primitives/decorators/BaseUnmodifiableIntList.java deleted file mode 100644 index 4de536d87..000000000 --- a/src/java/org/apache/commons/collections/primitives/decorators/BaseUnmodifiableIntList.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/decorators/Attic/BaseUnmodifiableIntList.java,v 1.3 2003/11/07 20:17:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.decorators; - -import org.apache.commons.collections.primitives.IntCollection; -import org.apache.commons.collections.primitives.IntIterator; -import org.apache.commons.collections.primitives.IntList; -import org.apache.commons.collections.primitives.IntListIterator; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:17:13 $ - * - * @author Rodney Waldhoff - */ -abstract class BaseUnmodifiableIntList extends BaseProxyIntList { - - public final void add(int index, int element) { - throw new UnsupportedOperationException("This IntList is not modifiable."); - } - - public final boolean addAll(int index, IntCollection collection) { - throw new UnsupportedOperationException("This IntList is not modifiable."); - } - - public final int removeElementAt(int index) { - throw new UnsupportedOperationException("This IntList is not modifiable."); - } - - public final int set(int index, int element) { - throw new UnsupportedOperationException("This IntList is not modifiable."); - } - - public final boolean add(int element) { - throw new UnsupportedOperationException("This IntList is not modifiable."); - } - - public final boolean addAll(IntCollection c) { - throw new UnsupportedOperationException("This IntList is not modifiable."); - } - - public final void clear() { - throw new UnsupportedOperationException("This IntList is not modifiable."); - } - - public final boolean removeAll(IntCollection c) { - throw new UnsupportedOperationException("This IntList is not modifiable."); - } - - public final boolean removeElement(int element) { - throw new UnsupportedOperationException("This IntList is not modifiable."); - } - - public final boolean retainAll(IntCollection c) { - throw new UnsupportedOperationException("This IntList is not modifiable."); - } - - public final IntList subList(int fromIndex, int toIndex) { - return UnmodifiableIntList.wrap(getProxiedList().subList(fromIndex,toIndex)); - } - - public final IntIterator iterator() { - return UnmodifiableIntIterator.wrap(getProxiedList().iterator()); - } - - public IntListIterator listIterator() { - return UnmodifiableIntListIterator.wrap(getProxiedList().listIterator()); - } - - public IntListIterator listIterator(int index) { - return UnmodifiableIntListIterator.wrap(getProxiedList().listIterator(index)); - } - -} diff --git a/src/java/org/apache/commons/collections/primitives/decorators/NonSerializableUnmodifiableIntList.java b/src/java/org/apache/commons/collections/primitives/decorators/NonSerializableUnmodifiableIntList.java deleted file mode 100644 index 97c97ed74..000000000 --- a/src/java/org/apache/commons/collections/primitives/decorators/NonSerializableUnmodifiableIntList.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/decorators/Attic/NonSerializableUnmodifiableIntList.java,v 1.3 2003/11/07 20:17:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.decorators; - -import org.apache.commons.collections.primitives.IntList; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:17:13 $ - * - * @author Rodney Waldhoff - */ -final class NonSerializableUnmodifiableIntList extends BaseUnmodifiableIntList { - NonSerializableUnmodifiableIntList(IntList list) { - this.proxied = list; - } - - protected IntList getProxiedList() { - return proxied; - } - - private IntList proxied = null; -} diff --git a/src/java/org/apache/commons/collections/primitives/decorators/ProxyIntIterator.java b/src/java/org/apache/commons/collections/primitives/decorators/ProxyIntIterator.java deleted file mode 100644 index b94866074..000000000 --- a/src/java/org/apache/commons/collections/primitives/decorators/ProxyIntIterator.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/decorators/Attic/ProxyIntIterator.java,v 1.4 2003/11/07 20:17:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.decorators; - -import org.apache.commons.collections.primitives.IntIterator; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.4 $ $Date: 2003/11/07 20:17:13 $ - * - * @author Rodney Waldhoff - */ -abstract class ProxyIntIterator implements IntIterator { - ProxyIntIterator() { - } - - public boolean hasNext() { - return getIterator().hasNext(); - } - - public int next() { - return getIterator().next(); - } - - protected abstract IntIterator getIterator(); -} diff --git a/src/java/org/apache/commons/collections/primitives/decorators/ProxyIntListIterator.java b/src/java/org/apache/commons/collections/primitives/decorators/ProxyIntListIterator.java deleted file mode 100644 index e392f1f9d..000000000 --- a/src/java/org/apache/commons/collections/primitives/decorators/ProxyIntListIterator.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/decorators/Attic/ProxyIntListIterator.java,v 1.4 2003/11/07 20:17:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.decorators; - -import org.apache.commons.collections.primitives.IntIterator; -import org.apache.commons.collections.primitives.IntListIterator; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.4 $ $Date: 2003/11/07 20:17:13 $ - * - * @author Rodney Waldhoff - */ -abstract class ProxyIntListIterator extends ProxyIntIterator implements IntListIterator { - ProxyIntListIterator() { - } - - public boolean hasPrevious() { - return getListIterator().hasPrevious(); - } - - public int nextIndex() { - return getListIterator().nextIndex(); - } - - public int previous() { - return getListIterator().previous(); - } - - public int previousIndex() { - return getListIterator().previousIndex(); - } - - protected final IntIterator getIterator() { - return getListIterator(); - } - - protected abstract IntListIterator getListIterator(); - -} diff --git a/src/java/org/apache/commons/collections/primitives/decorators/UnmodifiableIntIterator.java b/src/java/org/apache/commons/collections/primitives/decorators/UnmodifiableIntIterator.java deleted file mode 100644 index c7f60da37..000000000 --- a/src/java/org/apache/commons/collections/primitives/decorators/UnmodifiableIntIterator.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/decorators/Attic/UnmodifiableIntIterator.java,v 1.3 2003/11/07 20:17:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.decorators; - -import org.apache.commons.collections.primitives.IntIterator; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:17:13 $ - * - * @author Rodney Waldhoff - */ -public final class UnmodifiableIntIterator extends ProxyIntIterator { - UnmodifiableIntIterator(IntIterator iterator) { - this.proxied = iterator; - } - - public void remove() { - throw new UnsupportedOperationException("This IntIterator is not modifiable."); - } - - protected IntIterator getIterator() { - return proxied; - } - - - public static final IntIterator wrap(IntIterator iterator) { - if(null == iterator) { - return null; - } else if(iterator instanceof UnmodifiableIntIterator) { - return iterator; - } else { - return new UnmodifiableIntIterator(iterator); - } - } - - private IntIterator proxied = null; -} diff --git a/src/java/org/apache/commons/collections/primitives/decorators/UnmodifiableIntList.java b/src/java/org/apache/commons/collections/primitives/decorators/UnmodifiableIntList.java deleted file mode 100644 index dcd03c29c..000000000 --- a/src/java/org/apache/commons/collections/primitives/decorators/UnmodifiableIntList.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/decorators/Attic/UnmodifiableIntList.java,v 1.3 2003/11/07 20:17:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.decorators; - -import java.io.Serializable; - -import org.apache.commons.collections.primitives.IntList; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:17:13 $ - * - * @author Rodney Waldhoff - */ -public final class UnmodifiableIntList extends BaseUnmodifiableIntList implements Serializable { - UnmodifiableIntList(IntList list) { - this.proxied = list; - } - - public static final IntList wrap(IntList list) { - if(null == list) { - return null; - } else if(list instanceof UnmodifiableIntList) { - return list; - } else if(list instanceof Serializable) { - return new UnmodifiableIntList(list); - } else { - return new NonSerializableUnmodifiableIntList(list); - } - } - - protected IntList getProxiedList() { - return proxied; - } - - private IntList proxied = null; -} diff --git a/src/java/org/apache/commons/collections/primitives/decorators/UnmodifiableIntListIterator.java b/src/java/org/apache/commons/collections/primitives/decorators/UnmodifiableIntListIterator.java deleted file mode 100644 index 41aee2fcf..000000000 --- a/src/java/org/apache/commons/collections/primitives/decorators/UnmodifiableIntListIterator.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/decorators/Attic/UnmodifiableIntListIterator.java,v 1.3 2003/11/07 20:17:13 rwaldhoff 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 - * . - * - */ - -package org.apache.commons.collections.primitives.decorators; - -import org.apache.commons.collections.primitives.IntListIterator; - -/** - * - * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) - * - * @since Commons Collections 2.2 - * @version $Revision: 1.3 $ $Date: 2003/11/07 20:17:13 $ - * - * @author Rodney Waldhoff - */ -public final class UnmodifiableIntListIterator extends ProxyIntListIterator { - UnmodifiableIntListIterator(IntListIterator iterator) { - this.proxied = iterator; - } - - public void remove() { - throw new UnsupportedOperationException("This IntListIterator is not modifiable."); - } - - public void add(int value) { - throw new UnsupportedOperationException("This IntListIterator is not modifiable."); - } - - public void set(int value) { - throw new UnsupportedOperationException("This IntListIterator is not modifiable."); - } - - protected IntListIterator getListIterator() { - return proxied; - } - - - public static final IntListIterator wrap(IntListIterator iterator) { - if(null == iterator) { - return null; - } else if(iterator instanceof UnmodifiableIntListIterator) { - return iterator; - } else { - return new UnmodifiableIntListIterator(iterator); - } - } - - private IntListIterator proxied = null; -} diff --git a/src/java/org/apache/commons/collections/primitives/package.html b/src/java/org/apache/commons/collections/primitives/package.html deleted file mode 100644 index d6fd88bb8..000000000 --- a/src/java/org/apache/commons/collections/primitives/package.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - Package Documentation for org.apache.commons.collections.primitives - - -

- NOTE: This code has been moved (current package names and all) - to the Jakarta Commons Primitives - component. Please stop using the versions from the commons-collections JAR, and use the - commons-primitives version instead. -

-

- Collections of primitive values. - Generally these extensions offer memory - and performance improvements over the - Object wrapped alternative. -

-

- The package provides versions of - the major collections framework interfaces - (Collection, List, - Map, Set, etc.) and their - helpers (Iterator, ListIterator, - etc) for each primitive type, and various concrete - implementations of these. -

-

- Also see {@link org.apache.commons.collections.primitives.adapters}. -

- - -