Package com.ericsson.otp.erlang
Class OtpErlangDouble
- java.lang.Object
- 
- com.ericsson.otp.erlang.OtpErlangObject
- 
- com.ericsson.otp.erlang.OtpErlangDouble
 
 
- 
- All Implemented Interfaces:
- java.io.Serializable,- java.lang.Cloneable
 - Direct Known Subclasses:
- OtpErlangFloat
 
 public class OtpErlangDouble extends OtpErlangObject Provides a Java representation of Erlang floats and doubles. Erlang defines only one floating point numeric type, however this class and its subclassOtpErlangFloatare used to provide representations corresponding to the Java types Double and Float.- See Also:
- Serialized Form
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class com.ericsson.otp.erlang.OtpErlangObjectOtpErlangObject.Hash
 
- 
 - 
Field Summary- 
Fields inherited from class com.ericsson.otp.erlang.OtpErlangObjecthashCodeValue
 
- 
 - 
Constructor SummaryConstructors Constructor Description OtpErlangDouble(double d)Create an Erlang float from the given double value.OtpErlangDouble(OtpInputStream buf)Create an Erlang float from a stream containing a double encoded in Erlang external format.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intdoHashCode()doubledoubleValue()Get the value, as a double.voidencode(OtpOutputStream buf)Convert this double to the equivalent Erlang external representation.booleanequals(java.lang.Object o)Determine if two floats are equal.floatfloatValue()Get the value, as a float.java.lang.StringtoString()Get the string representation of this double.
 
- 
- 
- 
Constructor Detail- 
OtpErlangDoublepublic OtpErlangDouble(double d) Create an Erlang float from the given double value.
 - 
OtpErlangDoublepublic OtpErlangDouble(OtpInputStream buf) throws OtpErlangDecodeException Create an Erlang float from a stream containing a double encoded in Erlang external format.- Parameters:
- buf- the stream containing the encoded value.
- Throws:
- OtpErlangDecodeException- if the buffer does not contain a valid external representation of an Erlang float.
 
 
- 
 - 
Method Detail- 
doubleValuepublic double doubleValue() Get the value, as a double.- Returns:
- the value of this object, as a double.
 
 - 
floatValuepublic float floatValue() throws OtpErlangRangeExceptionGet the value, as a float.- Returns:
- the value of this object, as a float.
- Throws:
- OtpErlangRangeException- if the value cannot be represented as a float.
 
 - 
toStringpublic java.lang.String toString() Get the string representation of this double.- Specified by:
- toStringin class- OtpErlangObject
- Returns:
- the string representation of this double.
 
 - 
encodepublic void encode(OtpOutputStream buf) Convert this double to the equivalent Erlang external representation.- Specified by:
- encodein class- OtpErlangObject
- Parameters:
- buf- an output stream to which the encoded value should be written.
 
 - 
equalspublic boolean equals(java.lang.Object o) Determine if two floats are equal. Floats are equal if they contain the same value.- Specified by:
- equalsin class- OtpErlangObject
- Parameters:
- o- the float to compare to.
- Returns:
- true if the floats have the same value.
 
 - 
doHashCodeprotected int doHashCode() - Overrides:
- doHashCodein class- OtpErlangObject
 
 
- 
 
-