This type represents the ASN.1 CHOICE type as specified in ITU-T Recommendation X.680. On decoding, the decoder must be able to decide umambiguously which alternative choice it has to decode. For this reason all elements in a CHOICE type must have distinctive tags.
This class does not enforce the distinctive tag rule. Instead, the alternative with the first matching tag should be chosen by decoders. The application that builds the CHOICE type must take care not to produce ambiguous sets of alternatives.
This class distinguishes alternative choices and an inner type. Upon decoding, the inner type is selected from the list of choices based on the identifier octets encountered in the encoded stream. This type is then {@link #setInnerType set as the inner type} of thisinstance. Unless an inner type is set (either explicitly or by means of decoding) the state of the choice is undefined.
This instance always mimicks its inner type. The methods {@link ASN1Type#getTag getTag}, {@link ASN1Type#getTagClass getTagClass}, {@link ASN1Type#getValue getValue} all returnthe appropriate results of the corresponding method of the inner type. On encoding an instance of this class the inner type is encoded.
No nested CHOICE classes are supported. In principle this is easily supported but it is not good style to build such structures.
@author Volker Roth
@author Stefan Endler
@version "$Id: ASN1Choice.java,v 1.3 2007/08/11 18:21:50 sendler Exp $"