You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sc...@apache.org on 2003/12/12 00:00:32 UTC

cvs commit: jakarta-commons/collections/src/java/org/apache/commons/collections/list FixedSizeList.java

scolebourne    2003/12/11 15:00:32

  Modified:    collections/src/java/org/apache/commons/collections/list
                        FixedSizeList.java
  Log:
  Implement BoundedCollection interface
  
  Revision  Changes    Path
  1.2       +12 -3     jakarta-commons/collections/src/java/org/apache/commons/collections/list/FixedSizeList.java
  
  Index: FixedSizeList.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/list/FixedSizeList.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FixedSizeList.java	16 Nov 2003 00:05:47 -0000	1.1
  +++ FixedSizeList.java	11 Dec 2003 23:00:32 -0000	1.2
  @@ -62,6 +62,7 @@
   import java.util.List;
   import java.util.ListIterator;
   
  +import org.apache.commons.collections.BoundedCollection;
   import org.apache.commons.collections.IteratorUtils;
   import org.apache.commons.collections.iterators.AbstractListIteratorDecorator;
   
  @@ -77,7 +78,7 @@
    * @author Stephen Colebourne
    * @author Paul Jack
    */
  -public class FixedSizeList extends AbstractListDecorator {
  +public class FixedSizeList extends AbstractListDecorator implements BoundedCollection {
   
       /**
        * Factory method to create a fixed size list.
  @@ -186,6 +187,14 @@
           public void remove(Object object) {
               throw new UnsupportedOperationException("List is fixed size");
           }
  +    }
  +
  +    public boolean isFull() {
  +        return true;
  +    }
  +
  +    public int maxSize() {
  +        return size();
       }
   
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org