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

From-SVN: r35148
This commit is contained in:
Tom Tromey 2000-07-20 19:27:57 +00:00 committed by Tom Tromey
parent 983318fc16
commit 75723df4d3
2 changed files with 19 additions and 4 deletions

View 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

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