Class DtoaBuffer

java.lang.Object
com.oracle.truffle.js.runtime.doubleconv.DtoaBuffer

public final class DtoaBuffer extends Object
A buffer for generating string representations of doubles.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Maximal length of numbers converted by FastDtoa
  • Constructor Summary

    Constructors
    Constructor
    Description
    DtoaBuffer(int capacity)
    Create a buffer with the given capacity.
  • Method Summary

    Modifier and Type
    Method
    Description
    format(DtoaMode mode, int digitsAfterPoint)
    Returns the formatted buffer content as string, using the specified conversion mode and padding.
    int
    Get the position of the decimal point.
    int
    Returns the number of characters in the buffer.
    Get the raw digits of this buffer as string.
    void
    Clear the buffer contents and set its length to 0.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • kFastDtoaMaximalLength

      public static final int kFastDtoaMaximalLength
      Maximal length of numbers converted by FastDtoa
      See Also:
  • Constructor Details

    • DtoaBuffer

      public DtoaBuffer(int capacity)
      Create a buffer with the given capacity.
      Parameters:
      capacity - the capacity of the buffer.
  • Method Details

    • reset

      public void reset()
      Clear the buffer contents and set its length to 0.
    • getRawDigits

      public String getRawDigits()
      Get the raw digits of this buffer as string.
      Returns:
      the raw buffer contents
    • getDecimalPoint

      public int getDecimalPoint()
      Get the position of the decimal point.
      Returns:
      the decimal point position
    • getLength

      public int getLength()
      Returns the number of characters in the buffer.
      Returns:
      buffer length
    • format

      public String format(DtoaMode mode, int digitsAfterPoint)
      Returns the formatted buffer content as string, using the specified conversion mode and padding.
      Parameters:
      mode - conversion mode
      digitsAfterPoint - number of digits after point
      Returns:
      formatted string
    • toString

      public String toString()
      Overrides:
      toString in class Object