Lines Matching refs:buffer

61  * A buffer for generating string representations of doubles.
65 // The character buffer
68 // The number of characters in the buffer
83 * Create a buffer with the given capacity.
84 * @param capacity the capacity of the buffer.
91 * Append a character to the buffer, increasing its length.
99 * Clear the buffer contents and set its length to {@code 0}.
107 * Get the raw digits of this buffer as string.
108 * @return the raw buffer contents
123 * Returns the number of characters in the buffer.
124 * @return buffer length
131 * Returns the formatted buffer content as string, using the specified conversion mode
139 final StringBuilder buffer = new StringBuilder();
141 buffer.append('-');
148 toExponentialFormat(buffer);
150 toFixedFormat(buffer, digitsAfterPoint);
154 toFixedFormat(buffer, digitsAfterPoint);
158 toExponentialFormat(buffer);
160 toFixedFormat(buffer, digitsAfterPoint);
165 return buffer.toString();
168 private void toFixedFormat(final StringBuilder buffer, final int digitsAfterPoint) {
171 buffer.append('0');
173 buffer.append('.');
176 buffer.append('0');
178 buffer.append(chars, 0, length);
184 buffer.append(chars, 0, length);
186 buffer.append('0');
190 buffer.append(chars, 0, decimalPoint);
191 buffer.append('.');
192 buffer.append(chars, decimalPoint, length - decimalPoint);
198 buffer.append('.');
201 buffer.append('0');
206 private void toExponentialFormat(final StringBuilder buffer) {
207 buffer.append(chars[0]);
210 buffer.append('.');
211 buffer.append(chars, 1, length - 1);
213 buffer.append('e');
216 buffer.append('+');
218 buffer.append(exponent);