com.objsys.asn1j.runtime
Class Asn1Choice

java.lang.Object
  extended by com.objsys.asn1j.runtime.Asn1Type
      extended by com.objsys.asn1j.runtime.Asn1Choice
All Implemented Interfaces:
Asn1TypeIF, java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
Asn1CHARACTER_STRING_identification, Asn1EmbeddedPDV_identification, Asn1External_encoding, Asn1XerCHARACTER_STRING_identification, Asn1XerEmbeddedPDV_identification, Asn1XerExternal_encoding, Asn1XmlCHARACTER_STRING_identification, Asn1XmlEmbeddedPDV_identification, Asn1XmlExternal_encoding

public abstract class Asn1Choice
extends Asn1Type

This class represents the ASN.1 CHOICE built-in type.

See Also:
Serialized Form

Field Summary
protected  int choiceID
          This member variable is where the selected choice option identifier is stored.
protected  Asn1Type element
          This member variable is where the selected choice option value is stored.
 
Fields inherited from class com.objsys.asn1j.runtime.Asn1Type
BIT_STRING, BMPString, BOOLEAN, DATE, DATE_TIME, DURATION, ENUMERATED, EOC, EXTERNAL, GeneralString, GeneralTime, GraphicString, IA5String, INTEGER, NULL, NumericString, OBJECT_IDENTIFIER, ObjectDescriptor, OCTET_STRING, OID_IRI, OpenType, PrintableString, REAL, RELATIVE_OID_IRI, RelativeOID, SEQUENCE, SET, T61String, TeletexString, TIME, TIME_OF_DAY, UniversalString, UTCTime, UTF8String, VideotexString, VisibleString
 
Constructor Summary
Asn1Choice()
          The default constructor initializes the choiceID and value.
 
Method Summary
 boolean equals(java.lang.Object cv_)
          This method compares this type element with the passed type element.
 int getChoiceID()
          This method returns the choice identifier.
 Asn1Type getElement()
          This method returns the element object.
abstract  java.lang.String getElemName()
          This abstract method return the name of the selected element.
 int hashCode()
          This method returns the hashcode for the chosen element.
 void setElement(int choiceID, Asn1Type element)
          This protected method sets the choice ID and value to the given values.
 
Methods inherited from class com.objsys.asn1j.runtime.Asn1Type
clone, decode, decode, decode, decode, decode, decode, decode, decodeXML, encode, encode, encode, encode, encode, encode, encode, equals, getLength, getTypeName, indent, isOpenType, matchTag, matchTag, pdiag, print, setKey, setOpenType
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

choiceID

protected transient int choiceID
This member variable is where the selected choice option identifier is stored. This selects the choice option to be used. It is populated with one of the generated choice ID constants in a compiler-generated derived class.


element

protected transient Asn1Type element
This member variable is where the selected choice option value is stored. It can be accessed via the get and set methods in this class and in compiler-generated derived classes.

Constructor Detail

Asn1Choice

public Asn1Choice()
The default constructor initializes the choiceID and value.

Method Detail

getChoiceID

public int getChoiceID()
This method returns the choice identifier.


getElement

public Asn1Type getElement()
This method returns the element object.


getElemName

public abstract java.lang.String getElemName()
This abstract method return the name of the selected element. A concrete version is generated by the compiler.


setElement

public void setElement(int choiceID,
                       Asn1Type element)
This protected method sets the choice ID and value to the given values. It can only be invoked by compiler-generated set_ methods.


equals

public boolean equals(java.lang.Object cv_)
This method compares this type element with the passed type element.

Overrides:
equals in class java.lang.Object
Parameters:
cv_ - Asn1Choice type value

hashCode

public int hashCode()
This method returns the hashcode for the chosen element. If the element is null, the hashCode returned is 1, to avoid changing any other hash codes that depend on it.

Overrides:
hashCode in class Asn1Type