commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject cvs commit: jakarta-commons/collections/src/java/org/apache/commons/collections/primitives FloatArrayList.java
Date Fri, 21 Jun 2002 03:50:40 GMT
mas         2002/06/20 20:50:40

  Modified:    collections/src/java/org/apache/commons/collections/primitives
                        FloatArrayList.java
  Log:
  FloatArrayList didn't implement set(int,Object) or remove(int),
  essentially making it an unmodifiable List.  Since setFloat(int,float)
  and removeFloatAt(int) already existed, I added trivial
  implementations for set(int,Object) and remove(int).
  
  Submitted by: Paul Jack ( pjack at sfaf dot org )
  
  Revision  Changes    Path
  1.2       +13 -3     jakarta-commons/collections/src/java/org/apache/commons/collections/primitives/FloatArrayList.java
  
  Index: FloatArrayList.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/primitives/FloatArrayList.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FloatArrayList.java	4 Jun 2002 16:50:09 -0000	1.1
  +++ FloatArrayList.java	21 Jun 2002 03:50:40 -0000	1.2
  @@ -138,6 +138,12 @@
           return old;
       }
   
  +    public Object set(int index, Object value) {
  +        Float f = (Float)value;
  +        return new Float(setFloat(index, f.floatValue()));
  +    }
  +
  +
       public boolean addFloat(float value) {
           ensureCapacity(_size+1);
           _data[_size++] = value;
  @@ -182,6 +188,10 @@
               removeFloatAt(index);
               return true;
           }
  +    }
  +
  +    public Object remove(int index) {
  +        return new Float(removeFloatAt(index));
       }
   
       public void ensureCapacity(int mincap) {
  
  
  

--
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