Class ConfEDouble

Object
com.tailf.proto.ConfEObject
com.tailf.proto.ConfEDouble
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
ConfEFloat

public class ConfEDouble extends ConfEObject implements Serializable, Cloneable
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 Details

    • ConfEDouble

      public ConfEDouble(double d)
      Create an E float from the given double value.
    • ConfEDouble

      public ConfEDouble(ConfInputStream buf) throws ConfEDecodeException
      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

      public float floatValue() throws ConfERangeException
      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

      public String toString()
      Get the string representation of this double.
      Specified by:
      toString in class ConfEObject
      Returns:
      the string representation of this double.
    • encode

      public void encode(ConfOutputStream buf)
      Convert this double to the equivalent E external representation.
      Specified by:
      encode in class ConfEObject
      Parameters:
      buf - an output stream to which the encoded value should be written.
    • equals

      public boolean equals(Object o)
      Determine if two floats are equal. Floats are equal if they contain the same value.
      Specified by:
      equals in class ConfEObject
      Parameters:
      o - the float to compare to.
      Returns:
      true if the floats have the same value.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object