This is the mail archive of the
java-patches@sourceware.cygnus.com
mailing list for the Java project.
java.util.Vector
- To: "\"gcj\" Patch List" <java-patches at sourceware dot cygnus dot com>
- Subject: java.util.Vector
- From: "Gregory R. Warnes" <warnes at biostat dot washington dot edu>
- Date: Thu, 18 May 2000 21:33:14 +0000 (GMT)
Not complete, but good enough for my app. Implements add(), get(),
set(), and remove().
--- libgcj/libjava/java/util/Vector.java Tue Apr 11 13:02:48 2000
+++ libgcj-snapshot-2000-05-03/libjava/java/util/Vector.java Tue May 16
14:15:27 2000
@@ -369,9 +369,11 @@
// }
// TODO12:
- // public public boolean add(Object o)
- // {
- // }
+ public boolean add(Object o)
+ {
+ addElement(o);
+ return true;
+ }
// TODO12:
// public void add(int index, Object element)
@@ -409,19 +411,24 @@
// }
// TODO12:
- // public Object get(int index)
- // {
- // }
-
- // TODO12:
- // public boolean remove(Object o)
- // {
- // }
-
- // TODO12:
- // public Object remove(int index)
- // {
- // }
+ public Object get(int index)
+ {
+ return elementAt(index);
+ }
+
+ // TODO12:
+ public boolean remove(Object o)
+ {
+ return removeElement(o);
+ }
+
+ // TODO12:
+ public Object remove(int index)
+ {
+ Object retval = get(index);
+ removeElementAt(index);
+ return retval;
+ }
// TODO12:
// public boolean removeAll(Collection c)
@@ -434,9 +441,11 @@
// }
// TODO12:
- // public Object set(int index, Object element)
- // {
- // }
+ public Object set(int index, Object element)
+ {
+ setElementAt(element, index);
+ return element;
+ }
// TODO12:
// public Object[] toArray()