|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ericsson.otp.erlang.OtpErlangObject com.ericsson.otp.erlang.OtpErlangDouble
public class OtpErlangDouble
Provides a Java representation of Erlang floats and doubles. Erlang defines
only one floating point numeric type, however this class and its subclass
OtpErlangFloat
are used to provide representations corresponding to
the Java types Double and Float.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.ericsson.otp.erlang.OtpErlangObject |
---|
OtpErlangObject.Hash |
Field Summary |
---|
Fields inherited from class com.ericsson.otp.erlang.OtpErlangObject |
---|
hashCodeValue |
Constructor Summary | |
---|---|
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 Summary | |
---|---|
protected int |
doHashCode()
|
double |
doubleValue()
Get the value, as a double. |
void |
encode(OtpOutputStream buf)
Convert this double to the equivalent Erlang external representation. |
boolean |
equals(java.lang.Object o)
Determine if two floats are equal. |
float |
floatValue()
Get the value, as a float. |
java.lang.String |
toString()
Get the string representation of this double. |
Methods inherited from class com.ericsson.otp.erlang.OtpErlangObject |
---|
clone, decode, hashCode |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public OtpErlangDouble(double d)
public OtpErlangDouble(OtpInputStream buf) throws OtpErlangDecodeException
buf
- the stream containing the encoded value.
OtpErlangDecodeException
- if the buffer does not contain a valid external
representation of an Erlang float.Method Detail |
---|
public double doubleValue()
public float floatValue() throws OtpErlangRangeException
OtpErlangRangeException
- if the value cannot be represented as a float.public java.lang.String toString()
toString
in class OtpErlangObject
public void encode(OtpOutputStream buf)
encode
in class OtpErlangObject
buf
- an output stream to which the encoded value should be
written.public boolean equals(java.lang.Object o)
equals
in class OtpErlangObject
o
- the float to compare to.
protected int doHashCode()
doHashCode
in class OtpErlangObject
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |