commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwaldh...@apache.org
Subject cvs commit: jakarta-commons/collections/src/java/org/apache/commons/collections/primitives IntCollection.java IntIterator.java IntList.java IntListIterator.java AbstractIntArrayList.java AbstractIntList.java IntArrayList.java UnsignedShortArrayList.java
Date Sat, 04 Jan 2003 15:00:57 GMT
rwaldhoff    2003/01/04 07:00:57

  Modified:    collections/src/java/org/apache/commons/collections/primitives
                        AbstractIntArrayList.java AbstractIntList.java
                        IntArrayList.java UnsignedShortArrayList.java
  Added:       collections/src/java/org/apache/commons/collections/primitives
                        IntCollection.java IntIterator.java IntList.java
                        IntListIterator.java
  Log:
  add IntCollection, IntList, IntIterator, IntListIterator
  deprecate various AbstractIntList implementations as a warning of impending change
  (note that nothing in primitives.* has yet been released)
  
  Revision  Changes    Path
  1.7       +10 -5     jakarta-commons/collections/src/java/org/apache/commons/collections/primitives/AbstractIntArrayList.java
  
  Index: AbstractIntArrayList.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/primitives/AbstractIntArrayList.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- AbstractIntArrayList.java	12 Oct 2002 22:15:20 -0000	1.6
  +++ AbstractIntArrayList.java	4 Jan 2003 15:00:57 -0000	1.7
  @@ -7,7 +7,7 @@
    *
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 1999-2002 The Apache Software Foundation.  All rights
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -74,6 +74,11 @@
    *
    * @version $Revision$ $Date$
    * @author Rodney Waldhoff 
  + * 
  + * @deprecated This class will soon change to implement 
  + *             {@link IntList} and not {@link List}. Adapters
  + *             between {@link List} and {@link IntList} will be
  + *             provided.
    */
   public abstract class AbstractIntArrayList extends AbstractIntList {
   
  
  
  
  1.5       +5 -4      jakarta-commons/collections/src/java/org/apache/commons/collections/primitives/AbstractIntList.java
  
  Index: AbstractIntList.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/primitives/AbstractIntList.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AbstractIntList.java	12 Oct 2002 22:15:20 -0000	1.4
  +++ AbstractIntList.java	4 Jan 2003 15:00:57 -0000	1.5
  @@ -87,6 +87,7 @@
    *
    * @version $Revision$ $Date$
    * @author Rodney Waldhoff 
  + * @deprecated To be replaced by {@link IntList}.  If useful, an adapter to this interface
could be provided.
    */
   public abstract class AbstractIntList extends AbstractList {
   
  
  
  
  1.8       +9 -5      jakarta-commons/collections/src/java/org/apache/commons/collections/primitives/IntArrayList.java
  
  Index: IntArrayList.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/primitives/IntArrayList.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- IntArrayList.java	12 Oct 2002 22:15:20 -0000	1.7
  +++ IntArrayList.java	4 Jan 2003 15:00:57 -0000	1.8
  @@ -7,7 +7,7 @@
    *
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 1999-2002 The Apache Software Foundation.  All rights
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -75,6 +75,10 @@
    *
    * @version $Revision$ $Date$
    * @author Rodney Waldhoff 
  + * @deprecated This class will soon change to implement 
  + *             {@link IntList} and not {@link List}. Adapters
  + *             between {@link List} and {@link IntList} will be
  + *             provided.
    */
   public class IntArrayList extends AbstractIntArrayList implements Serializable {
   
  
  
  
  1.8       +10 -4     jakarta-commons/collections/src/java/org/apache/commons/collections/primitives/UnsignedShortArrayList.java
  
  Index: UnsignedShortArrayList.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/primitives/UnsignedShortArrayList.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- UnsignedShortArrayList.java	12 Oct 2002 22:15:20 -0000	1.7
  +++ UnsignedShortArrayList.java	4 Jan 2003 15:00:57 -0000	1.8
  @@ -77,6 +77,12 @@
    *
    * @version $Revision$ $Date$
    * @author Rodney Waldhoff 
  + *
  + * @deprecated This class will soon change to implement 
  + *             {@link IntList} and not {@link List}. Adapters
  + *             between {@link List} and {@link IntList} will be
  + *             provided.
  + * 
    */
   public class UnsignedShortArrayList extends AbstractIntArrayList implements Serializable
{
   
  
  
  
  1.1                  jakarta-commons/collections/src/java/org/apache/commons/collections/primitives/IntCollection.java
  
  Index: IntCollection.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/primitives/IntCollection.java,v
1.1 2003/01/04 15:00:57 rwaldhoff Exp $
   * $Revision: 1.1 $
   * $Date: 2003/01/04 15:00:57 $
   *
   * ====================================================================
   *
   * 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 acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements 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 Group.
   *
   * 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.primitives;
  
  /**
   * A {@link java.util.Collection collection} of int values.
   *
   * @version $Revision: 1.1 $ $Date: 2003/01/04 15:00:57 $
   * @author Rodney Waldhoff 
   */
  public interface IntCollection {
            
      /** 
       * Ensures that I contain the specified element 
       * (optional operation).
       */
      boolean add(int element);
  
      /** 
       * {@link #add Adds} all of the elements in the 
       * specified collection to me 
       * (optional operation). 
       */ 
      boolean addAll(IntCollection c);
      
      /** 
       * Removes all my elements 
       * (optional operation). 
       */
      void clear();
  
      /** 
       * Returns <code>true</code> iff I contain 
       * the specified element. 
       */
      boolean contains(int element);
      
      /** 
       * Returns <code>true</code> iff I contain 
       * all of the elements in the given collection. 
       */
      boolean containsAll(IntCollection c);
      
      /** 
       * Compares the specified object with me for 
       * equality. 
       */
      boolean equals(Object o);
      
      /** 
       * Returns my hash code value. 
       */
      int hashCode();
      
      /** 
       * Returns true iff I contains no elements. 
       */
      boolean isEmpty();
      
      /** 
       * Returns an iterator over all my elements.
       */
      IntIterator iterator();
       
      /** 
       * Removes the first occurrence of the 
       * specified element (optional operation). 
       */
      boolean removeElement(int element);
      
      /** 
       * Removes from all the elements that are 
       * contained in the specified collection 
       * (optional operation). 
       */
      boolean removeAll(IntCollection c);
      
      /** 
       * Retains only the elements that are 
       * contained in the specified collection 
       * (optional operation). 
       */
      boolean retainAll(IntCollection c);
      
      /** 
       * Returns the number of elements I contain. 
       */
      int size();
      
      /** 
       * Returns an array containing all my elements.
       */
      int[] toArray();
      
      /** 
       * Returns an array containing all of the elements 
       * in me, using the given array if it is large enough.
       */
      int[] toArray(int[] a);
  }
  
  
  
  1.1                  jakarta-commons/collections/src/java/org/apache/commons/collections/primitives/IntIterator.java
  
  Index: IntIterator.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/primitives/IntIterator.java,v
1.1 2003/01/04 15:00:57 rwaldhoff Exp $
   * $Revision: 1.1 $
   * $Date: 2003/01/04 15:00:57 $
   *
   * ====================================================================
   *
   * 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 acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements 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 Group.
   *
   * 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.primitives;
  
  /**
   * A {@link java.util.Iterator iterator} over int values.
   *
   * @version $Revision: 1.1 $ $Date: 2003/01/04 15:00:57 $
   * @author Rodney Waldhoff 
   */
  public interface IntIterator {
      /** 
       * Returns <code>true</code> iff 
       * I have more elements. 
       */
      boolean hasNext();
      
      /** 
       * Returns 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 remove is not supported
       * @throws IllegalStateException if {@link #next} has not yet been 
       *         called, or {@link #remove} has already been called after 
       *         the last call to {@link #next}.
       */          
      void remove();
  }
  
  
  
  1.1                  jakarta-commons/collections/src/java/org/apache/commons/collections/primitives/IntList.java
  
  Index: IntList.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/primitives/IntList.java,v
1.1 2003/01/04 15:00:57 rwaldhoff Exp $
   * $Revision: 1.1 $
   * $Date: 2003/01/04 15:00:57 $
   *
   * ====================================================================
   *
   * 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 acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements 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 Group.
   *
   * 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.primitives;
  
  /**
   * An ordered collection (a {@link java.util.List}) of int values.
   *
   * @version $Revision: 1.1 $ $Date: 2003/01/04 15:00:57 $
   * @author Rodney Waldhoff 
   */
  public interface IntList {
      /** 
       * Inserts the specified element at the specified position 
       * within me (optional operation). 
       */
      void add(int index, int element);
            
      /** 
       * Returns the element at the specified position within 
       * me. 
       */
      Object get(int index);
      
      /** 
       * Returns the index of the first occurrence 
       * of the specified element within me, 
       * or <code>-1</code> if I do not contain 
       * the this element. 
       */
      int indexOf(int element);
       
      /** 
       * Returns the index of the last occurrence 
       * of the specified element within me, 
       * or -1 if I do not contain this element. 
       */
      int lastIndexOf(int element);
      
      /** 
       * Returns a list iterator over all my elements.
       */
      IntListIterator listIterator();
      
      /** 
       * Returns a list iterator over my elements,
       * starting at the specified position. The 
       * specified index indicates the first element 
       * that would be returned by an initial call 
       * to the next method. An initial call to the 
       * previous method would return the element 
       * with the specified index minus one.
       */
      IntListIterator listIterator(int index);
      
      /** 
       * Removes the element at the specified position in 
       * me (optional operation). 
       */
      int removeElementAt(int index);
     
      /** 
       * Replaces the element at the specified 
       * position in me with the specified element
       * (optional operation). 
       */
      int set(int index, int element);
      
      /** 
       * Returns a view of the elements within me 
       * between the specified fromIndex, inclusive, and 
       * toIndex, exclusive. 
       */
      IntList subList(int fromIndex, int toIndex);
  
  }
  
  
  
  1.1                  jakarta-commons/collections/src/java/org/apache/commons/collections/primitives/IntListIterator.java
  
  Index: IntListIterator.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/primitives/IntListIterator.java,v
1.1 2003/01/04 15:00:57 rwaldhoff Exp $
   * $Revision: 1.1 $
   * $Date: 2003/01/04 15:00:57 $
   *
   * ====================================================================
   *
   * 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 acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements 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 Group.
   *
   * 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.primitives;
  
  /**
   * A {@link java.util.ListIterator list iterator} over int values.
   *
   * @version $Revision: 1.1 $ $Date: 2003/01/04 15:00:57 $
   * @author Rodney Waldhoff 
   */
  public interface IntListIterator extends IntIterator {
      void add(int element);
      boolean hasNext();
      boolean hasPrevious();
      int next();
      int nextIndex();
      int previous();
      int previousIndex();
      void remove();
      void set(int element);
  }
  
  
  

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


Mime
View raw message