Package com.oss.asn1

Class SequenceOfDeferred<T extends AbstractData>

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

public abstract class SequenceOfDeferred<T extends AbstractData> extends AbstractContainer
The SetOfDeferred class represents the ASN.1 SEQUENCE OF type with a component type that has --<ASN1.DeferDecoding>-- directive.
Since:
ASN.1/Java 7.2
See Also:
  • Method Details

    • add

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

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

      public T get(int atIndex)
      Get an Element from this SEQUENCE 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 SEQUENCE 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 SEQUENCE 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.
    • getEncoded

      public byte[] getEncoded(int atIndex)
      Return encoding of deferred component.
      Parameters:
      atIndex - index of the element.
      Returns:
      encoding of the element
    • decode

      public void decode(Coder coder, int atIndex) throws DecodeNotSupportedException, DecodeFailedException
      Decode and set the decoded form of deferred component.
      Parameters:
      coder - coder object.
      atIndex - index of the element to decode.
      Throws:
      DecodeNotSupportedException - if decoding is not supported for the specified element.
      DecodeFailedException - if an error occurs while decoding.
    • encode

      public void encode(Coder coder, int atIndex) throws EncodeNotSupportedException, EncodeFailedException
      Encode the decoded form of deferred component and set its encoded form.
      Parameters:
      coder - coder object.
      atIndex - index of the element to encode.
      Throws:
      EncodeNotSupportedException - if encoding is not supported for the specified element.
      EncodeFailedException - if an error occurs while encoding.
    • createDeferredInstance

      public abstract AbstractData createDeferredInstance()
    • asCollection

      public Collection<T> asCollection()
      Return SEQUENCE OF as a collection of elements. The method is not supported and will throw UnsupportedOperationException.
      Returns:
      collection of elements.
    • equalTo

      public abstract boolean equalTo(SequenceOfDeferred<T> that)
      Compare 'this' object to another SeqquenceOF object to see if their contents are the same.
      Parameters:
      that - the SequenceOf object to compare 'this' object to.
      Returns:
      true if contents of both objects are the same.
    • 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.
    • removeAllElements

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

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