jp.bitmeister.asn1.type.builtin
Class REAL

java.lang.Object
  extended by jp.bitmeister.asn1.type.ASN1Type
      extended by jp.bitmeister.asn1.type.PrimitiveType<java.lang.Double>
          extended by jp.bitmeister.asn1.type.builtin.REAL
All Implemented Interfaces:
java.lang.Cloneable, ValueComparable

public class REAL
extends PrimitiveType<java.lang.Double>
implements ValueComparable

Represents ASN.1 'REAL' type.

An instance of this class represents a 'REAL' type data, and contains a Double value.

Author:
WATANABE, Jun.

Field Summary
 
Fields inherited from class jp.bitmeister.asn1.type.ASN1Type
stringBuilder
 
Constructor Summary
REAL()
          Instantiates an empty REAL.
REAL(java.lang.Double value)
          Instantiates a REAL and initialize it with the Double value.
REAL(java.lang.Float value)
          Instantiates a REAL and initialize it with the Float value.
REAL(long mantissa, int base, int exponent)
          Instantiates a REAL and initialize it with the value specified by the M*B^E formula.
 
Method Summary
<E extends java.lang.Throwable>
void
accept(ASN1Visitor<E> visitor)
          Accepts the ASN1Visitor and calls a visit method of the visitor.
 int compareTo(ASN1Type other)
          Compares the value of this instance to the value of the other instance.
 void set(java.lang.Float value)
          Sets the Float value to the instance.
 void set(long mantissa, int base, int exponent)
          Sets the value specified by the M*B^E formula to the instance.
 
Methods inherited from class jp.bitmeister.asn1.type.PrimitiveType
clear, clone, cloneValue, hashCode, hasValue, set, value, valueEquals
 
Methods inherited from class jp.bitmeister.asn1.type.ASN1Type
equals, instantiate, matches, specification, toString, validate
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

REAL

public REAL()
Instantiates an empty REAL.


REAL

public REAL(java.lang.Double value)
Instantiates a REAL and initialize it with the Double value.

Parameters:
value - The value assigned to the instance.

REAL

public REAL(java.lang.Float value)
Instantiates a REAL and initialize it with the Float value.

Parameters:
value - The value assigned to the instance.

REAL

public REAL(long mantissa,
            int base,
            int exponent)
Instantiates a REAL and initialize it with the value specified by the M*B^E formula.

Parameters:
mantissa - Mantissa.
base - Base. It can take values 2 or 10.
exponent - Exponent.
Method Detail

set

public void set(java.lang.Float value)
Sets the Float value to the instance.

Parameters:
value - The value assigned to the instance.

set

public void set(long mantissa,
                int base,
                int exponent)
Sets the value specified by the M*B^E formula to the instance.

Parameters:
mantissa - Mantissa.
base - Base. It can take values 2 or 10.
exponent - Exponent.

compareTo

public int compareTo(ASN1Type other)
Description copied from interface: ValueComparable
Compares the value of this instance to the value of the other instance.

Specified by:
compareTo in interface ValueComparable
Parameters:
other - The instance whose value to be compared.
Returns:
A negative integer, zero, or a positive integer as this value is less than, equal to, or greater than the other value.

accept

public <E extends java.lang.Throwable> void accept(ASN1Visitor<E> visitor)
            throws E extends java.lang.Throwable
Description copied from class: ASN1Type
Accepts the ASN1Visitor and calls a visit method of the visitor.

Specified by:
accept in class ASN1Type
Parameters:
visitor - The visitor.
Throws:
E extends java.lang.Throwable