Refactor BoundedCollection interface to main package
All interfaces should be in main package git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@131378 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
52da69630a
commit
b1437124f8
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/BoundedCollection.java,v 1.5 2003/11/18 22:50:44 scolebourne Exp $
|
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/BoundedCollection.java,v 1.6 2003/11/29 18:14:20 scolebourne Exp $
|
||||||
* ====================================================================
|
* ====================================================================
|
||||||
*
|
*
|
||||||
* The Apache Software License, Version 1.1
|
* The Apache Software License, Version 1.1
|
||||||
|
@ -57,6 +57,8 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.commons.collections;
|
package org.apache.commons.collections;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A BoundedCollection is a collection that is bounded in size.
|
* A BoundedCollection is a collection that is bounded in size.
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -64,13 +66,26 @@ package org.apache.commons.collections;
|
||||||
* maximum number of elements. This interface allows the querying of details
|
* maximum number of elements. This interface allows the querying of details
|
||||||
* associated with the maximum number of elements.
|
* associated with the maximum number of elements.
|
||||||
*
|
*
|
||||||
* @deprecated TO BE DELETED BEFORE v3.0, moved to collection subpackage
|
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.5 $ $Date: 2003/11/18 22:50:44 $
|
* @version $Revision: 1.6 $ $Date: 2003/11/29 18:14:20 $
|
||||||
*
|
*
|
||||||
* @author Herve Quiroz
|
* @author Herve Quiroz
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
public interface BoundedCollection extends org.apache.commons.collections.collection.BoundedCollection {
|
public interface BoundedCollection extends Collection {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if this collection is full and no new elements can be added.
|
||||||
|
*
|
||||||
|
* @return <code>true</code> if the collection is full
|
||||||
|
*/
|
||||||
|
boolean isFull();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the maximum size of the collection (the bound).
|
||||||
|
*
|
||||||
|
* @return the maximum number of elements the collection can hold
|
||||||
|
*/
|
||||||
|
int maxSize();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/BoundedFifoBuffer.java,v 1.12 2003/11/29 18:04:57 scolebourne Exp $
|
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/BoundedFifoBuffer.java,v 1.13 2003/11/29 18:14:20 scolebourne Exp $
|
||||||
* ====================================================================
|
* ====================================================================
|
||||||
*
|
*
|
||||||
* The Apache Software License, Version 1.1
|
* The Apache Software License, Version 1.1
|
||||||
|
@ -63,8 +63,6 @@ import java.util.Collection;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.NoSuchElementException;
|
import java.util.NoSuchElementException;
|
||||||
|
|
||||||
import org.apache.commons.collections.collection.BoundedCollection;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The BoundedFifoBuffer is a <strong>very</strong> efficient implementation of
|
* The BoundedFifoBuffer is a <strong>very</strong> efficient implementation of
|
||||||
* Buffer that does not alter the size of the buffer at runtime.
|
* Buffer that does not alter the size of the buffer at runtime.
|
||||||
|
@ -87,7 +85,7 @@ import org.apache.commons.collections.collection.BoundedCollection;
|
||||||
*
|
*
|
||||||
* @deprecated Moved to buffer subpackage. Due to be removed in v4.0.
|
* @deprecated Moved to buffer subpackage. Due to be removed in v4.0.
|
||||||
* @since 2.1
|
* @since 2.1
|
||||||
* @version $Revision: 1.12 $ $Date: 2003/11/29 18:04:57 $
|
* @version $Revision: 1.13 $ $Date: 2003/11/29 18:14:20 $
|
||||||
*
|
*
|
||||||
* @author Avalon
|
* @author Avalon
|
||||||
* @author Berin Loritsch
|
* @author Berin Loritsch
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/CollectionUtils.java,v 1.48 2003/11/27 22:55:16 scolebourne Exp $
|
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/CollectionUtils.java,v 1.49 2003/11/29 18:14:20 scolebourne Exp $
|
||||||
* ====================================================================
|
* ====================================================================
|
||||||
*
|
*
|
||||||
* The Apache Software License, Version 1.1
|
* The Apache Software License, Version 1.1
|
||||||
|
@ -69,7 +69,6 @@ import java.util.ListIterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.apache.commons.collections.collection.BoundedCollection;
|
|
||||||
import org.apache.commons.collections.collection.PredicatedCollection;
|
import org.apache.commons.collections.collection.PredicatedCollection;
|
||||||
import org.apache.commons.collections.collection.SynchronizedCollection;
|
import org.apache.commons.collections.collection.SynchronizedCollection;
|
||||||
import org.apache.commons.collections.collection.TransformedCollection;
|
import org.apache.commons.collections.collection.TransformedCollection;
|
||||||
|
@ -85,7 +84,7 @@ import org.apache.commons.collections.observed.ObservableCollection;
|
||||||
* Provides utility methods and decorators for {@link Collection} instances.
|
* Provides utility methods and decorators for {@link Collection} instances.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 1.0
|
* @since Commons Collections 1.0
|
||||||
* @version $Revision: 1.48 $ $Date: 2003/11/27 22:55:16 $
|
* @version $Revision: 1.49 $ $Date: 2003/11/29 18:14:20 $
|
||||||
*
|
*
|
||||||
* @author Rodney Waldhoff
|
* @author Rodney Waldhoff
|
||||||
* @author Paul Jack
|
* @author Paul Jack
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/buffer/BoundedFifoBuffer.java,v 1.1 2003/11/29 18:04:57 scolebourne Exp $
|
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/buffer/BoundedFifoBuffer.java,v 1.2 2003/11/29 18:14:20 scolebourne Exp $
|
||||||
* ====================================================================
|
* ====================================================================
|
||||||
*
|
*
|
||||||
* The Apache Software License, Version 1.1
|
* The Apache Software License, Version 1.1
|
||||||
|
@ -63,10 +63,10 @@ import java.util.Collection;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.NoSuchElementException;
|
import java.util.NoSuchElementException;
|
||||||
|
|
||||||
|
import org.apache.commons.collections.BoundedCollection;
|
||||||
import org.apache.commons.collections.Buffer;
|
import org.apache.commons.collections.Buffer;
|
||||||
import org.apache.commons.collections.BufferOverflowException;
|
import org.apache.commons.collections.BufferOverflowException;
|
||||||
import org.apache.commons.collections.BufferUnderflowException;
|
import org.apache.commons.collections.BufferUnderflowException;
|
||||||
import org.apache.commons.collections.collection.BoundedCollection;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The BoundedFifoBuffer is a <strong>very</strong> efficient implementation of
|
* The BoundedFifoBuffer is a <strong>very</strong> efficient implementation of
|
||||||
|
@ -89,7 +89,7 @@ import org.apache.commons.collections.collection.BoundedCollection;
|
||||||
* This buffer prevents null objects from being added.
|
* This buffer prevents null objects from being added.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.1 $ $Date: 2003/11/29 18:04:57 $
|
* @version $Revision: 1.2 $ $Date: 2003/11/29 18:14:20 $
|
||||||
*
|
*
|
||||||
* @author Avalon
|
* @author Avalon
|
||||||
* @author Berin Loritsch
|
* @author Berin Loritsch
|
||||||
|
|
|
@ -1,91 +0,0 @@
|
||||||
/*
|
|
||||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/collection/Attic/BoundedCollection.java,v 1.1 2003/11/18 22:50:44 scolebourne Exp $
|
|
||||||
* ====================================================================
|
|
||||||
*
|
|
||||||
* The Apache Software License, Version 1.1
|
|
||||||
*
|
|
||||||
* Copyright (c) 2002-2003 The Apache Software Foundation. All rights
|
|
||||||
* reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions
|
|
||||||
* are met:
|
|
||||||
*
|
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in
|
|
||||||
* the documentation and/or other materials provided with the
|
|
||||||
* distribution.
|
|
||||||
*
|
|
||||||
* 3. The end-user documentation included with the redistribution, if
|
|
||||||
* any, must include the following acknowledgement:
|
|
||||||
* "This product includes software developed by the
|
|
||||||
* Apache Software Foundation (http://www.apache.org/)."
|
|
||||||
* Alternately, this acknowledgement may appear in the software itself,
|
|
||||||
* if and wherever such third-party acknowledgements normally appear.
|
|
||||||
*
|
|
||||||
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
|
|
||||||
* Foundation" must not be used to endorse or promote products derived
|
|
||||||
* from this software without prior written permission. For written
|
|
||||||
* permission, please contact apache@apache.org.
|
|
||||||
*
|
|
||||||
* 5. Products derived from this software may not be called "Apache"
|
|
||||||
* nor may "Apache" appear in their names without prior written
|
|
||||||
* permission of the Apache Software Foundation.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
||||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
|
|
||||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
|
||||||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
||||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
||||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
|
||||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
||||||
* SUCH DAMAGE.
|
|
||||||
* ====================================================================
|
|
||||||
*
|
|
||||||
* This software consists of voluntary contributions made by many
|
|
||||||
* individuals on behalf of the Apache Software Foundation. For more
|
|
||||||
* information on the Apache Software Foundation, please see
|
|
||||||
* <http://www.apache.org/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
package org.apache.commons.collections.collection;
|
|
||||||
|
|
||||||
import java.util.Collection;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A BoundedCollection is a collection that is bounded in size.
|
|
||||||
* <p>
|
|
||||||
* The size of the collection can vary, but it can never exceed a preset
|
|
||||||
* maximum number of elements. This interface allows the querying of details
|
|
||||||
* associated with the maximum number of elements.
|
|
||||||
*
|
|
||||||
* @since Commons Collections 3.0
|
|
||||||
* @version $Revision: 1.1 $ $Date: 2003/11/18 22:50:44 $
|
|
||||||
*
|
|
||||||
* @author Herve Quiroz
|
|
||||||
* @author Stephen Colebourne
|
|
||||||
*/
|
|
||||||
public interface BoundedCollection extends Collection {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if this collection is full and no new elements can be added.
|
|
||||||
*
|
|
||||||
* @return <code>true</code> if the collection is full
|
|
||||||
*/
|
|
||||||
boolean isFull();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the maximum size of the collection (the bound).
|
|
||||||
*
|
|
||||||
* @return the maximum number of elements the collection can hold
|
|
||||||
*/
|
|
||||||
int maxSize();
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/collection/UnmodifiableBoundedCollection.java,v 1.2 2003/11/18 22:50:44 scolebourne Exp $
|
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/collection/UnmodifiableBoundedCollection.java,v 1.3 2003/11/29 18:14:20 scolebourne Exp $
|
||||||
* ====================================================================
|
* ====================================================================
|
||||||
*
|
*
|
||||||
* The Apache Software License, Version 1.1
|
* The Apache Software License, Version 1.1
|
||||||
|
@ -59,6 +59,8 @@ package org.apache.commons.collections.collection;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
|
import org.apache.commons.collections.BoundedCollection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>UnmodifiableBoundedCollection</code> decorates another <code>BoundedCollection</code>
|
* <code>UnmodifiableBoundedCollection</code> decorates another <code>BoundedCollection</code>
|
||||||
* to ensure it can't be altered.
|
* to ensure it can't be altered.
|
||||||
|
@ -69,7 +71,7 @@ import java.util.Collection;
|
||||||
* examining the package scope variables.
|
* examining the package scope variables.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.2 $ $Date: 2003/11/18 22:50:44 $
|
* @version $Revision: 1.3 $ $Date: 2003/11/29 18:14:20 $
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/decorators/Attic/UnmodifiableBoundedCollection.java,v 1.6 2003/11/18 22:50:44 scolebourne Exp $
|
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/decorators/Attic/UnmodifiableBoundedCollection.java,v 1.7 2003/11/29 18:14:20 scolebourne Exp $
|
||||||
* ====================================================================
|
* ====================================================================
|
||||||
*
|
*
|
||||||
* The Apache Software License, Version 1.1
|
* The Apache Software License, Version 1.1
|
||||||
|
@ -59,7 +59,7 @@ package org.apache.commons.collections.decorators;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import org.apache.commons.collections.collection.BoundedCollection;
|
import org.apache.commons.collections.BoundedCollection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>UnmodifiableBoundedCollection</code> decorates another <code>BoundedCollection</code>
|
* <code>UnmodifiableBoundedCollection</code> decorates another <code>BoundedCollection</code>
|
||||||
|
@ -71,7 +71,7 @@ import org.apache.commons.collections.collection.BoundedCollection;
|
||||||
* examining the package scope variables.
|
* examining the package scope variables.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
* @version $Revision: 1.6 $ $Date: 2003/11/18 22:50:44 $
|
* @version $Revision: 1.7 $ $Date: 2003/11/29 18:14:20 $
|
||||||
* @deprecated TO BE REMOVED BEFORE v3.0
|
* @deprecated TO BE REMOVED BEFORE v3.0
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestBoundedFifoBuffer2.java,v 1.7 2003/11/18 22:51:19 scolebourne Exp $
|
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestBoundedFifoBuffer2.java,v 1.8 2003/11/29 18:14:20 scolebourne Exp $
|
||||||
* ====================================================================
|
* ====================================================================
|
||||||
*
|
*
|
||||||
* The Apache Software License, Version 1.1
|
* The Apache Software License, Version 1.1
|
||||||
|
@ -62,13 +62,11 @@ import java.util.Collection;
|
||||||
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
|
|
||||||
import org.apache.commons.collections.collection.BoundedCollection;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Runs tests against a full BoundedFifoBuffer, since many of the algorithms
|
* Runs tests against a full BoundedFifoBuffer, since many of the algorithms
|
||||||
* differ depending on whether the fifo is full or not.
|
* differ depending on whether the fifo is full or not.
|
||||||
*
|
*
|
||||||
* @version $Revision: 1.7 $ $Date: 2003/11/18 22:51:19 $
|
* @version $Revision: 1.8 $ $Date: 2003/11/29 18:14:20 $
|
||||||
*
|
*
|
||||||
* @author Unknown
|
* @author Unknown
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/buffer/TestBoundedFifoBuffer2.java,v 1.1 2003/11/29 18:04:56 scolebourne Exp $
|
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/buffer/TestBoundedFifoBuffer2.java,v 1.2 2003/11/29 18:14:20 scolebourne Exp $
|
||||||
* ====================================================================
|
* ====================================================================
|
||||||
*
|
*
|
||||||
* The Apache Software License, Version 1.1
|
* The Apache Software License, Version 1.1
|
||||||
|
@ -62,15 +62,15 @@ import java.util.Collection;
|
||||||
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
|
|
||||||
|
import org.apache.commons.collections.BoundedCollection;
|
||||||
import org.apache.commons.collections.BufferOverflowException;
|
import org.apache.commons.collections.BufferOverflowException;
|
||||||
import org.apache.commons.collections.BulkTest;
|
import org.apache.commons.collections.BulkTest;
|
||||||
import org.apache.commons.collections.collection.BoundedCollection;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Runs tests against a full BoundedFifoBuffer, since many of the algorithms
|
* Runs tests against a full BoundedFifoBuffer, since many of the algorithms
|
||||||
* differ depending on whether the fifo is full or not.
|
* differ depending on whether the fifo is full or not.
|
||||||
*
|
*
|
||||||
* @version $Revision: 1.1 $ $Date: 2003/11/29 18:04:56 $
|
* @version $Revision: 1.2 $ $Date: 2003/11/29 18:14:20 $
|
||||||
*
|
*
|
||||||
* @author Unknown
|
* @author Unknown
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue