resolve darcs stupidity
[org.ibex.core.git] / src / org / bouncycastle / asn1 / DERConstructedSet.java
index f675b42..27f060e 100644 (file)
@@ -4,45 +4,42 @@ import java.io.*;
 import java.util.*;
 
 public class DERConstructedSet
-    extends DERObject
+    extends ASN1Set
 {
-    private Vector set = new Vector();
-
     public DERConstructedSet()
     {
     }
 
-    public void addObject(
-        DEREncodable obj)
+    /**
+     * @param obj - a single object that makes up the set.
+     */
+    public DERConstructedSet(
+        DEREncodable   obj)
     {
-        set.addElement(obj);
+        this.addObject(obj);
     }
 
-    public Enumeration getObjects()
+    /**
+     * @param v - a vector of objects making up the set.
+     */
+    public DERConstructedSet(
+        DEREncodableVector   v)
     {
-        return set.elements();
+        for (int i = 0; i != v.size(); i++)
+        {
+            this.addObject(v.get(i));
+        }
     }
 
-    /**
-     * return the object at the set postion indicated by index.
-     *
-     * @param the set number (starting at zero) of the object
-     * @return the object at the set postion indicated by index.
-     */
-    public Object getObjectAt(
-        int index)
+    public void addObject(
+        DEREncodable    obj)
     {
-        return set.elementAt(index);
+        super.addObject(obj);
     }
 
-    /**
-     * return the number of objects in this set.
-     *
-     * @return the number of objects in this set.
-     */
     public int getSize()
     {
-        return set.size();
+        return size();
     }
 
     /*
@@ -59,7 +56,7 @@ public class DERConstructedSet
     {
         ByteArrayOutputStream   bOut = new ByteArrayOutputStream();
         DEROutputStream         dOut = new DEROutputStream(bOut);
-        Enumeration             e = getObjects();
+        Enumeration             e = this.getObjects();
 
         while (e.hasMoreElements())
         {