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();
}
/*
{
ByteArrayOutputStream bOut = new ByteArrayOutputStream();
DEROutputStream dOut = new DEROutputStream(bOut);
- Enumeration e = getObjects();
+ Enumeration e = this.getObjects();
while (e.hasMoreElements())
{