Package com.oss.asn1

Class SetOf<T extends AbstractData>

Type Parameters:
T - type of the SET OF element value
All Implemented Interfaces:
com.oss.asn1.Sizeable, Serializable, Cloneable, Iterable<T>

public abstract class SetOf<T extends AbstractData> extends AbstractContainer implements Iterable<T>
The SetOf class represents the ASN.1 SET OF type
Since:
ASN.1/Java 6.0
See Also:
  • Method Details

    • add

      public void add(T element)
      Add an Element to this SET OF.
      Parameters:
      element - an element to add to this SET OF
    • set

      public void set(T element, int atIndex)
      Set (replace) an Element in the SET OF.
      Parameters:
      element - new element to set.
      atIndex - index of the replaced element.
    • get

      public T get(int atIndex)
      Get an Element from this SET OF.
      Parameters:
      atIndex - index of the element.
      Returns:
      element specified by the index
    • insert

      public void insert(T element, int atIndex)
      Insert an Element into this SET OF at specified index.
      Parameters:
      element - element to insert.
      atIndex - index of inserted element.
    • remove

      public void remove(T element)
      Remove an Element from this SET OF.
      Parameters:
      element - element to remove.
    • remove

      public void remove(int index)
      Remove the AbstractData object identified by its index from the container.
      Parameters:
      index - the index of the object to remove.
    • removeAllElements

      public void removeAllElements()
      Remove all AbstractData object elements from the container. Container becomes empty.
      Specified by:
      removeAllElements in class AbstractContainer
    • iterator

      public Iterator<T> iterator()
      Returns an iterator over the elements in this SET OF in proper sequence.
      Specified by:
      iterator in interface Iterable<T extends AbstractData>
      Returns:
      Returns an iterator over the elements in this SET OF in proper sequence.
    • asCollection

      public Collection<T> asCollection()
      Return SET OF as a collection of elements.
      Returns:
      collection of elements.
    • getSize

      public int getSize()
      Return the size of the container.
      Specified by:
      getSize in interface com.oss.asn1.Sizeable
      Specified by:
      getSize in class AbstractContainer
      Returns:
      number of elements in the container.
    • equalTo

      public abstract boolean equalTo(SetOf that)
      Compare 'this' object to another SetOf object to see if their contents are the same.
      Parameters:
      that - the SetOf object to compare 'this' object to.
      Returns:
      true if contents of both objects are the same.
    • getTypeName

      public String getTypeName()
      Returns the name of ASN.1 type this java class represents.
      Overrides:
      getTypeName in class AbstractData
      Returns:
      the name of the ASN.1 type.
    • clone

      public Object clone()
      Create a deep copy of 'this' object.
      Returns:
      copy of 'this' object.