This is the mail archive of the java-patches@sourceware.cygnus.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

java.util.Vector



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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]