Class DecimalValue

All Implemented Interfaces:
Peer

public final class DecimalValue extends Content
An element that creates a unit of data content representing a number with a fixed number of digits after the decimal. decimal-data is PCDATA that obeys the following rules:
1. no limit on the number of digits
2. optional leading sign
3. fractional digits beyond limit specified in "Digits" are rounded off
  • Constructor Details

    • DecimalValue

      public DecimalValue(Element parent, Node prevSibling)
  • Method Details

    • equals

      public boolean equals(Object object)
      Description copied from class: Content
      Equals is a helper function that returns whether two Contents are equal (case-sensitive, and considering the null state of both nodes).
      Overrides:
      equals in class Content
      Parameters:
      object - the content node to compare.
      Returns:
      true if the content nodes are equal.
    • hashCode

      public int hashCode()
      Description copied from class: Content
      Returns a hash code value for the object. This method is unsupported.
      Overrides:
      hashCode in class Content
    • getFormattedValue

      public String getFormattedValue()
      Get the formatted content of this element as a string, with the fracDigits attribute applied
      Returns:
      the string value
    • getScriptTable

      public ScriptTable getScriptTable()
      Overrides:
      getScriptTable in class Content
    • getValue

      public double getValue()
      Get the content of this element as a double, with the fracDigits attribute applied.
      Returns:
      a double precision value
    • setStrValue

      public void setStrValue(String sText, boolean bNotify, boolean bDefault)
      Overrides:
      setStrValue in class Content
    • setValue

      public void setValue(double dValue, boolean bFromData, boolean bNotify, boolean bDefault)
      Set the content of this element
      Parameters:
      dValue - the new value expressed as a double
    • setValue

      public void setValue(String sValue, boolean bFromData, boolean bNotify, boolean bDefault)
      Set the content of this element
      Overrides:
      setValue in class Content
      Parameters:
      sValue - new value as string. Use this method to set the value to null.
      bFromData -
    • toString

      public String toString()
      Description copied from class: Content
      Return the value of the content as a string
      Overrides:
      toString in class Content
      Returns:
      the string representation of the value.
    • valueHasTypeMismatch

      public boolean valueHasTypeMismatch()
      Returns true if the current value does not legally parse into a decimal with the appropriate number of leading digits.