* java/util/Vector.java (remove(Object)): Implemented.
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 20 Jul 2000 19:27:57 +0000 (19:27 +0000)
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 20 Jul 2000 19:27:57 +0000 (19:27 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@35148 138bc75d-0d04-0410-961f-82ee72b054a4

libjava/ChangeLog
libjava/java/util/Vector.java

index 4c6f184..ace91c8 100644 (file)
@@ -1,3 +1,7 @@
+2000-07-20  Tom Tromey  <tromey@cygnus.com>
+
+       * java/util/Vector.java (remove(Object)): Implemented.
+
 2000-07-19  Jeff Sturm  <jeff.sturm@appnet.com>
 
        * java/lang/natThrowable.cc (fillInStackTrace): Check for
index b49f482..347d0ab 100644 (file)
@@ -413,10 +413,21 @@ public class Vector implements Cloneable, Serializable
   // {
   // }
 
-  // TODO12:
-  // public boolean remove(Object o)
-  // {
-  // }
+  public synchronized boolean remove(Object o)
+  {
+    for (int i = 0; i < elementCount; ++i)
+      {
+       if (o == null
+           ? elementData[i] == null
+           : o.equals (elementData[i]))
+         {
+           System.arraycopy (elementData, i, elementData, i + 1,
+                             elementCount - i - 1);
+           return true;
+         }
+      }
+    return false;
+  }
 
   // TODO12:
   // public Object remove(int index)