Package com.tailf.proto
Class ConfEDouble
Object
com.tailf.proto.ConfEObject
com.tailf.proto.ConfEDouble
- All Implemented Interfaces:
Serializable
,Cloneable
- Direct Known Subclasses:
ConfEFloat
Provides a Java representation of E floats and doubles. E defines only one
floating point numeric type, however this class and its subclass
ConfEFloat
are used to provide representations corresponding to the
Java types Double and Float.- See Also:
-
Constructor Summary
ConstructorDescriptionConfEDouble
(double d) Create an E float from the given double value.Create an E float from a stream containing a double encoded in E external format. -
Method Summary
Modifier and TypeMethodDescriptiondouble
Get the value, as a double.void
encode
(ConfOutputStream buf) Convert this double to the equivalent E external representation.boolean
Determine if two floats are equal.float
Get the value, as a float.int
hashCode()
toString()
Get the string representation of this double.Methods inherited from class com.tailf.proto.ConfEObject
clone, decode
-
Constructor Details
-
ConfEDouble
public ConfEDouble(double d) Create an E float from the given double value. -
ConfEDouble
Create an E float from a stream containing a double encoded in E external format.- Parameters:
buf
- the stream containing the encoded value.- Throws:
ConfEDecodeException
- if the buffer does not contain a valid external representation of an E float.
-
-
Method Details
-
doubleValue
public double doubleValue()Get the value, as a double.- Returns:
- the value of this object, as a double.
-
floatValue
Get the value, as a float.- Returns:
- the value of this object, as a float.
- Throws:
ConfERangeException
- if the value cannot be represented as a float.
-
toString
Get the string representation of this double.- Specified by:
toString
in classConfEObject
- Returns:
- the string representation of this double.
-
encode
Convert this double to the equivalent E external representation.- Specified by:
encode
in classConfEObject
- Parameters:
buf
- an output stream to which the encoded value should be written.
-
equals
Determine if two floats are equal. Floats are equal if they contain the same value.- Specified by:
equals
in classConfEObject
- Parameters:
o
- the float to compare to.- Returns:
- true if the floats have the same value.
-
hashCode
public int hashCode()
-