REAL

The ASN.1 REAL type is converted to a Java class that extends the Asn1Real run-time class.

The Asn1Real base class is used for standard ASN.1 REAL specifications or XSD float or double types. This class encapsulates the following public member variable:

   public double value;

The following shows the basic mapping from ASN.1 type to Java class definition:

ASN.1 Production

<name> ::= REAL

XSD Types

<xsd:float>, <xsd:double>

Generated Java class

   public class <name> extends Asn1Real {
      public <name> () {
         super();
      }
      public <name> (double value_) {
         super (value_);
      }
   }

This shows the class generated for a simple REAL assignment. If a tagged or constrained type is specified, specific encode and decode methods will be generated as well.

REAL (Base 10)

The ASN.1 Base 10 REAL type is converted to a Java class that extends the Asn1Real10 run-time class. A base 10 real is specified in ASN.1 using a WITH COMPONENTS clause such as the following:

   REAL(WITH COMPONENTS {
      ...,
      base (10)
   })

It is also used for XSD decimal type specifications.

In this case, the real number is stored as a Java character string in the character string base class:

   public String value;

ASN.1 Production:

   <name> ::= REAL (WITH COMPONENTS { base(10) })

XSD Types

   <xsd:decimal>

Generated Java class

   public class <name> extends Asn1Real10 {
      public <name> () {
         super();
      }
      
      public <name> (String value_) {
         super (value_);
      }
   }