Package com.oss.asn1
Class MixedReal
java.lang.Object
com.oss.asn1.AbstractData
com.oss.asn1.AbstractReal
com.oss.asn1.MixedReal
- All Implemented Interfaces:
com.oss.asn1.Comparable
,Serializable
,Cloneable
The MixedReal class represents the ASN.1 REAL type with the MIXED
directive.
- Since:
- ASN.1/Java 1.0-beta A
- See Also:
-
Field Summary
Fields inherited from class com.oss.asn1.AbstractData
EQUALS, GREATER_THAN, LESS_THAN
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
Clone 'this' object.final int
compareTo
(DecimalReal that) Compare 'this' object to a DecimalReal object by comparing their correspondent double values to see whether the double value of 'this' object is less than, equal to, or greater than the one of another object.final int
Compare 'this' object to a MixedReal object by comparing their correspondent double values to see whether the double value of 'this' object is less than, equal to, or greater than the one of another object.final int
Compare 'this' object to a Real object to determine whether the contents of 'this' object is less than, equal to, or greater than the contents of another object.final String
Get the value of 'this' object as a string in NR3 format.void
delete()
Destroy the instance of the AbstractData.final double
Get the value of 'this' object as a double.final boolean
equalTo
(DecimalReal that) Compare 'this' object to another object to see if their contents are the same.final boolean
Compare 'this' object to another object to see if their contents are the same.final boolean
Compare 'this' object to another object to see if their contents are the same.final float
Get the value of 'this' object as a float.int
getBase()
Returns the base of the real number.int
hashCode()
Returns a hash code for this objectboolean
isNaN()
Detect if the current value is NaN (NOT-A-NUMBER).boolean
Detect if the current value is -INFINITY.boolean
Detect if the current value is negative zero (-0).boolean
Detect if the current value is +INFINITY.boolean
isZero()
Detect if the current value is zero (0).final void
setValue
(double value) Set the value of 'this' object from a double value.final void
setValue
(float value) Set the value of 'this' object from a float value.final void
Set the value of 'this' object by converting the input String value into a double.Methods inherited from class com.oss.asn1.AbstractData
equals, isEncodable, isPDU, isValid, toString, toString
-
Constructor Details
-
MixedReal
public MixedReal()The default constructor. -
MixedReal
public MixedReal(float value) Construct from a float.- Parameters:
value
- the float value to set 'this' object to.
-
MixedReal
public MixedReal(double value) Construct from a double.- Parameters:
value
- the double value to set 'this' object to.
-
MixedReal
Construct from a String.- Parameters:
value
- the String value to set 'this' object to.
-
-
Method Details
-
setValue
public final void setValue(float value) Set the value of 'this' object from a float value.- Parameters:
value
- the value to set 'this' object to.
-
setValue
public final void setValue(double value) Set the value of 'this' object from a double value.- Parameters:
value
- the double value to set 'this' object to.
-
setValue
Set the value of 'this' object by converting the input String value into a double.- Parameters:
value
- the String value to set 'this' object to.
-
floatValue
public final float floatValue()Get the value of 'this' object as a float.- Returns:
- value of 'this' object as a float.
-
doubleValue
public final double doubleValue()Get the value of 'this' object as a double.- Returns:
- value of 'this' object as a double.
-
decimalValue
Get the value of 'this' object as a string in NR3 format. The NR3 format is defined in ISO 6093:1985.- Returns:
- value of 'this' object as a string in NR3 format.
-
isZero
public boolean isZero()Detect if the current value is zero (0).- Returns:
- true if the current value is zero.
- Since:
- ASN.1/Java 7.0
-
isNegativeZero
public boolean isNegativeZero()Detect if the current value is negative zero (-0).- Returns:
- true if the current value is zero.
- Since:
- ASN.1/Java 7.0
-
isPositiveInfinity
public boolean isPositiveInfinity()Detect if the current value is +INFINITY.- Returns:
- true if the current value is +INFINITY.
- Since:
- ASN.1/Java 7.0
-
isNegativeInfinity
public boolean isNegativeInfinity()Detect if the current value is -INFINITY.- Returns:
- true if the current value is -INFINITY.
- Since:
- ASN.1/Java 7.0
-
isNaN
public boolean isNaN()Detect if the current value is NaN (NOT-A-NUMBER).- Returns:
- true if the current value is NaN.
- Since:
- ASN.1/Java 7.0
-
equalTo
Compare 'this' object to another object to see if their contents are the same.- Parameters:
that
- the Real object to compare 'this' object to.- Returns:
- true if contents of both objects are the same.
-
equalTo
Compare 'this' object to another object to see if their contents are the same.- Parameters:
that
- the DecimalReal object to compare 'this' object to.- Returns:
- true if contents of both objects are the same.
-
equalTo
Compare 'this' object to another object to see if their contents are the same.- Parameters:
that
- the MixedReal object to compare 'this' object to.- Returns:
- true if contents of both objects are the same.
-
compareTo
Compare 'this' object to a Real object to determine whether the contents of 'this' object is less than, equal to, or greater than the contents of another object.- Parameters:
that
- Real object that is compared with 'this' object- Returns:
- LESS_THAN, EQUALS, GREATER_THAN values as the results of comparison.
- Throws:
NullPointerException
- thrown when 'that' is null.
-
compareTo
Compare 'this' object to a DecimalReal object by comparing their correspondent double values to see whether the double value of 'this' object is less than, equal to, or greater than the one of another object.- Parameters:
that
- DecimalReal object that is compared with 'this' object- Returns:
- LESS_THAN, EQUALS, GREATER_THAN values as the results of comparison.
- Throws:
NullPointerException
- thrown when 'that' is null.
-
compareTo
Compare 'this' object to a MixedReal object by comparing their correspondent double values to see whether the double value of 'this' object is less than, equal to, or greater than the one of another object.- Parameters:
that
- MixedReal object that is compared with 'this' object- Returns:
- LESS_THAN, EQUALS, GREATER_THAN values as the results of comparison.
- Throws:
NullPointerException
- thrown when 'that' is null.
-
clone
Clone 'this' object.- Overrides:
clone
in classAbstractData
- Returns:
- a deep copy of 'this' object.
-
delete
public void delete()Destroy the instance of the AbstractData. The contract of this method is to facilitate garbage collection by explicit destruction of the data that is no longer needed.- Overrides:
delete
in classAbstractData
-
getBase
public int getBase()Returns the base of the real number.- Specified by:
getBase
in classAbstractReal
- Returns:
- the base of the real number - 2 for binary real or 10 for decimal real
-
hashCode
public int hashCode()Returns a hash code for this object- Overrides:
hashCode
in classAbstractData
- Returns:
- a hash code for this object
-