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
ConstructorsConstructorDescriptionConfEDouble(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 TypeMethodDescriptiondoubleGet the value, as a double.voidencode(ConfOutputStream buf) Convert this double to the equivalent E external representation.booleanDetermine if two floats are equal.floatGet the value, as a float.inthashCode()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:
toStringin classConfEObject- Returns:
- the string representation of this double.
-
encode
Convert this double to the equivalent E external representation.- Specified by:
encodein 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:
equalsin classConfEObject- Parameters:
o- the float to compare to.- Returns:
- true if the floats have the same value.
-
hashCode
public int hashCode()
-