Commit 75723df4 by Tom Tromey Committed by Tom Tromey

* java/util/Vector.java (remove(Object)): Implemented.

From-SVN: r35148
parent 983318fc
2000-07-20 Tom Tromey <tromey@cygnus.com>
* java/util/Vector.java (remove(Object)): Implemented.
2000-07-19 Jeff Sturm <jeff.sturm@appnet.com> 2000-07-19 Jeff Sturm <jeff.sturm@appnet.com>
* java/lang/natThrowable.cc (fillInStackTrace): Check for * java/lang/natThrowable.cc (fillInStackTrace): Check for
......
...@@ -413,10 +413,21 @@ public class Vector implements Cloneable, Serializable ...@@ -413,10 +413,21 @@ public class Vector implements Cloneable, Serializable
// { // {
// } // }
// TODO12: public synchronized boolean remove(Object o)
// public 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: // TODO12:
// public Object remove(int index) // public Object remove(int index)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment